A matrix defines os with two values and node with two values, expanding into four jobs. The team needs one additional job that uses an os value already in the matrix paired with a node value that is not listed, without enlarging the other combinations. Which matrix key produces exactly that one extra job?
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [18, 20]
<key>:
- os: ubuntu-latest
node: 22- Ainclude, because a pair whose node value is absent from the base matrix is added as a brand new combination instead of extending an existing one. Correct
- Bexclude, because listing the os and node pair under exclude appends it to the generated set as a distinct extra combination to build.
- Cmax-parallel, because capping concurrency lets the runner schedule one supplementary node version alongside the four matrix jobs already defined.
- Dfail-fast, because disabling it instructs the matrix to expand a recovery combination for any node version that is otherwise missing.
Why A is correct: include adds a fresh combination when the pair does not match any expanded entry, so node 22 with ubuntu-latest becomes one extra job while the original four are left unchanged.
Why B is wrong: Tempting because exclude also takes os and node pairs, but exclude removes matching combinations from the expansion rather than adding new ones, so it cannot create the extra job.
Why C is wrong: Tempting because max-parallel governs the matrix, but it only limits how many jobs run at once. It does not define combinations, so it cannot introduce an additional node 22 job.
Why D is wrong: Tempting because fail-fast also sits under strategy, but it only controls cancellation of siblings on failure. It never adds combinations, so no node 22 job would appear.