@@ -3,56 +3,95 @@ name: Test
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- test :
6
+ build :
7
7
runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : actions/checkout@v4
10
+ - name : Use Node.js 20.x
11
+ uses : actions/setup-node@v4
12
+ with :
13
+ node-version : 20.x
14
+ - run : npm ci
15
+ - run : npm run build
16
+ - uses : actions/upload-artifact@v4
17
+ with :
18
+ name : build
19
+ path : |
20
+ build
21
+ package.json
22
+ retention-days : 1
8
23
24
+ test :
25
+ needs : build
26
+ runs-on : ubuntu-latest
27
+ env :
28
+ FORCE_COLOR : 3
9
29
strategy :
10
30
matrix :
11
31
node-version : [16.x, 18.x, 20.x]
12
-
13
32
steps :
14
33
- uses : actions/checkout@v4
15
34
- name : Use Node.js ${{ matrix.node-version }}
16
35
uses : actions/setup-node@v4
17
36
with :
18
37
node-version : ${{ matrix.node-version }}
38
+ - uses : actions/download-artifact@v4
39
+ with :
40
+ name : build
19
41
- run : npm ci
20
- - run : npm test
42
+ - name : run all tests
43
+ if : matrix.node-version == '20.x'
44
+ run : npm run test
45
+ - name : run unit tests
46
+ if : matrix.node-version != '20.x'
47
+ run : npm run test:unit
21
48
timeout-minutes : 1
22
- env :
23
- FORCE_COLOR : 3
24
49
25
- win32 :
50
+ smoke- win32-node16 :
26
51
runs-on : windows-latest
27
-
52
+ needs : build
28
53
steps :
29
54
- uses : actions/checkout@v4
30
55
- name : Use Node.js 16.x
31
56
uses : actions/setup-node@v4
32
57
with :
33
58
node-version : 16.x
34
- - run : npm ci
35
- - run : npm run build
36
- - run : node ./test/win32.test.js
59
+ - uses : actions/download-artifact@v4
60
+ with :
61
+ name : build
62
+ - run : npm run test:smoke:win32
37
63
timeout-minutes : 1
38
64
env :
39
65
FORCE_COLOR : 3
40
66
41
- bun :
42
- runs-on : ubuntu-latest
67
+ # smoke-node14:
68
+ # needs: build
69
+ # runs-on: ubuntu-latest
70
+ # steps:
71
+ # - uses: actions/checkout@v4
72
+ # - name: Use Node.js 14.x
73
+ # uses: actions/setup-node@v4
74
+ # with:
75
+ # node-version: 14.x
76
+ # - uses: actions/download-artifact@v4
77
+ # with:
78
+ # name: build
79
+ # - run: npm run test:smoke:node14
80
+ # timeout-minutes: 1
81
+ # env:
82
+ # FORCE_COLOR: 3
43
83
84
+ smoke-bun :
85
+ runs-on : ubuntu-latest
86
+ needs : build
44
87
steps :
45
88
- uses : actions/checkout@v4
46
- - name : Use Node.js 20.x
47
- uses : actions/setup-node@v4
48
- with :
49
- node-version : 20.x
50
89
- name : Setup Bun
51
90
uses : antongolub/action-setup-bun@v1
52
-
53
- - run : npm ci
54
- - run : npm run build
55
- - run : bun test ./test/bun.test.js
91
+ - uses : actions/download-artifact@v4
92
+ with :
93
+ name : build
94
+ - run : bun test ./test/smoke/ bun.test.js
56
95
timeout-minutes : 1
57
96
env :
58
97
FORCE_COLOR : 3
0 commit comments