@@ -29,21 +29,13 @@ jobs:
2929 - windows-latest
3030 - macos-14
3131 node-version :
32- - ' 22'
33- - ' 20'
34- - ' 18'
35- - ' 16'
36- - ' 14'
32+ - 23-nightly
3733 bundle :
3834 - ' true'
3935 include :
40- - node-version : ' lts/* '
36+ - node-version : 23-nightly
4137 bundle : false
4238 os : ubuntu-latest
43- exclude :
44- # No Node 14 on ARM macOS
45- - node-version : ' 14'
46- os : macos-14
4739
4840 runs-on : ${{ matrix.os }}
4941 name : Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }}
@@ -55,19 +47,29 @@ jobs:
5547 with :
5648 node-version : ${{ matrix.node-version }}
5749 check-latest : true
50+
51+ - run : |
52+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
53+ name: Enable require(ESM)
54+ id: node-options
55+
5856 - run : npm ci
5957
6058 - name : Tests
6159 id : test
6260 # run tests, but lint separately
6361 run : npm run test -- --no-lint --bundle=${{ matrix.bundle }}
62+ env :
63+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
6464
6565 - name : Print baseline diff on failure
6666 if : ${{ failure() && steps.test.conclusion == 'failure' }}
6767 run : |
6868 npx hereby baseline-accept
6969 git add tests/baselines/reference
7070 git diff --staged --exit-code
71+ env :
72+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
7173
7274 coverage :
7375 runs-on :
@@ -83,11 +85,20 @@ jobs:
8385 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
8486 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
8587 with :
86- node-version : ' lts/*'
88+ node-version : ' 23-nightly'
89+ check-latest : true
90+
91+ - run : |
92+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
93+ name: Enable require(ESM)
94+ id: node-options
95+
8796 - run : npm ci
8897
8998 - name : Run tests with coverage
9099 run : npm test -- --no-lint --coverage
100+ env :
101+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
91102
92103 - name : Upload coverage artifact
93104 uses : actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
@@ -108,7 +119,8 @@ jobs:
108119 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
109120 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
110121 with :
111- node-version : ' lts/*'
122+ node-version : ' 23-nightly'
123+ check-latest : true
112124 - run : npm ci
113125
114126 - name : Linter
@@ -134,7 +146,8 @@ jobs:
134146 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
135147 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
136148 with :
137- node-version : ' lts/*'
149+ node-version : ' 23-nightly'
150+ check-latest : true
138151 - run : npm ci
139152
140153 - uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
@@ -154,7 +167,8 @@ jobs:
154167 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
155168 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
156169 with :
157- node-version : ' lts/*'
170+ node-version : ' 23-nightly'
171+ check-latest : true
158172 - run : npm ci
159173
160174 - name : Installing browsers
@@ -170,7 +184,8 @@ jobs:
170184 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
171185 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
172186 with :
173- node-version : ' lts/*'
187+ node-version : ' 23-nightly'
188+ check-latest : true
174189 - run : npm ci
175190
176191 - name : Build src
@@ -184,7 +199,14 @@ jobs:
184199
185200 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
186201 with :
187- node-version : ' lts/*'
202+ node-version : ' 23-nightly'
203+ check-latest : true
204+
205+ - run : |
206+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
207+ name: Enable require(ESM)
208+ id: node-options
209+
188210 - run : |
189211 npm --version
190212 # corepack enable npm
@@ -194,12 +216,16 @@ jobs:
194216 - run : npm ci
195217
196218 - run : npx hereby lkg
219+ env :
220+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
197221 - run : |
198222 node ./scripts/addPackageJsonGitHead.mjs package.json
199223 npm pack
200224 mv typescript*.tgz typescript.tgz
201225 echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT"
202226 id: pack
227+ env:
228+ NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
203229
204230 - name : Smoke test
205231 run : |
@@ -215,6 +241,8 @@ jobs:
215241
216242 node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript
217243 node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript/lib/tsserverlibrary
244+ env :
245+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
218246
219247 package-size :
220248 runs-on : ubuntu-latest
@@ -232,7 +260,8 @@ jobs:
232260
233261 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
234262 with :
235- node-version : ' lts/*'
263+ node-version : ' 23-nightly'
264+ check-latest : true
236265 - run : |
237266 npm --version
238267 # corepack enable npm
@@ -265,7 +294,8 @@ jobs:
265294 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
266295 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
267296 with :
268- node-version : ' lts/*'
297+ node-version : 23-nightly
298+ check-latest : true
269299 - run : npm ci
270300
271301 - name : Build scripts
@@ -281,17 +311,30 @@ jobs:
281311 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
282312 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
283313 with :
284- node-version : ' lts/*'
314+ node-version : 23-nightly
315+ check-latest : true
316+
317+ - run : |
318+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
319+ name: Enable require(ESM)
320+ id: node-options
321+
285322 - run : npm ci
286323
287324 - name : Build tsc
288325 run : npx hereby tsc
326+ env :
327+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
289328
290329 - name : Clean
291330 run : npx hereby clean-src
331+ env :
332+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
292333
293334 - name : Self build
294335 run : npx hereby build-src --built
336+ env :
337+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
295338
296339 baselines :
297340 runs-on : ubuntu-latest
@@ -300,19 +343,30 @@ jobs:
300343 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
301344 - uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
302345 with :
303- node-version : ' lts/*'
346+ node-version : 23-nightly
347+ check-latest : true
348+
349+ - run : |
350+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
351+ name: Enable require(ESM)
352+ id: node-options
353+
304354 - run : npm ci
305355
306356 - name : Remove all baselines
307357 run : rm -rf tests/baselines/reference
308358
309359 - name : Run tests
310360 run : npm test &> /dev/null || exit 0
361+ env :
362+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
311363
312364 - name : Accept baselines
313365 run : |
314366 npx hereby baseline-accept
315367 git add tests/baselines/reference
368+ env :
369+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
316370
317371 - name : Check baselines
318372 id : check-baselines
@@ -331,6 +385,8 @@ jobs:
331385 git diff --staged > fix_baselines.patch
332386 exit 1
333387 fi
388+ env :
389+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
334390
335391 - name : Upload baseline diff artifact
336392 if : ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
0 commit comments