strategy matrix
A job setting that expands one job description into one job for every combination of the listed values.
In more detail
Listing three versions and two operating systems gives six jobs, each on its own runner. A step reads its own combination from the matrix context, and each expanded job is named with its values in brackets, which matters for required checks.
Example
strategy:
matrix:
version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest]Related terms
- include and exclude — Matrix keys that remove combinations from the expansion (exclude) or add jobs or properties to it (include).
- fail-fast — A matrix setting, on by default, that cancels all remaining matrix jobs as soon as one fails.
- max-parallel — A matrix setting that limits how many of its jobs may run at the same time.
- Cartesian product — Every possible pairing of one item from each of two sets, so the number of pairs is the product of the two sizes.
Taught in
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines
- Matrices, Needs And Concurrency: The Shape Of A Run — GitHub Actions (GH-200) Exam Prep
- Why It Ran, Why It Did Not: Reading Runs, Jobs And Checks — GitHub Actions (GH-200) Exam Prep
- Faster And Cheaper: Where The Minutes Go — GitHub Actions (GH-200) Exam Prep
- Full Mock And Review: Where Your Points Go — GitHub Actions (GH-200) Exam Prep