Skip to content

ci: cut macOS runner usage on PR checks - #1636

Open
Hona wants to merge 1 commit into
devfrom
macos-ci-budget
Open

Hona wants to merge 1 commit into
devfrom
macos-ci-budget

Conversation

@Hona

@Hona Hona commented Nov 10, 2026

Copy link
Copy Markdown
Member

Problem

The anomalyco org is on the Team plan, so at most 5 GitHub-hosted macOS jobs run at once, org-wide. Jobs wait hours for a runner. In the last 24 hours, hex used about 1,800 macOS runner-minutes (195 jobs that got a runner), the second-largest share in the org:

Workflow macOS jobs with a runner Runner-minutes
Check macOS (dispatched on PR branches) 65 845
Compile macOS 66 419
Release (build-macos, sign-macos, verify-macos) 45 291
Test builds macOS arm64 19 252

Two items overlap on PR branches:

  • Duplicate macOS clippy: Check macOS is dispatched for the PR head commit, usually within seconds of the push. 37 of the 66 Compile macOS jobs (247 minutes) ran on a commit that also had a Check macOS run. Check macOS runs the same cargo clippy --bin hex -D warnings, plus --lib --tests, fmt, and nextest.
  • No stale-run cancel: Check macOS has no concurrency group, so a new dispatch on a branch does not cancel the stale run.

Change

  • Compile: a new Linux job, macos-covered, waits 60 seconds. Then it looks for a non-cancelled workflow_dispatch Check macOS run on the PR head SHA. If it finds one, the macOS job is skipped. If the lookup fails, or if the workflow is dispatched, the macOS job runs as before.
  • Check macOS: a new dispatch on a branch cancels that branch's stale run. Release's workflow_call (where inputs.sha is set) and dispatches on dev or production each get a unique group (check-macos-run-<run_id>), so they are never cancelled or replaced.
  • AGENTS.md: the CI paragraph now describes both behaviors.

Expected impact

  • Compile macOS: about 33–37 fewer jobs and about 220–250 fewer runner-minutes per day. This is the 37 duplicate jobs, minus the few dispatches that came more than a minute after the push (4 of 52 matched commits).
  • Check macOS: about 1–2 fewer jobs and up to about 95 fewer runner-minutes per day. In the last 24 hours, few dispatches overlapped a still-running one on the same branch.
  • Total: about 35 jobs and 300–340 runner-minutes per day, or about 18% of hex's macOS use. Queue time for every macOS job in the org also goes down.
  • Cost: each PR push now uses one 1-minute Linux job. The macOS compile starts up to 60 seconds later. Today it waits about 30 minutes for a runner, so the delay is small.

Release risk

  • Release: release.yml, build-desktop.yml, windows-installers.yml, and test-builds.yml are unchanged.
  • Check macOS from Release: when Release calls Check macOS (check and stable channels), the new concurrency group is unique to that run, so nothing can cancel it.
  • Required checks: the only required check is hex-agent-policy, and this change does not touch it. Compile is not required.
  • Coverage that moves: for a PR commit with a Check macOS dispatch, the macOS compile signal now comes from Check macOS instead of Compile. Compile runs on the PR merge ref, and Check macOS runs on the branch head. If that Check macOS run fails before clippy (for example, at cargo fmt --check), the failure is still visible, but clippy did not run for that commit.

@Hona
Hona requested a review from thdxr as a code owner November 10, 2026 10:20
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
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