11name : Tests
22
3- on : [push, pull_request]
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened, ready_for_review]
6+ push :
7+ branches : [main]
8+
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+ cancel-in-progress : ${{ github.event_name != 'pull_request' }}
12+
13+ permissions :
14+ contents : read
415
516jobs :
617 test-node :
718 name : Test on Node.js (${{ matrix.node-version }})
819 runs-on : ubuntu-latest
20+ timeout-minutes : 20
921 strategy :
1022 matrix :
11- node-version : [18, 20, 22]
23+ node-version : [20, 22, 24]
1224
1325 steps :
1426 - name : Checkout code
15- uses : actions/checkout@v4
27+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1628
17- - name : Use Node.js ${{ matrix.node-version }}
18- uses : actions/setup-node@v4
29+ - name : Setup Node.js
30+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1931 with :
2032 node-version : ${{ matrix.node-version }}
2133
22- - name : Install dependencies
23- run : npm install
34+ - name : Setup Vite+
35+ uses : voidzero-dev/setup-vp@v1
36+ with :
37+ cache : true
2438
2539 - name : Run tests
26- run : npm run test
40+ run : vp test
2741
2842 test-bun :
2943 name : Test on Bun
3044 runs-on : ubuntu-latest
45+ timeout-minutes : 15
3146
3247 steps :
3348 - name : Checkout code
34- uses : actions/checkout@v4
49+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3550
36- - name : Install Bun
37- uses : oven-sh/setup-bun@v1
51+ - name : Setup Bun
52+ uses : oven-sh/setup-bun@v2
3853
39- - name : Install dependencies
40- run : bun install
54+ - name : Run tests
55+ run : bun test src
56+
57+ test-deno :
58+ name : Test on Deno
59+ runs-on : ubuntu-latest
60+ timeout-minutes : 15
61+
62+ steps :
63+ - name : Checkout code
64+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65+
66+ - name : Setup Deno
67+ uses : denoland/setup-deno@v2
68+ with :
69+ deno-version : v2.x
4170
4271 - name : Run tests
43- run : bun test
72+ run : deno test --unstable-sloppy-imports --allow-net src
4473
4574 test-browsers :
4675 name : Test on Browsers (${{ matrix.browser }})
4776 runs-on : ubuntu-latest
77+ timeout-minutes : 20
4878 strategy :
4979 matrix :
5080 browser : [edge, chrome, firefox]
5181
5282 steps :
5383 - name : Checkout code
54- uses : actions/checkout@v4
84+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5585
56- - name : Install dependencies
57- run : npm install
86+ - name : Setup Vite+
87+ uses : voidzero-dev/setup-vp@v1
88+ with :
89+ cache : true
5890
5991 - name : Run tests in ${{ matrix.browser }}
60- run : npm run test: ${{ matrix.browser }}-browser
92+ run : vp test --browser= ${{ matrix.browser }}
6193
6294 test-safari :
6395 name : Test on Browsers (safari)
6496 runs-on : macos-latest
97+ timeout-minutes : 25
6598
6699 steps :
67100 - name : Checkout code
68- uses : actions/checkout@v4
101+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69102
70- - name : Install dependencies
71- run : npm install
103+ - name : Setup Vite+
104+ uses : voidzero-dev/setup-vp@v1
105+ with :
106+ cache : true
72107
73108 - name : Run tests in Safari
74- run : npm run test: safari- browser
109+ run : vp test --browser= safari -- browser.headless=false
0 commit comments