What is a build matrix and when would you use one?
⚡
Quick Answer
A matrix runs the same job across combinations (OS, language versions) in parallel.
Detailed Answer
strategy.matrix expands into one job per combination — e.g. Node 18/20/22 on ubuntu/macos = 6 parallel jobs. fail-fast: false lets all combinations finish so you see every failure. Matrices are ideal for testing library compatibility across versions and platforms.
Code Example
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]💡
Interview Tip
Note fail-fast:false to avoid masking failures.
github-actionsmatrixtesting