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); chargeback makes budget conversations concrete because the team that complains about cost becomes the team that optimises.

Tagging and tracking

The mechanism is per-run tagging plus cost computation. Tag every workflow run with team, repo, environment (GitHub Actions and CircleCI support custom tags; self-hosted runners need explicit tagging); per-run cost is minutes times runner cost ($0.005-0.02 per minute on spot self-hosted, $0.008-0.16 per minute for hosted GitHub); aggregate daily into a cost table for per-team dashboards.

Optimisation patterns

Three patterns drive most CI savings. Caching (layer, dependency, test result) is the highest-leverage win, cutting time 50-80%; skip unchanged paths via path filters or change-detection scripts; right-size runners by profiling build CPU because 4-core often beats 2-core on wall-clock despite higher per-minute cost.

Budget enforcement

Budget enforcement makes attribution actionable. Per-team monthly cap with soft warning at 80% and hard stop at 100% (manager override) forces conversations early; per-PR budget flags single PRs consuming $100+ which is often a missing cache or runaway test loop; quarterly recalibration justifies cap changes against actual workflow growth.

Operational discipline

Three disciplines compound CI cost ownership. Owner per workflow because workflows without owners are technical debt; cost in PR comments because visibility creates awareness; track CI cost as a percentage of engineering payroll because healthy is 1-3% and above 5% means CI optimisation pays back fast.