Jobs in later stages wait for the whole earlier stage even if their dependency finished.
IntermediateScenarioGitLab CI
Answer
Situation read → Stage ordering hides a DAG.
What I'd do →
- Add
needs:to jobs:needs: [build-api]so they start as soon as the dependency finishes. - Add
needs: { job: build, artifacts: false }when artifacts are not needed. - Keep stages for readability.
Why → DAG pipelines cut critical path time.
Interview tip → needs also controls which artifacts are downloaded.
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate