Matrix strategies in GitHub Actions generate multiple jobs from dimension combinations, enabling parallel cross-platform and cross-version testing. Master vocabulary for Cartesian product generation, include/exclude syntax, fail-fast behavior, the experimental pattern, and the 256-job limit.
0 / 5 completed
1 / 5
A workflow defines matrix: { os: ['ubuntu-latest', 'windows-latest'], node: [18, 20, 22] }. How many jobs does GitHub Actions create?
A matrix strategy creates jobs for every combination of matrix values. With 2 OS values × 3 Node versions = 6 jobs. Each job receives one OS and one Node version from the Cartesian product.
2 / 5
An engineer uses matrix: include to add { os: 'macos-latest', node: 20, experimental: true }. What does the experimental key do by default?
The key experimental in a matrix include has no special meaning to GitHub Actions. It's simply a custom variable accessible via ${{ matrix.experimental }}. To make a job non-blocking, you must explicitly set continue-on-error: ${{ matrix.experimental == true }} on the job.
3 / 5
A matrix job fails on one combination. With default fail-fast: true, what happens to the remaining running jobs?
With fail-fast: true (the default), when any matrix job fails, GitHub Actions immediately cancels all other in-progress and queued matrix jobs. Set fail-fast: false to allow all matrix combinations to run to completion regardless of individual failures.
4 / 5
An engineer wants to exclude the combination { os: 'windows-latest', node: 18 } from a matrix. Which syntax achieves this?
The exclude key under matrix accepts an array of partial objects. GitHub Actions removes any generated combination that matches all key-value pairs in an exclude entry. The syntax is matrix: { ..., exclude: [{ os: 'windows-latest', node: 18 }] }.
5 / 5
What is the maximum number of jobs that a single matrix strategy can generate in GitHub Actions (as of 2024)?
GitHub Actions limits matrix expansion to a maximum of 256 jobs per workflow run. If your matrix would generate more than 256 combinations, the workflow fails with a validation error. You must split the matrix across multiple workflow files or reduce dimensions.