mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
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.
28 lines
534 B
YAML
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
|