Last verified April 2026 · 10 min read
The 12 CI workflow anti-patterns burning your budget right now
If your CI bill just spiked and you don't know why, walk this list in order. In most pipelines, 60-80% of wasted spend comes from 2-3 of these anti-patterns. Fix the orange ones first.
No paths filter
PROBLEM
All workflows run on every push regardless of which files changed. A documentation edit triggers a 20-minute build and test suite.
FIX
on:
push:
paths:
- 'src/**'
- 'package.json'
- '*.config.*'No concurrency gate
PROBLEM
Developer pushes three commits in 90 seconds. Three identical builds run in parallel, two will be cancelled anyway when the next commit arrives.
FIX
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: trueBroad or missing cache keys
PROBLEM
Cache keys that hash the entire repo, or no cache at all. Every build restores nothing and installs from scratch.
FIX
Use lockfile hash as the cache key. See dependency caching recipes. — see full guide
Full test suite on every PR
PROBLEM
30-minute test suite runs on every commit to every branch. 80% of tests are unrelated to the changed files.
FIX
Add paths filter to test workflow. Adopt affected-only logic (Nx, Turborepo, Bazel) for monorepos. — see full guide
No timeout-minutes
PROBLEM
A runaway job, hung integration test, or deadlocked build process consumes hours of billed minutes before the developer notices.
FIX
jobs:
build:
timeout-minutes: 20
steps:
- timeout-minutes: 10
run: npm testmacOS runner for non-Apple workloads
PROBLEM
Team uses macos-latest as the default from a StackOverflow answer. Their Node.js backend has zero Apple-specific code. They are paying 10x Linux rate.
FIX
Change runs-on: macos-latest to runs-on: ubuntu-latest for any non-macOS-specific workflow.
E2E tests on every PR
PROBLEM
Playwright or Cypress E2E suite runs on every commit. E2E tests are slow (15-60 min), flaky, and often redundant on feature branches.
FIX
Move E2E to nightly schedule + pre-merge trigger only, or scope with paths filter to UI-related changes. — see full guide
Over-sized runners
PROBLEM
Using runs-on: ubuntu-latest-16-core for a 2-core workload. 16-core runners cost 8x more than 2-core. The build time is not 8x faster.
FIX
Profile actual CPU utilisation during your build. Right-size to the largest runner where utilisation exceeds 70%.
No Docker layer cache
PROBLEM
Docker image rebuilds from scratch on every run. No cache-from configuration. 8-minute Docker build on every PR.
FIX
Add cache-from: type=gha and cache-to: type=gha,mode=max to docker/build-push-action. — see full guide
Uploading large artifacts on every PR
PROBLEM
500 MB production build artifact uploaded on every PR. It is never downloaded. It eats the 500 MB free storage allowance in one run.
FIX
Filter artifacts: only upload on main/release branches. Set retention-days: 1 for PR artifacts.
No scheduled cleanup of old caches and artifacts
PROBLEM
Caches and artifacts accumulate. GitHub evicts caches by LRU when the 10 GB cap is hit, but artifacts require explicit retention policies.
FIX
Set retention-days on all artifact uploads. Add a weekly cleanup workflow using actions/cache delete.
Third-party actions with heavyweight dependencies
PROBLEM
A popular action downloads a 200 MB CLI tool on every run. Multiply by 100 PRs/day: 20 GB of unnecessary downloads.
FIX
Audit action sizes with workflow timing data. Replace heavyweight actions with direct CLI calls or first-party actions where possible.
The prioritisation exercise
These anti-patterns follow a power law. Fix anti-patterns 01 and 02 first: they are 30-minute changes that typically account for 40-60% of waste. Then 04 and 09. The remaining eight rarely combine to match the impact of the top two.
As contextcost.com covers, every interrupt is a context switch. Every context switch has a cost. Your CI pipeline is an interrupt generator: slow builds, flaky tests, and redundant runs interrupt the flow state that makes engineering productive. Fixing the anti-patterns is not just a cost optimisation, it is a focus optimisation.
DIGITAL SIGNET · PIPELINE AUDIT
We identify which 2-3 anti-patterns are 80% of your bill.
Digital Signet reviews your workflow YAML against all 12 anti-patterns, ranks by impact, and delivers a prioritised remediation plan.
Get an Audit