| GitHub | strategy.matrix 配 include/exclude,fail-fast 可关闭 |
|---|---|
| GitLab | parallel:matrix 基于变量组合展开作业 |
| Jenkins | 声明式 pipeline 的 matrix 指令 |
GitHub matrix
GitHub matrix
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node: [20, 22]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v4
with: {node-version: '${{ matrix.node }}'}组合数等于各维度取值相乘;用 exclude 去掉不可能组合,控制规模。