Every team that says "CI is expensive" eventually gets asked the follow-up question: how expensive, exactly — and where? Most can't answer it. So the optimisation work starts with folklore ("add caching"), burns a sprint, and ends with a bill that looks about the same.
There is a cheaper order of operations: measure first, in one unit, ranked. The unit is runner-minutes per day, per workflow. Once you have that table, the waste stops being a vibe and becomes a list — and most of it is not slow tests. It's waiting, duplication, and runs nobody needed.
The honest framing first
Standard GitHub-hosted runners are free for public repositories. If your repo is public, your "cost" is developer waiting time, concurrency headroom, and habits that will follow you into private repos. If your repo is private — or you use larger runners — runner-minutes are literal money. Either way, the measurement is the same, and you should only ever claim savings in the unit that actually applies to you. Invented percentages are how audits lose credibility.
Step 1: Get the number
The Actions API already knows everything. With the gh CLI you can pull recent runs for a workflow and total their durations:
gh run list --workflow ci.yml --limit 100 \ --json databaseId,createdAt,updatedAt,status,conclusion For each completed run, updatedAt − createdAt is wall-clock time; sum it per workflow, divide by the days covered, and you have minutes/day. Do this for every workflow, sort descending, and stop being surprised: in most repos, two or three workflows own nearly all of the minutes, and they are rarely the ones the team complains about.
One refinement that matters: separate queue+setup time from test time. A 22-minute job whose tests take 6 minutes is not a slow-test problem — it's a provisioning problem, and it has a completely different fix.
Step 2: The six patterns the table exposes
1. Cold caches, every run. Dependency installs repeated from zero on every job. The signature: install steps with near-identical durations across all jobs. The fix is boring — actions/cache or your setup action's built-in cache — and it's usually the single largest saver.
2. The same build in every job. A monorepo where 14 matrix jobs each run a full install + build before doing their one different thing. Build once, hand the artefact to downstream jobs, and let each job start from the artefact instead of from source.
3. Oversized matrices on PRs. The full OS × version × database matrix is a release gate. On a pull request it's mostly theatre. Collapse the PR matrix to the configurations that catch real breakage, and run the full matrix on merge or nightly.
4. Runs nobody cancels. Push three commits in five minutes and three full pipelines run to completion — two of them testing code that no longer exists. A concurrency group keyed to the ref, with cancel-in-progress: true for PR branches, deletes this category entirely.
5. Nightly full rebuilds of everything. Scheduled runs that rebuild components nobody touched. Path filters or an affected-components check turn "everything, nightly" into "what changed, nightly" — often an order-of-magnitude difference in scheduled minutes.
6. Expensive runners doing cheap work. A macOS runner (billed at a much higher per-minute rate than Linux) running a lint job. Match the runner to the job: the expensive machines should only do work that requires them.
Step 3: The required-check trap (read this before adding path filters)
Path filters and concurrency groups have one sharp edge: if a workflow is a required status check on your branch protection, a skipped run can leave a PR blocked forever on a check that will never report. The standard escape is a lightweight "gate" job that always runs and reports success/failure based on whether the real jobs ran or were legitimately skipped. Add the gate first, then add the filters.
Step 4: Turn findings into a plan, not a vibe
For each workflow, one row: runs/day, average minutes, minutes/day, which pattern it matches, the fix, and the minutes the fix should recover — estimated from your table, not from a blog post. Work the list top-down. Re-measure after a week of normal traffic and report before/after in the same units you measured in. That report is the deliverable, whether the audience is your team lead or your future self.
The kit
This method — the exact gh queries, all six patterns with before/after YAML, the copy-paste snippets (caching, BuildKit, build-once hand-off, concurrency + path filters with the gate job), the ranking worksheet, and a before/after report template — is packaged as the CI Cost Reduction Kit (USD 49):
And if you'd rather hand it off: CodeOps runs this audit + reduction as a fixed-price sprint (USD 500–650, 2–5 business days, measured before/after report included) — Contra or codeops.contact@gmail.com.
Measure first. The waste is rarely where the folklore says it is.
![Motion Planning and Navigation — Ch.06: Dynamic Obstacle Avoidance [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmbgqt1fikes5d9684vg8.png)
![Motion Planning and Navigation — Ch.08: Semantic Navigation [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjq2h442hn45tjle363x9.png)
![Motion Planning and Navigation — Ch.09: AI Based Planning [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa3n4x28z3pnqiurylhlw.png)