diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 51ffc32..3bac1ac 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -8,6 +8,18 @@ on: branches: - main +# A new commit supersedes the previous one's jobs, so stop paying for them +# across the whole matrix below. Only pull request runs share a group; every +# other run gets a group of its own (`github.run_id`), because a group holds +# at most one pending run and a later push would otherwise evict the one +# waiting — `cancel-in-progress` protects the running run, not the queued one. +# Runs for the branches this also builds on push publish the coverage later +# comparisons are measured against, and losing one would also hide a breakage +# that is already on the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: lint: name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }} @@ -18,9 +30,6 @@ jobs: os: [ubuntu-latest] node-version: [lts/*] runs-on: ${{ matrix.os }} - concurrency: - group: lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }} - cancel-in-progress: true steps: - uses: actions/checkout@v4 with: @@ -47,9 +56,6 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x, 26.x] runs-on: ${{ matrix.os }} - concurrency: - group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }} - cancel-in-progress: true steps: - name: Setup Git if: matrix.os == 'windows-latest'