From c194807eb25afe3c43568fb28145bfdf11848af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Wed, 21 Jun 2023 12:07:03 +0200 Subject: [PATCH 1/2] chore: update node engines to next LTS (node 20 / npm 9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index da9f5632..6d01347f 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "typescript": "^5.1.3" }, "engines": { - "node": "^16.0.0", - "npm": "^7.0.0 || ^8.0.0" + "node": "^20.0.0", + "npm": "^9.0.0" } } From 5e12eed42c2f3759d79ac05005869fab69041d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Wed, 21 Jun 2023 12:14:04 +0200 Subject: [PATCH 2/2] fix: adjust node-test workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .github/workflows/node-test.yml | 52 ++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index 57c4f08c..e2fa31b7 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -1,35 +1,59 @@ -name: Node +name: Node tests on: pull_request: push: branches: - - 'master' + - main + - master + - stable* + +permissions: + contents: read + +concurrency: + group: node-tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - node: [16, 18] - name: Test Node v${{ matrix.node }} + steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 + id: versions + with: + fallbackNode: '^20' + fallbackNpm: '^9' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: - node-version: ${{ matrix.node }} - cache: 'npm' - - name: install dependencies - run: npm ci - - name: build package + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies & build + run: | + npm ci + npm run build --if-present + + - name: Build package run: npm run build - - name: run tests + + - name: Tests run: npm run test summary: runs-on: ubuntu-latest needs: test if: always() + name: test-summary steps: - name: Summary status