Raw
1 default:
2 timeout: 2h
3
4 stages:
5 - build
6 - test
7 - analyze
8
9 workflow:
10 rules:
11 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
12 - if: $CI_COMMIT_TAG
13 - if: $CI_COMMIT_REF_PROTECTED == "true"
14
15 test:linux:
16 image: $image
17 stage: test
18 needs: [ ]
19 tags:
20 - saas-linux-medium-amd64
21 variables:
22 CUSTOM_PATH: "/custom"
23 TEST_OUTPUT_DIRECTORY: "/tmp/test-output"
24 before_script:
25 - ./ci/install-dependencies.sh
26 script:
27 - useradd builder --create-home
28 - chown -R builder "${CI_PROJECT_DIR}"
29 - sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh
30 after_script:
31 - |
32 if test "$CI_JOB_STATUS" != 'success'
33 then
34 sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
35 mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
36 fi
37 parallel:
38 matrix:
39 - jobname: linux-sha256
40 image: ubuntu:rolling
41 CC: clang
42 - jobname: linux-reftable
43 image: ubuntu:rolling
44 CC: clang
45 - jobname: linux-TEST-vars
46 image: ubuntu:20.04
47 CC: gcc
48 CC_PACKAGE: gcc-8
49 - jobname: linux-breaking-changes
50 image: ubuntu:rolling
51 CC: gcc
52 - jobname: fedora-breaking-changes-meson
53 image: fedora:latest
54 - jobname: linux-leaks
55 image: ubuntu:rolling
56 CC: gcc
57 - jobname: linux-reftable-leaks
58 image: ubuntu:rolling
59 CC: gcc
60 - jobname: linux-asan-ubsan
61 image: ubuntu:rolling
62 CC: clang
63 - jobname: linux-meson
64 image: ubuntu:rolling
65 CC: gcc
66 - jobname: linux-musl-meson
67 image: alpine:latest
68 # Supported until 2025-04-02.
69 - jobname: linux32
70 image: i386/ubuntu:20.04
71 # A RHEL 8 compatible distro. Supported until 2029-05-31.
72 - jobname: almalinux-8
73 image: almalinux:8
74 # Supported until 2026-08-31.
75 - jobname: debian-11
76 image: debian:11
77 artifacts:
78 paths:
79 - t/failed-test-artifacts
80 reports:
81 junit: build/meson-logs/testlog.junit.xml
82 when: on_failure
83
84 test:osx:
85 image: $image
86 stage: test
87 needs: [ ]
88 tags:
89 - saas-macos-large-m2pro
90 variables:
91 TEST_OUTPUT_DIRECTORY: "/tmp/test-output"
92 before_script:
93 - ./ci/install-dependencies.sh
94 script:
95 - ./ci/run-build-and-tests.sh
96 after_script:
97 - |
98 if test "$CI_JOB_STATUS" != 'success'
99 then
100 ./ci/print-test-failures.sh
101 mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
102 fi
103 parallel:
104 matrix:
105 - jobname: osx-clang
106 image: macos-15-xcode-16
107 CC: clang
108 - jobname: osx-reftable
109 image: macos-26-xcode-26
110 CC: clang
111 - jobname: osx-meson
112 image: macos-26-xcode-26
113 CC: clang
114 artifacts:
115 paths:
116 - t/failed-test-artifacts
117 reports:
118 junit: build/meson-logs/testlog.junit.xml
119 when: on_failure
120
121 .windows_before_script: &windows_before_script
122 # Disabling realtime monitoring fails on some of the runners, but it
123 # significantly speeds up test execution in the case where it works. We thus
124 # try our luck, but ignore any failures.
125 - Set-MpPreference -DisableRealtimeMonitoring $true; $true
126
127 build:mingw64:
128 stage: build
129 tags:
130 - saas-windows-medium-amd64
131 variables:
132 NO_PERL: 1
133 before_script:
134 - *windows_before_script
135 - ./ci/install-sdk.ps1 -directory "git-sdk"
136 script:
137 - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
138 artifacts:
139 paths:
140 - artifacts
141 - git-sdk
142
143 test:mingw64:
144 stage: test
145 tags:
146 - saas-windows-medium-amd64
147 needs:
148 - job: "build:mingw64"
149 artifacts: true
150 variables:
151 # Windows runners don't have enough RAM to run EXPENSIVE tests.
152 GIT_TEST_LONG: false
153 before_script:
154 - *windows_before_script
155 - git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
156 - New-Item -Path .git/info -ItemType Directory
157 - New-Item .git/info/exclude -ItemType File -Value "/git-sdk"
158 script:
159 - git-sdk/usr/bin/bash.exe -l -c "ci/run-test-slice.sh $CI_NODE_INDEX $CI_NODE_TOTAL"
160 after_script:
161 - git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh'
162 parallel: 10
163
164 .msvc-meson:
165 variables:
166 TEST_OUTPUT_DIRECTORY: "C:/Git-Test"
167 tags:
168 - saas-windows-medium-amd64
169 cache:
170 key:
171 files:
172 - ci/install-dependencies.ps1
173 paths:
174 - .dependencies
175 before_script:
176 - *windows_before_script
177 - ./ci/install-dependencies.ps1
178 - $env:Path = "C:\Meson;C:\Rust\bin;$env:Path"
179 - New-Item -Path $env:TEST_OUTPUT_DIRECTORY -ItemType Directory
180
181 build:msvc-meson:
182 extends: .msvc-meson
183 stage: build
184 script:
185 - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred -Dtest_output_directory="$TEST_OUTPUT_DIRECTORY"
186 - meson compile -C build
187 artifacts:
188 paths:
189 - build
190
191 test:msvc-meson:
192 extends: .msvc-meson
193 stage: test
194 timeout: 6h
195 needs:
196 - job: "build:msvc-meson"
197 artifacts: true
198 script:
199 - |
200 & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/run-test-slice-meson.sh build $CI_NODE_INDEX $CI_NODE_TOTAL'
201 variables:
202 # Windows runners don't have enough RAM to run EXPENSIVE tests.
203 GIT_TEST_LONG: false
204 after_script:
205 - |
206 if ($env:CI_JOB_STATUS -ne "success") {
207 & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/print-test-failures.sh'
208 Move-Item -Path "$env:TEST_OUTPUT_DIRECTORY/failed-test-artifacts" -Destination t/
209 }
210 parallel: 10
211 artifacts:
212 paths:
213 - t/failed-test-artifacts
214 reports:
215 junit: build/meson-logs/testlog.junit.xml
216 when: on_failure
217
218 test:fuzz-smoke-tests:
219 image: ubuntu:latest
220 stage: test
221 needs: [ ]
222 variables:
223 CC: clang
224 before_script:
225 - ./ci/install-dependencies.sh
226 script:
227 - ./ci/run-build-and-minimal-fuzzers.sh
228
229 static-analysis:
230 image: ubuntu:latest
231 stage: analyze
232 needs: [ ]
233 variables:
234 jobname: StaticAnalysis
235 before_script:
236 - ./ci/install-dependencies.sh
237 script:
238 - ./ci/run-static-analysis.sh
239 - ./ci/check-directional-formatting.bash
240
241 rust-analysis:
242 image: ubuntu:rolling
243 stage: analyze
244 needs: [ ]
245 variables:
246 jobname: RustAnalysis
247 before_script:
248 - ./ci/install-dependencies.sh
249 script:
250 - ./ci/run-rust-checks.sh
251
252 check-whitespace:
253 image: ubuntu:latest
254 stage: analyze
255 needs: [ ]
256 before_script:
257 - ./ci/install-dependencies.sh
258 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
259 # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
260 # be defined in all pipelines.
261 script:
262 - |
263 R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
264 ./ci/check-whitespace.sh "$R"
265 rules:
266 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
267
268 check-style:
269 image: ubuntu:latest
270 stage: analyze
271 needs: [ ]
272 allow_failure: true
273 variables:
274 CC: clang
275 jobname: ClangFormat
276 before_script:
277 - ./ci/install-dependencies.sh
278 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
279 # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
280 # be defined in all pipelines.
281 script:
282 - |
283 R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
284 ./ci/run-style-check.sh "$R"
285 rules:
286 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
287
288 documentation:
289 image: ubuntu:latest
290 stage: analyze
291 needs: [ ]
292 variables:
293 jobname: Documentation
294 before_script:
295 - ./ci/install-dependencies.sh
296 script:
297 - ./ci/test-documentation.sh