| GitLab | needs 指定上游作业,可跨阶段提前运行 |
|---|---|
| GitHub | jobs.<id>.needs 构成 DAG,未列 needs 的作业并行 |
| 效果 | 阶段内并行 + 阶段间解耦,整体时长按关键路径收敛 |
GitLab needs
GitLab needs
test:app:
stage: test
needs: ["build:app"]
script: make test-appGitHub needs
GitHub needs
jobs:
test:
needs: build
runs-on: ubuntu-latestneeds 会限定作业可见的产物集合;引用未声明依赖的产物会在早期报错。