diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 5fc2ff0d02f..f270d80dfe1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -10,6 +10,18 @@ on: - main - next +# 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' }} + permissions: contents: read @@ -19,10 +31,6 @@ jobs: runs-on: ${{ matrix.os }} - concurrency: - group: lint-${{ github.ref }} - cancel-in-progress: true - strategy: matrix: os: [ubuntu-latest] @@ -53,10 +61,6 @@ jobs: runs-on: ${{ matrix.os }} - concurrency: - group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ matrix.dev-server-version }}-${{ github.ref }} - cancel-in-progress: true - strategy: fail-fast: true matrix: @@ -109,10 +113,6 @@ jobs: runs-on: ${{ matrix.os }} - concurrency: - group: smoketests-${{ github.ref }} - cancel-in-progress: true - strategy: matrix: os: [ubuntu-latest]