@@ -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 : ' * '
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 lint :
7375 runs-on : ubuntu-latest
7678 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
7779 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
7880 with :
79- node-version : ' * '
81+ node-version : ' 23-nightly '
8082 check-latest : true
8183 - run : npm ci
8284
9092 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
9193 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
9294 with :
93- node-version : ' * '
95+ node-version : ' 23-nightly '
9496 check-latest : true
9597 - run : npm ci
9698
@@ -111,7 +113,7 @@ jobs:
111113 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
112114 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
113115 with :
114- node-version : ' * '
116+ node-version : ' 23-nightly '
115117 check-latest : true
116118 - run : npm ci
117119
@@ -128,7 +130,7 @@ jobs:
128130 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
129131 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
130132 with :
131- node-version : ' * '
133+ node-version : ' 23-nightly '
132134 check-latest : true
133135 - run : npm ci
134136
@@ -143,8 +145,14 @@ jobs:
143145
144146 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
145147 with :
146- node-version : ' * '
148+ node-version : ' 23-nightly '
147149 check-latest : true
150+
151+ - run : |
152+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
153+ name: Enable require(ESM)
154+ id: node-options
155+
148156 - run : |
149157 npm --version
150158 # corepack enable npm
@@ -154,12 +162,16 @@ jobs:
154162 - run : npm ci
155163
156164 - run : npx hereby lkg
165+ env :
166+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
157167 - run : |
158168 node ./scripts/addPackageJsonGitHead.mjs package.json
159169 npm pack
160170 mv typescript*.tgz typescript.tgz
161171 echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT"
162172 id: pack
173+ env:
174+ NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
163175
164176 - name : Smoke test
165177 run : |
@@ -175,6 +187,8 @@ jobs:
175187
176188 node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript
177189 node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript/lib/tsserverlibrary
190+ env :
191+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
178192
179193 package-size :
180194 runs-on : ubuntu-latest
@@ -192,7 +206,7 @@ jobs:
192206
193207 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
194208 with :
195- node-version : ' * '
209+ node-version : ' 23-nightly '
196210 check-latest : true
197211 - run : |
198212 npm --version
@@ -226,7 +240,7 @@ jobs:
226240 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
227241 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
228242 with :
229- node-version : ' * '
243+ node-version : 23-nightly
230244 check-latest : true
231245 - run : npm ci
232246
@@ -243,18 +257,30 @@ jobs:
243257 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
244258 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
245259 with :
246- node-version : ' * '
260+ node-version : 23-nightly
247261 check-latest : true
262+
263+ - run : |
264+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
265+ name: Enable require(ESM)
266+ id: node-options
267+
248268 - run : npm ci
249269
250270 - name : Build tsc
251271 run : npx hereby tsc
272+ env :
273+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
252274
253275 - name : Clean
254276 run : npx hereby clean-src
277+ env :
278+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
255279
256280 - name : Self build
257281 run : npx hereby build-src --built
282+ env :
283+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
258284
259285 baselines :
260286 runs-on : ubuntu-latest
@@ -263,20 +289,30 @@ jobs:
263289 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
264290 - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
265291 with :
266- node-version : ' * '
292+ node-version : 23-nightly
267293 check-latest : true
294+
295+ - run : |
296+ echo "value=--no-warnings=ExperimentalWarning --experimental-require-module" >> "$GITHUB_OUTPUT"
297+ name: Enable require(ESM)
298+ id: node-options
299+
268300 - run : npm ci
269301
270302 - name : Remove all baselines
271303 run : rm -rf tests/baselines/reference
272304
273305 - name : Run tests
274306 run : npm test &> /dev/null || exit 0
307+ env :
308+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
275309
276310 - name : Accept baselines
277311 run : |
278312 npx hereby baseline-accept
279313 git add tests/baselines/reference
314+ env :
315+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
280316
281317 - name : Check baselines
282318 id : check-baselines
@@ -295,6 +331,8 @@ jobs:
295331 git diff --staged > fix_baselines.patch
296332 exit 1
297333 fi
334+ env :
335+ NODE_OPTIONS : ${{ steps.node-options.outputs.value }}
298336
299337 - name : Upload baseline diff artifact
300338 if : ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
0 commit comments