gitlab-ci: introduce stages and dependencies

We're about to add a couple of jobs for Windows. As the Windows runners are quite slow, we will split those up across two stages: one stage to build the artifacts, and one stage that runs test slices in parallel. Introduce stages and "needs" dependencies for the preexisting jobs as a preparatory step. The stages will lead to a more natural representation of jobs in the UI, whereas the "needs" dependency ensures that jobs do not have to wait for all jobs in the preceding stage to finish. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Oct 9, 2024 at 15:25 UTC 05a928a93e1a6a46902fca76a37c7876ace7f87e
1 file changed +18
.gitlab-ci.yml
+18
@@ -1,6 +1,10 @@
1 default:
2 timeout: 2h
3
4 +stages:
5 + - test
6 + - analyze
7 +
8 workflow:
9 rules:
10 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
@@ -9,6 +13,8 @@ workflow:
13
14 test:linux:
15 image: $image
16 + stage: test
17 + needs: [ ]
18 tags:
19 - saas-linux-medium-amd64
20 variables:
@@ -67,6 +73,8 @@ test:linux:
73
74 test:osx:
75 image: $image
76 + stage: test
77 + needs: [ ]
78 tags:
79 - saas-macos-medium-m1
80 variables:
@@ -102,6 +110,8 @@ test:osx:
110
111 test:fuzz-smoke-tests:
112 image: ubuntu:latest
113 + stage: test
114 + needs: [ ]
115 variables:
116 CC: clang
117 before_script:
@@ -111,6 +121,8 @@ test:fuzz-smoke-tests:
121
122 static-analysis:
123 image: ubuntu:22.04
124 + stage: analyze
125 + needs: [ ]
126 variables:
127 jobname: StaticAnalysis
128 before_script:
@@ -121,6 +133,8 @@ static-analysis:
133
134 check-whitespace:
135 image: ubuntu:latest
136 + stage: analyze
137 + needs: [ ]
138 before_script:
139 - ./ci/install-dependencies.sh
140 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
@@ -135,6 +149,8 @@ check-whitespace:
149
150 check-style:
151 image: ubuntu:latest
152 + stage: analyze
153 + needs: [ ]
154 allow_failure: true
155 variables:
156 CC: clang
@@ -153,6 +169,8 @@ check-style:
169
170 documentation:
171 image: ubuntu:latest
172 + stage: analyze
173 + needs: [ ]
174 variables:
175 jobname: Documentation
176 before_script: