From fa17529569ea82fdb273eb7984d9a2b9bdc81845 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 2 May 2024 16:09:34 -0700 Subject: [PATCH] Thanks, GitHub --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faa0c241ed624..4e0f2d4fcb17b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,15 +47,20 @@ jobs: with: node-version: ${{ matrix.node-version }} check-latest: true + - run: | - echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV" + echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT" name: Enable require(ESM) and process.getBuiltin polyfill + id: node-options + - run: npm ci - name: Tests id: test # run tests, but lint separately run: npm run test -- --no-lint --bundle=${{ matrix.bundle }} + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Print baseline diff on failure if: ${{ failure() && steps.test.conclusion == 'failure' }} @@ -63,6 +68,8 @@ jobs: npx hereby baseline-accept git add tests/baselines/reference git diff --staged --exit-code + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} lint: runs-on: ubuntu-latest @@ -142,8 +149,9 @@ jobs: check-latest: true - run: | - echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV" + echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT" name: Enable require(ESM) and process.getBuiltin polyfill + id: node-options - run: | npm --version @@ -154,12 +162,16 @@ jobs: - run: npm ci - run: npx hereby lkg + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - run: | node ./scripts/addPackageJsonGitHead.mjs package.json npm pack mv typescript*.tgz typescript.tgz echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT" id: pack + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Smoke test run: | @@ -175,6 +187,8 @@ jobs: node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript node $GITHUB_WORKSPACE/scripts/checkModuleFormat.mjs typescript/lib/tsserverlibrary + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} package-size: runs-on: ubuntu-latest @@ -247,19 +261,26 @@ jobs: check-latest: true - run: | - echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV" + echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT" name: Enable require(ESM) and process.getBuiltin polyfill + id: node-options - run: npm ci - name: Build tsc run: npx hereby tsc + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Clean run: npx hereby clean-src + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Self build run: npx hereby build-src --built + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} baselines: runs-on: ubuntu-latest @@ -272,8 +293,9 @@ jobs: check-latest: true - run: | - echo "NODE_OPTIONS=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_ENV" + echo "value=--experimental-require-module --require $PWD/patchProcessGetBuiltin.cjs" >> "$GITHUB_OUTPUT" name: Enable require(ESM) and process.getBuiltin polyfill + id: node-options - run: npm ci @@ -282,11 +304,15 @@ jobs: - name: Run tests run: npm test &> /dev/null || exit 0 + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Accept baselines run: | npx hereby baseline-accept git add tests/baselines/reference + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Check baselines id: check-baselines @@ -305,6 +331,8 @@ jobs: git diff --staged > fix_baselines.patch exit 1 fi + env: + NODE_OPTIONS: ${{ steps.node-options.outputs.value }} - name: Upload baseline diff artifact if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }}