@@ -30,20 +30,12 @@ jobs:
30
30
- macos-14
31
31
node-version :
32
32
- ' 22'
33
- - ' 20'
34
- - ' 18'
35
- - ' 16'
36
- - ' 14'
37
33
bundle :
38
34
- ' true'
39
35
include :
40
- - node-version : ' * '
36
+ - node-version : ' 22 '
41
37
bundle : false
42
38
os : ubuntu-latest
43
- exclude :
44
- # No Node 14 on ARM macOS
45
- - node-version : ' 14'
46
- os : macos-14
47
39
48
40
runs-on : ${{ matrix.os }}
49
41
name : Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }}
@@ -55,19 +47,29 @@ jobs:
55
47
with :
56
48
node-version : ${{ matrix.node-version }}
57
49
check-latest : true
50
+
51
+ - run : |
52
+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
53
+ name: Enable require(ESM) and process.getBuiltin polyfill
54
+ id: node-options
55
+
58
56
- run : npm ci
59
57
60
58
- name : Tests
61
59
id : test
62
60
# run tests, but lint separately
63
61
run : npm run test -- --no-lint --bundle=${{ matrix.bundle }}
62
+ env :
63
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
64
64
65
65
- name : Print baseline diff on failure
66
66
if : ${{ failure() && steps.test.conclusion == 'failure' }}
67
67
run : |
68
68
npx hereby baseline-accept
69
69
git add tests/baselines/reference
70
70
git diff --staged --exit-code
71
+ env :
72
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
71
73
72
74
lint :
73
75
runs-on : ubuntu-latest
@@ -145,6 +147,12 @@ jobs:
145
147
with :
146
148
node-version : ' *'
147
149
check-latest : true
150
+
151
+ - run : |
152
+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
153
+ name: Enable require(ESM) and process.getBuiltin polyfill
154
+ id: node-options
155
+
148
156
- run : |
149
157
npm --version
150
158
# corepack enable npm
@@ -154,12 +162,16 @@ jobs:
154
162
- run : npm ci
155
163
156
164
- run : npx hereby lkg
165
+ env :
166
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
157
167
- run : |
158
168
node ./scripts/addPackageJsonGitHead.mjs package.json
159
169
npm pack
160
170
mv typescript*.tgz typescript.tgz
161
171
echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT"
162
172
id: pack
173
+ env:
174
+ NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
163
175
164
176
- name : Smoke test
165
177
run : |
@@ -175,6 +187,8 @@ jobs:
175
187
176
188
node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript
177
189
node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript/lib/tsserverlibrary
190
+ env :
191
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
178
192
179
193
package-size :
180
194
runs-on : ubuntu-latest
@@ -243,18 +257,30 @@ jobs:
243
257
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
244
258
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
245
259
with :
246
- node-version : ' * '
260
+ node-version : ' 22 '
247
261
check-latest : true
262
+
263
+ - run : |
264
+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
265
+ name: Enable require(ESM) and process.getBuiltin polyfill
266
+ id: node-options
267
+
248
268
- run : npm ci
249
269
250
270
- name : Build tsc
251
271
run : npx hereby tsc
272
+ env :
273
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
252
274
253
275
- name : Clean
254
276
run : npx hereby clean-src
277
+ env :
278
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
255
279
256
280
- name : Self build
257
281
run : npx hereby build-src --built
282
+ env :
283
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
258
284
259
285
baselines :
260
286
runs-on : ubuntu-latest
@@ -263,20 +289,30 @@ jobs:
263
289
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
264
290
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
265
291
with :
266
- node-version : ' * '
292
+ node-version : ' 22 '
267
293
check-latest : true
294
+
295
+ - run : |
296
+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
297
+ name: Enable require(ESM) and process.getBuiltin polyfill
298
+ id: node-options
299
+
268
300
- run : npm ci
269
301
270
302
- name : Remove all baselines
271
303
run : rm -rf tests/baselines/reference
272
304
273
305
- name : Run tests
274
306
run : npm test &> /dev/null || exit 0
307
+ env :
308
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
275
309
276
310
- name : Accept baselines
277
311
run : |
278
312
npx hereby baseline-accept
279
313
git add tests/baselines/reference
314
+ env :
315
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
280
316
281
317
- name : Check baselines
282
318
id : check-baselines
@@ -295,6 +331,8 @@ jobs:
295
331
git diff --staged > fix_baselines.patch
296
332
exit 1
297
333
fi
334
+ env :
335
+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
298
336
299
337
- name : Upload baseline diff artifact
300
338
if : ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
0 commit comments