From 988714fa443d95e2eadc36ea805622df500ed036 Mon Sep 17 00:00:00 2001 From: Roman Ivanov Date: Mon, 12 Oct 2026 09:40:25 -0700 Subject: [PATCH 1/2] ci: run successive main commits side by side A shared concurrency group queued the newer push until the older one finished. Each commit on main now has its own group, so it starts at once. Other refs still cancel the older run. Signed-off-by: Roman Ivanov --- .github/workflows/book.yml | 10 ++++------ .github/workflows/ci.yml | 5 +++-- .github/workflows/codeql.yml | 5 +++-- .github/workflows/cutile-rs.yml | 5 +++-- .github/workflows/docs.yml | 5 +++-- .github/workflows/examples-compile.yml | 5 +++-- .github/workflows/naming-guard.yml | 5 +++-- .github/workflows/status-guard.yml | 5 +++-- 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index b99d7a939..a1b7b189a 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -30,13 +30,11 @@ on: permissions: contents: read -# Serialising every run under one `pages` group is a deploy constraint, and -# applying it workflow-wide would queue unrelated PR builds behind each other. -# Scope this to the ref, and keep the single-deploy guarantee on the deploy job -# itself. Superseded PR runs are cancelled; pushes to main are not, so a -# publish in flight is never interrupted. +# Each commit on main builds immediately. Superseded pull requests are +# cancelled. The deploy job below keeps its own `pages` group so two +# publishes never overlap. concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7862db9e..bd0c76495 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,9 +28,10 @@ on: - 'Cargo.lock' - '.github/workflows/**' -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ci-gate-${{ github.ref_name }} + group: ci-gate-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} # Every other workflow in the repo pins this rather than inheriting whatever the diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index afdf30182..60aaba1f3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,9 +26,10 @@ on: schedule: - cron: "44 3 * * 6" -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} + group: ${{ github.workflow }}-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} jobs: diff --git a/.github/workflows/cutile-rs.yml b/.github/workflows/cutile-rs.yml index a853ad584..665ed1429 100644 --- a/.github/workflows/cutile-rs.yml +++ b/.github/workflows/cutile-rs.yml @@ -25,9 +25,10 @@ on: - "pull-request/[0-9]+" workflow_dispatch: -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} + group: ${{ github.workflow }}-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} permissions: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 98d6da40a..c924c78d7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,9 +26,10 @@ on: - 'Cargo.lock' - '.github/workflows/**' -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} + group: ${{ github.workflow }}-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} permissions: diff --git a/.github/workflows/examples-compile.yml b/.github/workflows/examples-compile.yml index 9efa9bd73..0f8544cb6 100644 --- a/.github/workflows/examples-compile.yml +++ b/.github/workflows/examples-compile.yml @@ -26,9 +26,10 @@ on: - 'Cargo.lock' - '.github/workflows/**' -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} + group: ${{ github.workflow }}-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} permissions: diff --git a/.github/workflows/naming-guard.yml b/.github/workflows/naming-guard.yml index 4f2e9dc4c..00eb30f37 100644 --- a/.github/workflows/naming-guard.yml +++ b/.github/workflows/naming-guard.yml @@ -22,9 +22,10 @@ on: - 'cuda-oxide/scripts/check-reserved-prefixes.sh' - '.github/workflows/naming-guard.yml' -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} + group: ${{ github.workflow }}-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} permissions: diff --git a/.github/workflows/status-guard.yml b/.github/workflows/status-guard.yml index 5704006c2..6c7ea3659 100644 --- a/.github/workflows/status-guard.yml +++ b/.github/workflows/status-guard.yml @@ -7,9 +7,10 @@ on: pull_request: branches: [main] -# main runs finish; any other ref cancels the older run of this workflow. +# Each commit on main gets its own group, so it starts at once. Any other ref +# still shares one group and cancels the older run. concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} + group: ${{ github.workflow }}-${{ github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.sha) || '' }} cancel-in-progress: ${{ github.ref_name != 'main' }} permissions: From c77a6b4e7a34b26e20f4f0815f87f5ae3d53f162 Mon Sep 17 00:00:00 2001 From: Roman Ivanov Date: Mon, 12 Oct 2026 11:39:59 -0700 Subject: [PATCH 2/2] ci: keep book publishes in commit order A per-commit concurrency group would build two main pushes at once, and the deploy that finishes last would publish. That can replace the site with an older book. This workflow stays one group per ref. Signed-off-by: Roman Ivanov --- .github/workflows/book.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index a1b7b189a..732ff8b66 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -30,11 +30,15 @@ on: permissions: contents: read -# Each commit on main builds immediately. Superseded pull requests are -# cancelled. The deploy job below keeps its own `pages` group so two -# publishes never overlap. +# Serialising every run under one `pages` group is a deploy constraint, and +# applying it workflow-wide would queue unrelated PR builds behind each other. +# Scope this to the ref, and keep the single-deploy guarantee on the deploy job +# itself. Superseded PR runs are cancelled; pushes to main are not, so a +# publish in flight is never interrupted. +# The group deliberately has no commit SHA. Parallel builds on main would let +# a slower older commit deploy after a newer one and replace the published site. concurrency: - group: ${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: