From 43ebcfa3939c15ecf77c9713cc1a2246222262e2 Mon Sep 17 00:00:00 2001 From: Shinrai Date: Sat, 18 Jul 2026 21:46:09 -0700 Subject: [PATCH] ci: restrict the Node test matrix to LTS majors by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The matrix ran full (20/21/22/lts) on every event except direct pushes to master (`lts_only_matrix` was off-by-default). Node 21 is a non-LTS interim release the native-binding test toolchain (vitest 4 / rolldown / vite 8) excludes via `engines` (`^20.19.0 || >=22.12.0`), so its matrix leg dies at startup with "Cannot find native binding" — not a real per-version regression. This is what turned CI red on next: the release PR #3 runs as a pull_request event (ref refs/pull/3/merge), so it never matched the master-only LTS toggle and got the full matrix incl. the broken 21 leg. Default `lts_only_matrix` on for all events (workflow_dispatch can still opt out with false). Matrix is now 20/22/lts — the broken 21 leg is gone, per the LTS-only-majors CI policy. --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06e3e5d..51c66eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ on: description: "Only include even-numbered (LTS) Node.js major versions in the test matrix" type: boolean required: false - default: false + default: true package_manager: description: "Package manager (npm or yarn)" type: string @@ -186,9 +186,13 @@ jobs: node_version: ${{ github.event.inputs.node_version || 'lts/*' }} min_node_version: ${{ github.event.inputs.min_node_version || '20' }} max_node_major: ${{ github.event.inputs.max_node_major || '22' }} - # Full matrix on feature branches (catch per-version bugs pre-merge); - # LTS-only on master/main as the final confidence check / audit record. - lts_only_matrix: ${{ github.event.inputs.lts_only_matrix == 'true' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + # LTS-only matrix (even majors: 20, 22, 24, …) on every event. Odd majors + # (21, 23, …) are non-LTS interim releases, and the native-binding test + # toolchain (vitest 4 / rolldown / vite 8) excludes them via `engines` + # (`^20.19.0 || >=22.12.0`), so a "full matrix" on them only re-discovers a + # known toolchain gap ("Cannot find native binding") rather than a real + # per-version regression. workflow_dispatch can still opt out (set false). + lts_only_matrix: ${{ github.event.inputs.lts_only_matrix != 'false' }} package_manager: ${{ github.event.inputs.package_manager || 'npm' }} test_command: "npm test" # Use defaults: NODE_ENV=development, NODE_OPTIONS=--conditions=development # test_command: "NODE_OPTIONS='--conditions=slothlet-dev' npm test" # Override NODE_OPTIONS only