From 4556b7ced175f8802ef32a0cb1af273e9bab5c24 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 2 Sep 2024 16:27:27 +0200 Subject: [PATCH] chore: do not test on EOL Node.js versions (#124) BREAKING CHANGE: `package.json` now contains `engines.node` --- .github/workflows/node.js.yml | 39 ++++++++++++++--------------------- package.json | 3 +++ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6ea78ea..715ed26 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -10,26 +10,19 @@ on: branches: [ main ] jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x, 18.x, 20.x] - - steps: - - uses: actions/checkout@v3 - with: - # Need commit history test for cli-tests - fetch-depth: 0 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm run build --if-present - - run: npm run test-ci - env: - CI: true - - run: bash <(curl -s https://codecov.io/bash) + test: + name: Test on Node.js + uses: pkgjs/action/.github/workflows/node-test.yaml@v0 + with: + # We need to fetch some specific commits that we are using in our tests. We also need `--deepen=2` for CodCov. + post-checkout-steps: | + - run: git fetch --deepen=2 origin 2b98d02b52a0abe98054eccb351e1e5c71c81bb0 69435db261650dfc74ede6dca89acbe97ba30081 + shell: bash + post-install-steps: | + - run: npm run build --if-present + shell: bash + test-command: npm run test-ci + post-test-steps: | + - name: Upload coverage report to Codecov + run: bash <(curl -s https://codecov.io/bash) + shell: bash diff --git a/package.json b/package.json index 5548524..f61c78b 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,9 @@ "bin": { "core-validate-commit": "./bin/cmd.js" }, + "engines": { + "node": "^18.18.0 || >=20.10.0" + }, "author": "Evan Lucas ", "repository": { "type": "git",