Guides
How to shard tests across a matrix
One long test job dominates the pipeline.
6 min read
One long test job dominates the pipeline.
Why it happens
The suite runs serially on one machine even though the tests are independent.
How to fix it
- Split by historical duration rather than by file count so shards finish together
- Use your runner's native sharding flag where one exists (--shard, --split-by)
- Merge shard reports into one summary so failures stay readable
- Watch total cost: four shards for four minutes costs the same as one job for sixteen
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to speed up GitHub ActionsYour pipeline takes longer than anyone wants to wait, and it is not obvious where the time goes.How to find the slow step in a workflowThe pipeline is slow but every individual step looks reasonable.How to reduce GitHub Actions cold startsJobs sit for 30 to 90 seconds before the first step runs.How to diagnose GitHub Actions queue timesJobs are queued for minutes before a runner picks them up.