Skip to content

Commit 2a9a8df

Browse files
committed
Thanks, GitHub
1 parent 16c0710 commit 2a9a8df

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,29 @@ jobs:
4747
with:
4848
node-version: ${{ matrix.node-version }}
4949
check-latest: true
50+
5051
- run: |
51-
echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV"
52+
echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
5253
name: Enable require(ESM) and process.getBuiltin polyfill
54+
id: node-options
55+
5356
- run: npm ci
5457

5558
- name: Tests
5659
id: test
5760
# run tests, but lint separately
5861
run: npm run test -- --no-lint --bundle=${{ matrix.bundle }}
62+
env:
63+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
5964

6065
- name: Print baseline diff on failure
6166
if: ${{ failure() && steps.test.conclusion == 'failure' }}
6267
run: |
6368
npx hereby baseline-accept
6469
git add tests/baselines/reference
6570
git diff --staged --exit-code
71+
env:
72+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
6673

6774
lint:
6875
runs-on: ubuntu-latest
@@ -142,8 +149,9 @@ jobs:
142149
check-latest: true
143150

144151
- run: |
145-
echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV"
152+
echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
146153
name: Enable require(ESM) and process.getBuiltin polyfill
154+
id: node-options
147155
148156
- run: |
149157
npm --version
@@ -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
@@ -247,19 +261,26 @@ jobs:
247261
check-latest: true
248262

249263
- run: |
250-
echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV"
264+
echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
251265
name: Enable require(ESM) and process.getBuiltin polyfill
266+
id: node-options
252267
253268
- run: npm ci
254269

255270
- name: Build tsc
256271
run: npx hereby tsc
272+
env:
273+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
257274

258275
- name: Clean
259276
run: npx hereby clean-src
277+
env:
278+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
260279

261280
- name: Self build
262281
run: npx hereby build-src --built
282+
env:
283+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
263284

264285
baselines:
265286
runs-on: ubuntu-latest
@@ -272,8 +293,9 @@ jobs:
272293
check-latest: true
273294

274295
- run: |
275-
echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV"
296+
echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT"
276297
name: Enable require(ESM) and process.getBuiltin polyfill
298+
id: node-options
277299
278300
- run: npm ci
279301

@@ -282,11 +304,15 @@ jobs:
282304

283305
- name: Run tests
284306
run: npm test &> /dev/null || exit 0
307+
env:
308+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
285309

286310
- name: Accept baselines
287311
run: |
288312
npx hereby baseline-accept
289313
git add tests/baselines/reference
314+
env:
315+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
290316

291317
- name: Check baselines
292318
id: check-baselines
@@ -305,6 +331,8 @@ jobs:
305331
git diff --staged > fix_baselines.patch
306332
exit 1
307333
fi
334+
env:
335+
NODE_OPTIONS: ${{ steps.node-options.outputs.value }}
308336

309337
- name: Upload baseline diff artifact
310338
if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }}

0 commit comments

Comments
 (0)