From Linear · · 2m
AI Coding Made CI a Bottleneck
Linear reworked CI to cut PR wait time from 6+ minutes to 5 minutes.
In brief
Linear reworked CI to cut PR wait time from 6+ minutes to 5 minutes. Linear reduced CI wait time from over 6 minutes to just over 5 minutes by optimizing test execution and infrastructure. Originally reported by Linear.
AI coding made CI a bottleneck
AI coding has made CI a bottleneck, so we reworked ours to keep up.
“AI coding has made CI a bottleneck, so we reworked ours to keep up”
PR wait time dropped from 6+ minutes
PR wait time dropped from more than 6 minutes to just over 5 minutes.
“PR wait time dropped from more than 6 minutes to just over 5 minutes”
Runner time cut in half

Runner time per test cut roughly in half.
“runner time per test cut roughly in half”
Test suite performance improved
Test suite performance indexed to first week of January with white line tracking machine time per test.
“Test suite performance indexed to first week of January with white line tracking machine time per test”
Four key CI improvements
Upgraded infrastructure and tooling, optimized jobs that gate other work, reduced repeated setup, made test execution more efficient.
“Upgraded infrastructure and tooling, optimized jobs that gate other work, reduced repeated setup, made test execution more efficient”
Upgraded infrastructure and tooling

Moving workloads off GitHub Actions to third-party runners with faster CPUs and storage cut jobs by 34% on average.
“Moving workloads off GitHub Actions to third-party runners with faster CPUs and storage cut jobs by 34% on average”
Switched to tsgo
Switching to tsgo, the native TypeScript compiler, cut weekly median tsc check by 73%.
“Switching to tsgo, the native TypeScript compiler, cut weekly median tsc check by 73%”
Lint without type checker
Rewrote lint rules to use static analysis over abstract syntax tree, reducing API lint time by 68%.
“Rewrote lint rules to use static analysis over abstract syntax tree, reducing API lint time by 68%”
Optimized jobs that gate other work
Small jobs that gate other work were critical path items, causing disproportionate delays.
“Small jobs that gate other work were critical path items, causing disproportionate delays”
Fetch only what each job needs
Capped fetch depth to reduce change-detection job time from 94 seconds to 20 seconds.
“Capped fetch depth to reduce change-detection job time from 94 seconds to 20 seconds”
Make checkout more resilient
Replaced actions/checkout with composite action to retry with backoff and use checkout cache.
“Replaced actions/checkout with composite action to retry with backoff and use checkout cache”
Minimize critical path
Moved cache marker write to job after test shards finish, shaving 42 seconds from merge path.
“Moved cache marker write to job after test shards finish, shaving 42 seconds from merge path”
Reduce repeated setup
Preinstalled shared dependencies in CI image to cut API test shard setup time by 44%.
“Preinstalled shared dependencies in CI image to cut API test shard setup time by 44%”
Make test execution more efficient
Split large test files into smaller focused files to improve shard performance by 19%.
“Split large test files into smaller focused files to improve shard performance by 19%”
Share module state with isolation

Introduced vitest project with isolate: false to share module state, cutting shard time from 300-379 seconds to 195 seconds.
“Introduced vitest project with isolate: false to share module state, cutting shard time from 300-379 seconds to 195 seconds”
The headline
Linear reduced CI wait time from over 6 minutes to just over 5 minutes by optimizing test execution and infrastructure.

