Journey of Systematically Cut Our Monorepo CI Time in Half
The engineering team maintains a Python/TypeScript monorepo with 22+ Django microservices, a React frontend, and shared libraries — all running through GitHub Actions CI. Over time, CI had become t...

Source: DEV Community
The engineering team maintains a Python/TypeScript monorepo with 22+ Django microservices, a React frontend, and shared libraries — all running through GitHub Actions CI. Over time, CI had become the productivity bottleneck. PRs routinely waited 10-15 minutes for green checks, and the slowest pipeline consistently exceeded 10 minutes. Engineers were context-switching while waiting for builds, or worse, stacking PRs on top of unverified ones. I ran a focused initiative to systematically identify and eliminate CI bottlenecks. This post is a record of how I approached it. 1. Finding the Bottleneck You can't optimize what you can't see. So my first instinct was to write a script to pull GitHub Actions workflow run data from the API and compute aggregate statistics — average, P50, P75, P90 — for both wall clock time and per-job durations across any date range. This immediately told me two things: The largest service's unit-test job was the critical path — at P50 of ~10 minutes, it single-ha