From 5ae564e244e553cab0de3267e921dcb8e5e96463 Mon Sep 17 00:00:00 2001 From: Kevin Costner <120246174+kevincostner17@users.noreply.github.com> Date: Tue, 15 Sep 2026 14:34:23 +0530 Subject: [PATCH] ci: never cancel in-progress runs on main CI, Benchmark and Performance regression used one concurrency group per ref with cancel-in-progress. On main, a later push, the scheduled run or a manual dispatch therefore cancelled the run already in progress. The nightly CI started at 08:32Z on 2026-09-15 and cancelled the push run for #350, which left 8 cancelled checks on 28072bf even though the same commit passed in full. Merging several PRs back to back would cancel the CI of every merge except the last. Group runs by event as well as ref, and cancel only when a newer push supersedes a pull_request run. --- .github/workflows/benchmark.yml | 5 +++-- .github/workflows/ci.yml | 7 +++++-- .github/workflows/perf-regression.yml | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index d8c03800..43284c6d 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. concurrency: - group: benchmark-${{ github.ref }} - cancel-in-progress: true + group: benchmark-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22e86898..dcf8d177 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,12 @@ 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. concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true + group: ci-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} # Least privilege by default; jobs that need more (nightly alert issue, # coverage-badge push) declare their own elevated permissions. diff --git a/.github/workflows/perf-regression.yml b/.github/workflows/perf-regression.yml index dcc7b811..9789d3d5 100644 --- a/.github/workflows/perf-regression.yml +++ b/.github/workflows/perf-regression.yml @@ -29,9 +29,11 @@ on: type: boolean default: false +# Cancel superseded runs only for pull requests; scheduled and manual runs on +# main never cancel each other. concurrency: - group: perf-regression-${{ github.ref }} - cancel-in-progress: true + group: perf-regression-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read