From 71dbf9642a367bd2427129b2ec2bbad65952071e Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 4 Dec 2024 17:56:35 +0100 Subject: [PATCH 1/4] GitHub Action to npm test on current versions of Node.js https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs Travis CI is no longer running tests. --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..50a7aa0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs + +name: Node.js CI +on: [push] +jobs: + build: + strategy: + matrix: + node-version: ['18.x', '20.x', '22.x'] + os: [ macos-latest, ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci || npm install + - run: npm run build --if-present + - run: npm test From cea5c6d5c15b88ec9cf0994e375566bbf32328e7 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 4 Dec 2024 18:36:19 +0100 Subject: [PATCH 2/4] Add npm lint --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50a7aa0..0ee8d42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ # https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs name: Node.js CI -on: [push] +on: [push, pull_request] jobs: build: strategy: @@ -17,4 +17,6 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci || npm install - run: npm run build --if-present + - run: npm audit || true + - run: npm lint - run: npm test From 21bfcdb1f9fb7d9585f84d4894ec24a8c59e38e0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 4 Dec 2024 18:39:27 +0100 Subject: [PATCH 3/4] npm run lint --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ee8d42..ad1965f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: - run: npm ci || npm install - run: npm run build --if-present - run: npm audit || true - - run: npm lint + - run: npm run lint - run: npm test From 1db8cbd8ce78df3e311806300f7ecaedd2ed9985 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 4 Dec 2024 21:24:28 +0100 Subject: [PATCH 4/4] node-version: ['18.x', '20.x', '22.x', 'latest'] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad1965f..51bffbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - node-version: ['18.x', '20.x', '22.x'] + node-version: ['18.x', '20.x', '22.x', 'latest'] os: [ macos-latest, ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: