diff --git a/.github/workflows/nodejs-ci.yml b/.github/workflows/nodejs-ci.yml index 5568813..afdde7b 100644 --- a/.github/workflows/nodejs-ci.yml +++ b/.github/workflows/nodejs-ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ["lts/*", "20", "16"] + node-version: ["lts/*", "20", "18", "16"] os: ["ubuntu-latest"] uses: ./.github/workflows/nodejs-test-reusable.yml with: diff --git a/.github/workflows/nodejs-test-reusable.yml b/.github/workflows/nodejs-test-reusable.yml index 2063d33..b678dcb 100644 --- a/.github/workflows/nodejs-test-reusable.yml +++ b/.github/workflows/nodejs-test-reusable.yml @@ -46,13 +46,18 @@ jobs: - name: Update npm to latest shell: bash - # NOTE: npm v10 has dropped support for Node.js v16. run: | - if [[ $(node -v) =~ ^v(16|14|12|10)\. ]]; then - npm install --global npm@9 - else - npm install --global npm@latest - fi + case $(node -v) in + v16.*|v14.*|v12.*|v10.*) + npm install --global npm@9 + ;; + v18.*) + npm install --global npm@10 + ;; + *) + npm install --global npm@latest + ;; + esac echo "Successfully updated npm to $(npm -v)" - name: Install dependencies