GitHub Actions Tutorial — Matrix Builds
Chapter 9 — Matrix Builds
Matrix builds let you run the same job across multiple combinations of parameters — operating systems, language versions, dependency sets — in parallel. Instead of writing one job per combination, you define a matrix and GitHub Actions generates all the jobs for you.
A single 3-line matrix definition can spawn 12 parallel jobs, testing your code on every combination of OS and runtime version simultaneously.
What You’ll Learn
- Defining matrix strategies with multiple dimensions
- Adding and excluding specific combinations
- Controlling failure behavior and parallelism
- Generating matrices dynamically from JSON
- Real-world matrix patterns for CI/CD
Topics Covered
1. Matrix Basics
Define multi-dimensional matrices and understand how combinations are generated.
2. Include & Exclude
Fine-tune your matrix by adding extra combinations or removing specific ones.
3. Fail-Fast & Parallel
Control whether matrix jobs cancel on first failure and limit concurrent runs.
4. Dynamic Matrix
Generate matrix values at runtime using fromJSON() for flexible CI pipelines.
5. Matrix Patterns
Real-world patterns — cross-platform testing, version grids, and conditional matrix expansion.
Practice
Test your understanding with hands-on exercises.
← Previous: Chapter 8: Artifacts & Caching
Next: Chapter 10: Reusable Workflows →