CI Cost Attribution
Per-team CI cost.
Why attribute CI cost
CI bills can hit $50k-500k per month at engineering scale. Without attribution, the cost is a single line item and nobody owns optimisation.
Attribution surfaces who consumes what. Often one team's slow integration tests dominate the bill. Visibility drives action.
Attribution also enables chargeback. Each team sees their CI spend; budget conversations become concrete. The team that complains about CI cost becomes the team that optimises.
Tagging and tracking
Tag every workflow run with team, repo, environment. GitHub Actions and CircleCI both support custom tags. Self-hosted runners need explicit tagging in the job definition.
Per-run cost computed from minutes consumed times runner cost. Self-hosted runners on spot instances run $0.005-0.02 per minute; hosted GitHub runners $0.008-0.16 per minute depending on tier.
Aggregate tags daily into a cost table. Per-team dashboard: monthly spend, trend, top workflows by cost. Surface at quarterly engineering reviews.
Optimisation patterns
Caching is the highest-leverage win. Layer cache (Docker), dependency cache (npm, pip, cargo), test result cache. Properly configured caches cut CI time by 50-80% on most projects.
Skip unchanged paths. If only docs changed, skip integration tests. Path filters in workflow files; or change-detection scripts that decide what to run.
Right-size runners. The default GitHub runner has 2 cores; many builds finish faster on 4-core runners despite higher per-minute cost. Profile build CPU usage; pick runner size accordingly.
Budget enforcement
Per-team monthly cap. Soft warning at 80%; hard stop at 100% requires manager override. Forces conversations early; prevents runaway months.
Per-PR budget. Single PRs that consume $100+ in CI are flagged. Often a missing cache or runaway test loop.
Quarterly recalibration. Teams that outgrow caps justify the increase. Teams that stay under can take on more workflows.
Operational discipline
Owner per workflow. Workflows without an owner are technical debt. Quarterly review surfaces orphans.
Cost in PR comments. The CI tool reports per-PR cost back to the engineer. Visibility creates awareness; awareness drives optimisation.
Track CI cost as a percentage of engineering payroll. Healthy: 1-3%. Above 5%: investment in CI optimisation pays back fast.