Skip to content

ci: cancel superseded CI runs on the same PR/branch - #35

Merged
locus313 merged 1 commit into
mainfrom
ci/concurrency-cancellation
Aug 27, 2026
Merged

ci: cancel superseded CI runs on the same PR/branch#35
locus313 merged 1 commit into
mainfrom
ci/concurrency-cancellation

Conversation

@locus313

Copy link
Copy Markdown
Owner

What

Adds a concurrency group to ci.yml, keyed on PR number (or ref for pushes), with cancel-in-progress: true.

Why

Live run history (gh run list) showed 4 full CI runs (97s–241s each) within a 7-minute window on the same PR, with none of them cancelled — each rapid push re-ran lint + test + integration-test (the dominant job at ~178s) to completion even though only the last run's result mattered.

No workflow in this repo currently defines concurrency, so this is pure waste on any PR that receives quick follow-up commits (fixups, CI-driven iterations, etc.).

Scope

Only added to ci.yml, the top-level caller — lint.yml, test.yml, and check-version.yml run as jobs within that same run via workflow_call, so cancelling the parent run cancels them too.

Not included (checked, didn't qualify)

  • Dependency caching — no lockfile-based deps to cache; apt installs are single small packages.
  • Parallelizing integration-test ahead of test — it intentionally gates on needs: test as a fail-fast measure before paying for the expensive sudo/user-creation job; removing that trades cost for latency.
  • CodeQL default-setup scans (Analyze (actions), ~36s) — this is a repo security setting, not a workflow file, so it's out of scope for this change.

Validation

  • yaml.safe_load confirms the edited file parses correctly.
  • Not yet proven live: recommend confirming on this PR itself by pushing a quick follow-up commit and checking that the first run gets cancelled.

Adds a concurrency group to ci.yml keyed on PR number (or ref for
pushes) with cancel-in-progress so rapid successive pushes to a PR
don't burn runner minutes on commits that are already superseded.

Live run history showed 4 full CI runs (97-241s each) within 7
minutes on the same PR with none cancelled.
@locus313
locus313 merged commit 56a0c6d into main Aug 27, 2026
7 checks passed
@locus313
locus313 deleted the ci/concurrency-cancellation branch August 27, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant