diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9e0a6ca --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-node@v7.1.0 + with: + node-version: 22 + cache: npm + # package-lock.json is written by npm 11, and the npm 10 bundled with + # Node 22 rejects it in `npm ci` (see the Dockerfile). + - name: Install npm 11 + run: npm install -g npm@11 + - name: Install dependencies + run: npm ci + - name: Run tests + run: npm test