Skip to content

ci: cancel superseded PR runs with a concurrency group - #32

Open
spacedevin wants to merge 1 commit into
mainfrom
ci/concurrency
Open

spacedevin wants to merge 1 commit into
mainfrom
ci/concurrency

Conversation

@spacedevin

Copy link
Copy Markdown
Member

Motivation

August 2026 billed ~23,000 Linux minutes on this repo. ~88% of that is the verify matrix (90 jobs, each billed rounded up to whole minutes, ~250 billed minutes per run). There were 59 PR runs and 44 main runs. ci.yml had no concurrency block, so every push to a PR branch left the previous run grinding through the full matrix for a commit that had already been replaced.

Change

Add a top-level concurrency block to ci.yml and screenshot.yml:

concurrency:
  group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
  • PR runs are grouped by PR number, so a new push cancels the superseded run.
  • Pushes to main are grouped by ref but cancel-in-progress is false for them: the main run cuts the prerelease and is the run chuggie.dev reads example-roms-verify-<id> from via nightly.link, so a superseded main run still has to finish.
  • The group is prefixed with the workflow name so the two workflows never cancel each other.

Nothing else changes. Both files parse (actionlint, ruby YAML.load_file); the one shellcheck note actionlint reports on ci.yml (SC2155 in the gba-shot build step) is pre-existing on main.

Every push to a PR branch started a fresh CI run while the previous one kept going, and the
verify matrix in that previous run (90 jobs, ~250 billed minutes) ran to completion for a
commit nobody would read a verdict on. August 2026 billed ~23,000 Linux minutes, ~88% of it
that matrix, across 59 PR runs.

A concurrency group keyed on the PR number cancels the in-progress run when a new push
arrives. Pushes to main are deliberately never cancelled: that run cuts the prerelease and
is what chuggie.dev reads its ROM artifacts from. screenshot.yml gets the same block.
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