Files
sphinx/.github/workflows/nodejs.yml
Adam Turner 607908924c Always cancel in-progress workflows on new commits
The current ``github.head_ref || github.run_id`` syntax only cancels
in-progress GitHub Actions runs triggered by pull requests, as
``head_ref`` is only defined for pull requests, and ``run_id`` is
always unique. This changes to using ``ref``, which is the name of
the branch or tag linked to the commit, meaning that in-progress jobs
will be cancelled on pushes to a branch.
2023-02-15 03:35:49 +00:00

28 lines
534 B
YAML

name: CI (node.js)
on: [push, pull_request]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
node-version: "16"
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: "npm"
- run: npm install
- name: Run headless test
run: xvfb-run -a npm test