Read the original at linear.app ↗linear.app
By Linear · linear.app
As AI coding agents accelerate development velocity, CI has become a bottleneck for validation and deployment. Linear reworked their CI pipeline to keep pace, reducing PR wait time from 6+ minutes to 5 minutes while cutting runner time in half despite test suites quadrupling. The team optimized through infrastructure upgrades, eliminating redundant setup work, parallelizing test execution more aggressively, and identifying critical-path jobs that disproportionately impact overall speed.
01Key takeaways
- AI-driven code generation has made CI validation the new bottleneck; infrastructure and process improvements are critical to maintain developer velocity.
- Critical-path jobs have disproportionate impact; small delays in gating checks delay entire workflows, so prioritize optimizing those first.
- Setup overhead compounds across jobs; preinstalling dependencies, restricting monorepo installs, and batching short checks yields outsized savings.
- Test parallelization only scales when setup cost is low; optimize setup before increasing shard count to avoid diminishing returns.
- Opt-in performance features (like shared module state) require explicit eligibility rules and agent training to maintain correctness as test generation scales.
- Measure what matters: focus on PR wait time and runner-minutes consumed, not just individual job speed.
02Key sections
- Infrastructure and tooling modernization
- Switching from GitHub Actions to third-party runners with faster hardware and better caching reduced job times by 34% on average. Adopting tsgo (native TypeScript compiler) cut type-checking time by 73%, eliminating it as a bottleneck entirely.
- Optimizing critical-path jobs
- Small jobs that gate all downstream work have outsized impact on total CI time. Linear reduced fetch depth for change-detection jobs from 94 to 20 seconds, made checkout resilient to network issues, and moved non-blocking writes off the critical path to save 42 seconds per merge.
- Eliminating repeated setup overhead
- Setup costs (booting runners, installing packages) compound across jobs. Linear preinstalled dependencies in CI images, restricted monorepo installs to only needed packages, and consolidated seven independent checks into two jobs, saving 87,000 runner-minutes monthly (11.8% of total CI usage).
- Test execution parallelization and isolation
- Increasing shards from four to eight made the slowest shard 19% faster. Allowing safe test files to share module state (opt-in) reduced the slowest shard from 300+ seconds to 195 seconds—a 17% monthly savings—though this required explicit eligibility rules and careful teardown.
- Avoiding redundant work
- Linear replaced full database migration replays with schema snapshots (12 to 1-2 seconds), removed TypeScript type information from linting rules via static analysis (68% faster), and stopped caching node_modules when rebuilding was faster (7.5 vs 28 seconds).
“Agents have made it exponentially faster to ship code, but validating those changes hasn't quite kept up.”Linear · linear.app
“Setup is now around 40 seconds, so eight shards spend less total setup time than four did before.”Linear · linear.app
03Frameworks mentioned
Summary and takeaways written by PM Atlas; quotes are short excerpts. © the original author.