GitHub Actions matrix: combinations
Matrix expansion
A matrix generates combinations of its axes. For a fictional library tested on two operating systems and two runtime versions, start by expecting four jobs. Inspect the expanded tuples, rather than counting only the green jobs.
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [22, 24]
GitHub’s matrix guide explains how include adds or augments combinations and exclude removes matching combinations. These are different operations. Excluding the only Windows job for a required version removes coverage even if everything left succeeds.
Failure controls
Use the later matrix exercises to compare fail-fast, continue-on-error and max-parallel. They answer separate questions: cancellation after a failure, tolerated failure and concurrent work. A permissive setting can change the final status without fixing a broken test.
The simulator expands a bounded matrix against scripted commands. Its job count does not measure runner capacity, cost or elapsed time on GitHub.