From 3756492cbf5cccbb263dd43bf760bb11c4167268 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 20 Aug 2026 12:44:44 +0200 Subject: [PATCH 1/4] ci: don't special case node version in workflow, instead skip tests in angular package --- .github/workflows/test.yaml | 12 +++------ packages/angular-runtime/package.json | 7 +++--- .../tools/skip-unsupported-node.js | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 packages/angular-runtime/tools/skip-unsupported-node.js diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f5f05d84..0a416f5b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -62,18 +62,12 @@ jobs: 'netlify/framework-adapters' }} run: echo "SKIP_LIVE_TESTS=true" >> "$GITHUB_ENV" - name: Tests - # angular-runtime requires Node 22+, so it's excluded on the Node 20 job - if: ${{ matrix.node-version != '20.19.0' }} + # A workspace that needs a newer Node than this matrix entry skips itself, so there is + # no list of workspaces to keep in sync here. See angular-runtime's + # `tools/when-supported-node.js`. run: npm run test --workspaces=true env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - name: Tests (excludes angular-runtime, which requires Node 22+) - if: ${{ matrix.node-version == '20.19.0' }} - run: >- - npm run test --workspace=packages/nuxt-module --workspace=packages/vite-plugin - --workspace=packages/vite-plugin-tanstack-start - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - name: Warn if live tests were skipped if: ${{ env.SKIP_LIVE_TESTS == 'true' }} run: | diff --git a/packages/angular-runtime/package.json b/packages/angular-runtime/package.json index fe13e54c..8a3f8dac 100644 --- a/packages/angular-runtime/package.json +++ b/packages/angular-runtime/package.json @@ -57,9 +57,9 @@ "pretest:fixtures:angular-22": "cd tests/fixtures/angular-22 && npm ci", "pretest:fixtures:nx-angular-19-common-engine": "cd tests/fixtures/nx-angular-19-common-engine && npm ci", "pretest:fixtures:nx-angular-19-app-engine": "cd tests/fixtures/nx-angular-19-app-engine && npm ci", - "pretest": "run-s pretest:*", + "pretest": "node tools/skip-unsupported-node.js || run-s pretest:*", "publint": "npx -y publint --strict", - "test": "node --test" + "test": "node tools/skip-unsupported-node.js || node --test" }, "repository": { "type": "git", @@ -83,7 +83,8 @@ "@opentelemetry/api": "~1.8.0", "@types/node": "^24.0.0", "netlify-cli": "^27.0.0", - "npm-run-all2": "^8.0.4" + "npm-run-all2": "^8.0.4", + "semver": "^7.7.2" }, "dependencies": { "@netlify/edge-functions": "^3.0.8", diff --git a/packages/angular-runtime/tools/skip-unsupported-node.js b/packages/angular-runtime/tools/skip-unsupported-node.js new file mode 100644 index 00000000..5066e10e --- /dev/null +++ b/packages/angular-runtime/tools/skip-unsupported-node.js @@ -0,0 +1,25 @@ +import process from 'node:process' + +import { satisfies } from 'semver' + +import pkg from '../package.json' with { type: 'json' } + +/** + * Decides whether this package's tests should run on the Node version in use. + * + * Exits 0 when they should be *skipped* and non-zero when they should run, so a caller can + * short-circuit with `node tools/skip-unsupported-node.js || ` and still report + * success on a skip. The inverted-looking exit code is deliberate: `&&` would make a skip + * indistinguishable from a test failure, and `!` negation is not available in the cmd.exe + * shell npm uses on Windows. + * + * This package needs a newer Node than the rest of the monorepo, so it opts itself out of + * the older CI matrix entries here. That keeps the workflow free of a hand-maintained list + * of workspaces to run, which would silently go stale as packages are added or their + * supported Node ranges change. + */ +if (satisfies(process.version, pkg.engines.node)) { + process.exitCode = 1 +} else { + console.log(`Skipping tests: ${pkg.name} requires Node ${pkg.engines.node}, but ${process.version} is running.`) +} From 99326e36954c676ecdaa6815cab9156d137e4439 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 20 Aug 2026 13:36:19 +0200 Subject: [PATCH 2/4] chore: don't add semver as devDep as it's already dep --- packages/angular-runtime/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/angular-runtime/package.json b/packages/angular-runtime/package.json index 8a3f8dac..5b10a6f6 100644 --- a/packages/angular-runtime/package.json +++ b/packages/angular-runtime/package.json @@ -83,8 +83,7 @@ "@opentelemetry/api": "~1.8.0", "@types/node": "^24.0.0", "netlify-cli": "^27.0.0", - "npm-run-all2": "^8.0.4", - "semver": "^7.7.2" + "npm-run-all2": "^8.0.4" }, "dependencies": { "@netlify/edge-functions": "^3.0.8", From 40a8ec82d064b22c63e704e6d391fa1f5341eaa0 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 20 Aug 2026 13:48:44 +0200 Subject: [PATCH 3/4] chore: update workflow comment --- .github/workflows/test.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0a416f5b..ab5f53ee 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,8 +6,8 @@ on: pull_request: types: [opened, synchronize, reopened] branches: - - '**' - - '!release-please--**' + - "**" + - "!release-please--**" merge_group: jobs: test: @@ -16,16 +16,16 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - node-version: ['24'] + node-version: ["24"] # `node-install-version` is what `setup-node` actually installs. # `node-version` is the display value used in the matrix job name # (which required status checks are pinned to), so it must stay stable. - node-install-version: ['24.15.0'] + node-install-version: ["24.15.0"] include: - os: ubuntu-latest # min node-version required by optional native bindings (e.g. @oxc-parser) - node-version: '20.19.0' - node-install-version: '20.19.0' + node-version: "20.19.0" + node-install-version: "20.19.0" fail-fast: false steps: # Increasing the maximum number of open files. See: @@ -41,7 +41,7 @@ jobs: uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-install-version }} - cache: 'npm' + cache: "npm" - name: Setup Deno uses: denoland/setup-deno@v1 with: @@ -64,7 +64,7 @@ jobs: - name: Tests # A workspace that needs a newer Node than this matrix entry skips itself, so there is # no list of workspaces to keep in sync here. See angular-runtime's - # `tools/when-supported-node.js`. + # `tools/skip-unsupported-node.js`. run: npm run test --workspaces=true env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} From b38d220748d9bca5884d885319ca0e6e5066fc30 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 20 Aug 2026 15:37:01 +0200 Subject: [PATCH 4/4] chore: format --- .github/workflows/test.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ab5f53ee..8559ff40 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,8 +6,8 @@ on: pull_request: types: [opened, synchronize, reopened] branches: - - "**" - - "!release-please--**" + - '**' + - '!release-please--**' merge_group: jobs: test: @@ -16,16 +16,16 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - node-version: ["24"] + node-version: ['24'] # `node-install-version` is what `setup-node` actually installs. # `node-version` is the display value used in the matrix job name # (which required status checks are pinned to), so it must stay stable. - node-install-version: ["24.15.0"] + node-install-version: ['24.15.0'] include: - os: ubuntu-latest # min node-version required by optional native bindings (e.g. @oxc-parser) - node-version: "20.19.0" - node-install-version: "20.19.0" + node-version: '20.19.0' + node-install-version: '20.19.0' fail-fast: false steps: # Increasing the maximum number of open files. See: @@ -41,7 +41,7 @@ jobs: uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-install-version }} - cache: "npm" + cache: 'npm' - name: Setup Deno uses: denoland/setup-deno@v1 with: