Skip to content

nix workflow cancels superseded PR runs - #319

Closed
zjfroot wants to merge 1 commit into
mainfrom
jifeng/nix-cancel-superseded-pr-runs
Closed

zjfroot wants to merge 1 commit into
mainfrom
jifeng/nix-cancel-superseded-pr-runs

Conversation

@zjfroot

@zjfroot zjfroot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zjfroot
zjfroot requested a review from a team as a code owner October 6, 2026 09:17
@zjfroot
zjfroot requested a review from raphamorim October 6, 2026 11:20
@raphamorim

Copy link
Copy Markdown
Collaborator

merged in #321

@raphamorim raphamorim closed this Oct 7, 2026
@raphamorim
raphamorim deleted the jifeng/nix-cancel-superseded-pr-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