To counter CI bottlenecks caused by accelerated development from AI agents, Linear overhauled its CI pipeline, reducing pull request wait times from over 6 minutes to just over 5, despite a fourfold increase in test suites. The engineering team achieved this through a multi-layered optimization strategy. First, they upgraded infrastructure by moving from GitHub Actions to third-party runners with superior CPU and storage, resulting in a 34% average job speedup. They modernized the toolchain by switching to the tsgo compiler, which cut TypeScript check times by 73%, and transitioned to Oxlint for faster linting. To optimize critical paths, they replaced standard checkouts with sparse, blobless fetches and implemented custom composite actions with retry logic and local git mirrors to handle network instability. Setup overhead was minimized by using pre-built Docker images containing dependencies like the Postgres client, restricting pnpm installs to specific packages, and abandoning slow cache restores in favor of faster rebuilds. Finally, they increased API test parallelism by moving from four to eight shards and implemented an opt-in Vitest configuration with "isolate: false" to allow shared module registries. This specific optimization yielded the largest single performance gain, reducing the slowest shard's runtime from approximately 379 seconds to 195 seconds and cutting total API-shard runner time from 32.8 to 22 minutes per run.
Read original
hackernews