From fbb7820d3a133f28ef7604eee35a9b28ba0f18f7 Mon Sep 17 00:00:00 2001 From: Mario Del Corvo <330924865+marDC-it@users.noreply.github.com> Date: Thu, 15 Oct 2026 10:57:47 +0200 Subject: [PATCH] [ISSUE #654] Raise minimum Node.js to 22 LTS and modernise the CI workflows Node 18 and 20 are both end-of-life, while package.json still declared "node": ">=8.0.0" and the workflows pinned Node 16/20 on deprecated action versions. - package.json: engines.node >= 22.12.0, the floor commander@15 requires - .nvmrc: 22 - README: Node 22 LTS or newer, 24 recommended - build.yml: matrix [22.x, 24.x], checkout@v4, setup-node@v4 with npm cache - deploy.yml: checkout@v4, setup-node@v4, build on Node 24 - sync-to-main.yml: build on Node 24 instead of 16 Two details the matrix change would otherwise have broken silently: - the lint step was gated on matrix.node-version == '20.x' and would have stopped running; it now runs on 22.x - the coverage artifact had a fixed name, which actions/upload-artifact@v4 rejects when two matrix jobs upload it; the name now carries the version Verified locally on Node v24.21.0 (Windows): npm ci, npm run build (compiled successfully with no NODE_OPTIONS), npm run test:coverage (56 suites / 281 tests) and npm run lint all pass. --- .github/workflows/build.yml | 11 ++++++----- .github/workflows/deploy.yml | 6 +++--- .github/workflows/sync-to-main.yml | 2 +- .nvmrc | 2 +- README.md | 2 +- package.json | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24ce7d7b3..0fe4534a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,13 +13,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.x] + node-version: [22.x, 24.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + cache: npm - run: npm ci - name: Unit tests and coverage run: npm run test:coverage @@ -27,9 +28,9 @@ jobs: if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: unit-test-coverage + name: unit-test-coverage-${{ matrix.node-version }} path: coverage/ retention-days: 7 - run: npm run lint - if: matrix.node-version == '20.x' + if: matrix.node-version == '22.x' - run: npm run build --if-present diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8206bab8e..38e36c19c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,14 +13,14 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Setup Node - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24" - name: Setup Dependencies run: npm ci diff --git a/.github/workflows/sync-to-main.yml b/.github/workflows/sync-to-main.yml index f1c07860b..59c0cfb46 100644 --- a/.github/workflows/sync-to-main.yml +++ b/.github/workflows/sync-to-main.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '24' cache: 'npm' cache-dependency-path: 'package-lock.json' diff --git a/.nvmrc b/.nvmrc index 209e3ef4b..2bd5a0a98 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +22 diff --git a/README.md b/README.md index b3bc4e14f..1ed3ad63f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Apache ShenYu Dashboard is frontend of a management background for [Apache ShenYu](https://github.com/apache/shenyu). The API interface is in the [Apache Shenyu Admin](https://github.com/apache/shenyu/tree/master/shenyu-admin) module. ## Prerequisite -- Node.js 20.x and npm 10.x (the test and build CI baseline). Run `nvm use` +- Node.js 22 LTS or newer (24 recommended; CI builds on both). Run `nvm use` if you manage Node.js with nvm; the version is recorded in `.nvmrc`. ## How to Build diff --git a/package.json b/package.json index fb53077c4..493883298 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "**/*.less": "stylelint --syntax less" }, "engines": { - "node": ">=8.0.0" + "node": ">=22.12.0" }, "browserslist": [ "> 1%",