From 4a12f60a883e2f52d99e566c8649b8ff0e8a0486 Mon Sep 17 00:00:00 2001 From: kingchenc Date: Sun, 14 Jun 2026 00:23:36 +0200 Subject: [PATCH] ci: test the Node binding on the 22/24 LTS (18/20 are EOL) (#294) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: test the Node binding on the 22/24 LTS (18/20 are EOL) Node 18 is EOL and 20 reaches EOL; move the binding CI matrix from [18, 20] to [22, 24] (both LTS), bump the fixed Node setups in ci.yml/release.yml to 22, and raise package.json engines to >= 20. The N-API 8 binary is ABI-stable across Node versions, so no per-version build is needed. The `npm test` script (`node --test __tests__/`) breaks on Node 22 — it resolves `__tests__` as a module — so switch to `node --test` (auto- discovery). Verified locally on Node 22: build + 584 tests green. * build(node): sync package-lock engines.node to >= 20 * ci(node): drop the __tests__/ path arg so node --test auto-discovers On Node 22+, `node --test __tests__/` resolves the directory as a single module and fails with one unrunnable subtest. `node --test` (no path) auto-discovers every *.test.js under the package, matching the package.json test script. Verified locally: 584 tests pass. --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/release.yml | 12 ++++++------ bindings/node/package-lock.json | 2 +- bindings/node/package.json | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3f07a9d..1d78ab26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,7 +116,7 @@ jobs: continue-on-error: true uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" - name: Wait before Node retry if: steps.setup_node.outcome == 'failure' @@ -129,7 +129,7 @@ jobs: if: steps.setup_node.outcome == 'failure' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" - name: Set up Python id: setup_python @@ -231,7 +231,7 @@ jobs: continue-on-error: true uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" - name: Wait before Node retry if: steps.setup_node.outcome == 'failure' @@ -244,7 +244,7 @@ jobs: if: steps.setup_node.outcome == 'failure' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" - name: Cache cargo uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 @@ -574,7 +574,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: ["18", "20"] + node-version: ["22", "24"] steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: @@ -637,7 +637,7 @@ jobs: with: timeout_minutes: 6 max_attempts: 2 - command: cd bindings/node && node --test __tests__/ + command: cd bindings/node && node --test shell: bash c-abi: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 576fc1c5..9cb40e37 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -258,7 +258,7 @@ jobs: continue-on-error: true uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" - name: Wait before Node retry if: steps.setup_node.outcome == 'failure' @@ -271,7 +271,7 @@ jobs: if: steps.setup_node.outcome == 'failure' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable branch, 2026-03-27 with: @@ -319,7 +319,7 @@ jobs: continue-on-error: true uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" registry-url: "https://registry.npmjs.org" - name: Wait before Node retry @@ -333,7 +333,7 @@ jobs: if: steps.setup_node.outcome == 'failure' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" registry-url: "https://registry.npmjs.org" - name: Install Node deps @@ -488,7 +488,7 @@ jobs: continue-on-error: true uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" registry-url: "https://registry.npmjs.org" - name: Wait before Node retry @@ -502,7 +502,7 @@ jobs: if: steps.setup_node.outcome == 'failure' uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: "20" + node-version: "22" registry-url: "https://registry.npmjs.org" - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable branch, 2026-03-27 diff --git a/bindings/node/package-lock.json b/bindings/node/package-lock.json index c592e482..0c2fcacb 100644 --- a/bindings/node/package-lock.json +++ b/bindings/node/package-lock.json @@ -12,7 +12,7 @@ "@napi-rs/cli": "^2.18.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" }, "optionalDependencies": { "wickra-darwin-arm64": "0.9.0", diff --git a/bindings/node/package.json b/bindings/node/package.json index befb32b4..0ff18602 100644 --- a/bindings/node/package.json +++ b/bindings/node/package.json @@ -44,7 +44,7 @@ } }, "engines": { - "node": ">= 18" + "node": ">= 20" }, "optionalDependencies": { "wickra-linux-x64-gnu": "0.9.0", @@ -60,7 +60,7 @@ "artifacts": "napi artifacts", "universal": "napi universal", "version": "napi version", - "test": "node --test __tests__/", + "test": "node --test", "bench": "node benchmarks/throughput.js" }, "devDependencies": {