diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 43284c6d..7fc5144a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,9 +17,10 @@ on: - cron: "0 6 * * 1" # weekly, Monday 06:00 UTC workflow_dispatch: -# Cancel superseded runs only for pull requests; runs on main are never cancelled. +# Cancel superseded runs only for pull requests. Other runs are grouped per commit +# so a newer queued run on main cannot replace an older commit's queued run. concurrency: - group: benchmark-${{ github.event_name }}-${{ github.ref }} + group: benchmark-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf8d177..8170c24d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,13 @@ on: - cron: "0 3 * * *" workflow_dispatch: -# Only a newer push to the same PR cancels an in-progress run. On main, each -# merge, the nightly schedule and manual dispatches get their own group and are -# never cancelled, so every merged commit keeps a complete result. +# Only a newer push to the same PR cancels its superseded run. Every other run +# (each merge to main, the nightly schedule, manual dispatches) is grouped by +# commit: a group keeps at most one queued run and a newer queued run replaces +# it even without cancel-in-progress, so a per-ref group still dropped the CI of +# back-to-back merges. Per-commit groups keep a complete result on every commit. concurrency: - group: ci-${{ github.event_name }}-${{ github.ref }} + group: ci-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} # Least privilege by default; jobs that need more (nightly alert issue, diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index e35aafd5..74a132f1 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -16,9 +16,11 @@ on: - ".github/workflows/notebooks.yml" workflow_dispatch: +# Cancel superseded runs only for pull requests; runs on main are grouped per +# commit so back-to-back merges each keep their notebook smoke result. concurrency: - group: notebooks-${{ github.ref }} - cancel-in-progress: true + group: notebooks-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read diff --git a/.github/workflows/perf-regression.yml b/.github/workflows/perf-regression.yml index 9789d3d5..39fb04a2 100644 --- a/.github/workflows/perf-regression.yml +++ b/.github/workflows/perf-regression.yml @@ -29,10 +29,10 @@ on: type: boolean default: false -# Cancel superseded runs only for pull requests; scheduled and manual runs on -# main never cancel each other. +# Cancel superseded runs only for pull requests. Scheduled and manual runs are +# grouped per commit so they never cancel or replace each other's queued runs. concurrency: - group: perf-regression-${{ github.event_name }}-${{ github.ref }} + group: perf-regression-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: