← Back to all fixes

CI builds are very slow — taking 15-20 minutes

The Issue

Every PR triggers a 20-minute CI run. Team is slowing down.

Root Cause

Deps installed fresh every run, no Docker layer cache, tests not parallelised, or building when only docs changed.

How to Fix
  1. Cache dependencies: most CI systems support caching node_modules or pip based on lock file hash
  2. Use Docker build cache or a layer cache (e.g. GitHub Actions cache for Docker layers)
  3. Parallelise test suites across multiple workers
  4. Add path filters: skip CI for changes to docs/, README, or non-code files
  5. Profile what is slow: add `time` before expensive steps to find the bottleneck