Skip to content

nix workflow cancels superseded PR runs - #321

Merged
raphamorim merged 1 commit into
mainfrom
nix-cancel-superseded-runs
Oct 7, 2026
Merged

raphamorim merged 1 commit into
mainfrom
nix-cancel-superseded-runs

Conversation

@raphamorim

Copy link
Copy Markdown
Collaborator

Picked from #319, keeping its commit under Jifeng's authorship.

Problem

The nix workflow builds oj on macos-14 for every PR push, and each run is a cold ~48-minute build. With no concurrency block, a new push to a PR leaves the older run going to completion. On Sep 18, Sep 28 and Oct 1 superseded PR runs burned ~300–400 macOS minutes a day (billed ~10× Linux).

Change

A workflow-level concurrency group keyed on the PR number (or ref) cancels a PR's in-progress run when a newer commit arrives. cancel-in-progress is true only for pull_request: pushes to main and workflow_dispatch still build every commit; overlapping ones queue instead of being cancelled.

Larger follow-ups, not in this PR: drop the darwin leg from PR runs (~1,000–1,400 macOS min/day) and add a binary cache so darwin builds stop starting cold.

@raphamorim
raphamorim requested a review from a team as a code owner October 7, 2026 22:37
@raphamorim
raphamorim merged commit fe4912f into main Oct 7, 2026
7 checks passed
@raphamorim
raphamorim deleted the nix-cancel-superseded-runs branch October 7, 2026 22:37
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.

2 participants