AI Hints
Home›CI/CD with GitHub Actions Tutorial›Debugging, Speed, and Cost
CI/CD with GitHub Actions · Lesson 113 of 138

Speeding Up Pipelines

Every minute counts.

⏱ 2 min read▶ Video at 2:11:57🎓 Free
Watch this lesson in the CI/CD with GitHub Actions courseWatch on YouTube ↗Full CI/CD with GitHub Actions course

A pipeline that's five minutes slower, run fifty times a day, wastes over four hours of waiting, every day. Speeding up pipelines pays off quickly. Measure first, then fix the slowest part.

Speeding Up Pipelines
From the video: Speeding Up Pipelines
  • Five minutes × fifty runs
  • Hours of waiting
  • Measure, then fix

Where time goes

Look at the step times in the run log. Installing dependencies is often the slowest, and caching fixes it. Long test suites can be split across a matrix. Docker builds speed up with layer caching. And jobs that wait on each other can sometimes run in parallel.

Slow partFix
Installing packagescache
Long test suitesplit with a matrix
Docker buildslayer cache
Waiting jobsrun in parallel

Skip work you don't need

The fastest work is work you skip. Use path filters, so docs changes don't run the full pipeline. Use concurrency to cancel runs that are already out of date. And use fail fast, so one failure stops the rest of a matrix early.

keyvalue
paths-ignoreskip docs changes
concurrencycancel old runs
fail-faststop early
Smaller imagesfaster pulls

Summary

Measure step times, cache dependencies, split slow tests, and skip unneeded work. Next, what all those minutes cost.

Key takeaways
  • Measure first
  • Cache and split
  • Skip and cancel
Next up: Cost and Minutes — paying for CI