Skip to content

Commit ca22970

Browse files
avrabeclaude
andauthored
chore(ci): add concurrency control to all workflows (#200)
Per the org-wide CI concurrency hardening brief — adds a top-level `concurrency:` block to every workflow under `.github/workflows/`. Goal: cancel superseded PR runs aggressively while never cancelling runs on `main`, tags, or scheduled events. Expected impact: 30-40% reduction in CI compute and clearing of the persistent runner queue backlog (spar had 21+ jobs queued at brief time, oldest 23h old). Variants applied: - `ci.yml` → **default** (group: workflow + head_ref/ref; cancel-in-progress conditional on pull_request event) - `proofs.yml` → **default** (Lean runs are multi-hour on cold cache; cancelling superseded PR commits is the highest-leverage saving; main runs still protected) - `bench-nightly.yml` → **scheduled** (per-run group via `github.run_id`; never cancel — each scheduled run is independent baseline data) - `fuzz-nightly.yml` → **scheduled** (same — corpus + crash data must accumulate) - `release.yml` → **release** (group: release-${ref}; never cancel — cancelling mid-publish leaves SLSA attestations + registry pushes inconsistent) Verification per the brief: - yaml.safe_load passes on all 5 files - Diff stays strictly inside `.github/workflows/` (no job restructure, no runner changes, no cache changes — all out of scope per brief) After merge, push a no-op follow-up to any open PR; the earlier run must show as Cancelled within ~30s. Post-merge main run must NOT be cancelled. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9ff68a0 commit ca22970

5 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/bench-nightly.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ name: Bench Nightly
88
# Scheduled at 03:30 UTC, offset from other nightly jobs (e.g. fuzzing)
99
# so bench machines aren't contending for runner minutes.
1010

11+
# Each scheduled run is independent baseline data — must complete and
12+
# never cancel its predecessor. Use a per-run group so two scheduled
13+
# runs never queue or cancel each other.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.run_id }}
16+
cancel-in-progress: false
17+
1118
on:
1219
schedule:
1320
- cron: "30 3 * * *"

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: CI
22

3+
# Cancel superseded PR runs; never cancel runs on main / tags / scheduled
4+
# events. See docs/ci-concurrency.md (or the org-wide CI concurrency brief)
5+
# for rationale.
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
8+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
9+
310
on:
411
push:
512
branches: [main]

.github/workflows/fuzz-nightly.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Fuzz (nightly)
22

3+
# Each scheduled fuzz run is independent corpus + crash data — must
4+
# complete and never cancel its predecessor. Per-run group so two
5+
# scheduled runs never queue or cancel each other.
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.run_id }}
8+
cancel-in-progress: false
9+
310
on:
411
schedule:
512
# Daily 03:00 UTC

.github/workflows/proofs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ name: Lean Proofs
1616
# (`proofs/.lake`) keyed on `lake-manifest.json`, so warm runs only
1717
# rebuild the in-tree proof modules.
1818

19+
# Lean proof runs are multi-hour on cold cache. Cancel superseded PR
20+
# runs aggressively; never cancel main / scheduled / tag runs.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1925
on:
2026
push:
2127
branches: [main]

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Release
22

3+
# Releases publish to registries + write SLSA attestations. Cancelling
4+
# mid-publish leaves external state inconsistent. Group for
5+
# serialization (one release per tag), never cancel.
6+
concurrency:
7+
group: release-${{ github.ref }}
8+
cancel-in-progress: false
9+
310
on:
411
push:
512
tags:

0 commit comments

Comments
 (0)