-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
297 lines (260 loc) · 6.97 KB
/
test.yml
File metadata and controls
297 lines (260 loc) · 6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
name: Test
on:
push:
pull_request:
schedule:
- cron: '0 12 */4 * *'
permissions:
contents: read
env:
npm_config_audit: false
npm_config_fund: false
npm_config_save: false
npm_config_package_lock: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- run: npm ci
- run: |
npm run build
cd build && ls -l
- uses: actions/upload-artifact@v6
with:
name: build
path: |
build
jsr.json
package.json
package-lite.json
package-main.json
retention-days: 1
checks:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: ${{ github.event_name == 'pull_request' && '15' || '1' }} # to ensure we have enough history for commitlint
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v7
with:
name: build
- run: npm ci
- name: Format
run: npm run fmt:check
- name: License
run: npm run test:license
- name: Size
run: npm run test:size
- name: Dep audit
run: npm run test:audit
- name: Circular
run: npm run test:circular
- name: Bundles
run: npm run test:npm
timeout-minutes: 1
- name: JSR dry-run
run: npm run test:jsr
- name: Conventional Commits
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: npx commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose
test:
needs: build
runs-on: ubuntu-latest
env:
FORCE_COLOR: 3
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v7
with:
name: build
- run: npm ci
- name: Unit tests
run: npm run test:coverage
timeout-minutes: 1
- name: Type tests
run: npm run test:types
docker-test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/download-artifact@v7
with:
name: build
- run: |
npm run build:dcr
npm run test:dcr
smoke-win32-node16:
strategy:
matrix:
os: [windows-2022, windows-2025]
name: smoke-${{ matrix.os }}-node16
runs-on: ${{ matrix.os }}
needs: build
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js 16
uses: actions/setup-node@v6
with:
node-version: 16
cache: 'npm'
- uses: actions/download-artifact@v7
with:
name: build
- run: npm run test:smoke:win32
timeout-minutes: 2
env:
FORCE_COLOR: 3
smoke-bun:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Bun
uses: antongolub/action-setup-bun@f0b9f339a7ce9ba1174a58484e4dc9bbd6f7b133 # v1.13.2
- uses: actions/download-artifact@v7
with:
name: build
- run: |
bun test ./test/smoke/bun.test.js
bun ./test/smoke/ts.test.ts
timeout-minutes: 1
env:
FORCE_COLOR: 3
smoke-deno:
runs-on: ubuntu-latest
needs: build
name: smoke-deno${{ matrix.deno-version }}
strategy:
matrix:
deno-version: [1, 2]
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Deno
uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2
with:
deno-version: ${{ matrix.deno-version }}
- run: deno install npm:types/node npm:types/fs-extra
- uses: actions/download-artifact@v7
with:
name: build
- run: deno test --allow-read --allow-sys --allow-env --allow-run ./test/smoke/deno.test.js
timeout-minutes: 1
env:
FORCE_COLOR: 3
smoke-node:
runs-on: ubuntu-latest
needs: build
name: smoke-node${{ matrix.node-version }}
strategy:
matrix:
node-version: [12, 14, 16, 18, 20, 22, 24, 25-nightly]
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/download-artifact@v7
with:
name: build
- name: cjs smoke test
run: npm run test:smoke:cjs
- name: mjs smoke test
run: npm run test:smoke:mjs
- name: strip-types
if: matrix.node-version >= 22
run: npm run test:smoke:strip-types
smoke-graal:
needs: build
runs-on: ubuntu-latest
name: smoke-graal${{ matrix.version }}
strategy:
matrix:
version: [17, 20]
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: graalvm/setup-graalvm@54b4f5a65c1a84b2fdfdc2078fe43df32819e4b1 # v1.4.4
with:
java-version: ${{ matrix.version }}
distribution: 'graalvm-community'
components: 'nodejs'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v7
with:
name: build
- name: smoke tests
run: |
which node
node -v
npm run test:smoke:cjs
smoke-ts:
runs-on: ubuntu-latest
needs: build
name: smoke-ts${{ matrix.ts }}
strategy:
matrix:
ts: [4, 5, 6, rc, next]
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- name: Install deps
run: npm ci
- name: Install TypeScript ${{ matrix.ts }}
run: npm i --force typescript@${{ matrix.ts }}
- name: Override @types/node
if: matrix.ts == 4
run: npm i --force @types/node@24.2.0
- uses: actions/download-artifact@v7
with:
name: build
- name: tsc
run: npm run test:smoke:tsc
- name: tsx
run: npm run test:smoke:tsx
- name: ts-node
run: npm run test:smoke:ts-node