diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 18fe752cfe..c73d17e758 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -26,7 +26,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # Cancel a superseded run only on pull requests; a run on main is left to finish (see ci.yml). + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: checkstyle: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11f7958d37..4aefbfae15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,16 @@ on: permissions: contents: read +# A new push to a pull request cancels its older run: only the latest head matters there. +# On main a running run is left to finish. A run takes about 18 minutes and merges often +# land closer together than that, so cancelling stopped 77 of 138 main runs partway through +# between 2026-10-05 and 2026-10-09 and left most main commits with no result. +# Without cancelling, the concurrency group still holds at most one pending run: a newer +# merge replaces the waiting one before it starts, so a burst of merges is tested once, at +# its newest commit, and no run is stopped halfway. concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: # Hardcoded on purpose: strategy.job-total counts EVERY matrix job, so adding an diff --git a/.github/workflows/docs-actions.yml b/.github/workflows/docs-actions.yml index ffa4624295..b8726e02ec 100644 --- a/.github/workflows/docs-actions.yml +++ b/.github/workflows/docs-actions.yml @@ -33,7 +33,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # Cancel a superseded run only on pull requests; a run on main is left to finish (see ci.yml). + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: action-tables: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0f02cd892e..b818b05661 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # This workflow never runs on pull requests, so a running deploy is left to finish (see ci.yml). + cancel-in-progress: false jobs: deploy: diff --git a/.github/workflows/partition-literals.yml b/.github/workflows/partition-literals.yml index 729b55cce6..a026b5a186 100644 --- a/.github/workflows/partition-literals.yml +++ b/.github/workflows/partition-literals.yml @@ -46,7 +46,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # Cancel a superseded run only on pull requests; a run on main is left to finish (see ci.yml). + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: partition-literals: