From 34b3f9f22aced8c31f3847d0ee5cfe58a4a123bc Mon Sep 17 00:00:00 2001 From: William Mantly Date: Thu, 23 Jul 2026 15:49:59 -0400 Subject: [PATCH] ci: PR test workflow + lockfile; require node >=20.14 node --test --test-force-exit needs Node 20.14+/22, so the matrix is [20.x, 22.x] and engines is bumped to match. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/pr-tests.yml | 52 ++++++++++++++++++++++++++++++++++ nodejs/package-lock.json | 2 +- nodejs/package.json | 2 +- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pr-tests.yml diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml new file mode 100644 index 0000000..34ca0cf --- /dev/null +++ b/.github/workflows/pr-tests.yml @@ -0,0 +1,52 @@ +name: Pull Request Tests + +on: + pull_request: + branches: + - master + push: + branches-ignore: + - master + +jobs: + test: + name: Run Tests + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x, 22.x] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: nodejs/package-lock.json + + - name: Install dependencies + working-directory: ./nodejs + run: npm ci + + - name: Run all tests + working-directory: ./nodejs + run: npm test + + test-summary: + name: Test Summary + runs-on: ubuntu-latest + needs: test + if: always() + + steps: + - name: Check test results + run: | + if [ "${{ needs.test.result }}" != "success" ]; then + echo "Tests failed. PR cannot be merged." + exit 1 + fi + echo "All tests passed successfully!" diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 70073aa..2d9411d 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -21,7 +21,7 @@ "nodemon": "^3.1.11" }, "engines": { - "node": ">=18" + "node": ">=20.14" } }, "node_modules/@redis/bloom": { diff --git a/nodejs/package.json b/nodejs/package.json index b2f09af..15f2540 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -9,7 +9,7 @@ } ], "engines": { - "node": ">=18" + "node": ">=20.14" }, "scripts": { "start": "node ./bin/www",