Skip to content

Commit 42acb3b

Browse files
committed
Enable CI
1 parent 677b4b4 commit 42acb3b

File tree

1 file changed

+49
-11
lines changed

1 file changed

+49
-11
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,12 @@ jobs:
3030
- macos-14
3131
node-version:
3232
- '22'
33-
- '20'
34-
- '18'
35-
- '16'
36-
- '14'
3733
bundle:
3834
- 'true'
3935
include:
40-
- node-version: '*'
36+
- node-version: '22'
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 --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
53+
name: Enable require(ESM) and process.getBuiltin polyfill
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
@@ -145,6 +147,12 @@ jobs:
145147
with:
146148
node-version: '*'
147149
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+
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
@@ -243,18 +257,30 @@ jobs:
243257
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
244258
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
245259
with:
246-
node-version: '*'
260+
node-version: '22'
247261
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+
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
264290
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
265291
with:
266-
node-version: '*'
292+
node-version: '22'
267293
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+
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

Comments
 (0)