How does a matrix expand, and how are job names generated?
BeginnerConceptJobs, Steps, Matrix & Concurrency
Answer
Every combination of the matrix variables becomes one job (Cartesian product), named jobid (v1, v2) unless you set name.
strategy:
matrix:
os: [ubuntu-24.04, windows-2025]
node: [20, 22, 24]
runs-on: ${{ matrix.os }}
name: test (${{ matrix.os }}, node ${{ matrix.node }})
That is 6 jobs. A run can generate at most 256 matrix jobs per matrix. Matrix job names are what branch protection sees, so renaming a matrix value renames the required check.
More on Jobs, Steps, Matrix & Concurrency
How does `needs` work, and what happens to a job whose dependency failed or was skipped?BeginnerWhat is the implicit `success()` in a job `if`, and why is `always()` usually the wrong fix?IntermediateWhat values can `needs.<job>.result` take?BeginnerHow do `include` and `exclude` work in a matrix?IntermediateWhat do `fail-fast` and `max-parallel` do?BeginnerHow do you build a matrix dynamically from a previous job?Advanced