From 7514a48e7f5b45497527d134c03bb33721b859ec Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Thu, 12 Nov 2026 16:42:37 -0800 Subject: [PATCH] ci: run the tests and build on pull requests The repo only had release.yml, so npm test never ran on a pull request. This runs npm ci, npm test and npm run build on every pull request and on pushes to main, on the same Node version and pinned actions as the release workflow. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e87bd85 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + test: + name: Test and build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Node + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 + with: + node-version: "24.14.0" + cache: "npm" + cache-dependency-path: ./package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build + run: npm run build