GitHub Actions test matrix
Run the same job across multiple Node versions.
strategy:
matrix:
node: [18, 20, 22]
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm testMatrices catch compatibility regressions early and avoid copy-pasting nearly identical jobs.