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: "/Volumes/RAMDisk"
92 before_script:
93 # Create a 4GB RAM disk that we use to store test output on. This small hack
94 # significantly speeds up tests by more than a factor of 2 because the
95 # macOS runners use network-attached storage as disks, which is _really_
96 # slow with the many small writes that our tests do.
97 - sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk
98 - ./ci/install-dependencies.sh
99 script:
100 - ./ci/run-build-and-tests.sh
101 after_script:
102 - |
103 if test "$CI_JOB_STATUS" != 'success'
104 then
105 ./ci/print-test-failures.sh
106 mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
107 fi
108 parallel:
109 matrix:
110 - jobname: osx-clang
111 image: macos-15-xcode-16
112 CC: clang
113 - jobname: osx-reftable
114 image: macos-26-xcode-26
115 CC: clang
116 - jobname: osx-meson
117 image: macos-26-xcode-26
118 CC: clang
119 artifacts:
120 paths:
121 - t/failed-test-artifacts
122 reports:
123 junit: build/meson-logs/testlog.junit.xml
124 when: on_failure
125
126 .windows_before_script: &windows_before_script
127 # Disabling realtime monitoring fails on some of the runners, but it
128 # significantly speeds up test execution in the case where it works. We thus
129 # try our luck, but ignore any failures.
130 - Set-MpPreference -DisableRealtimeMonitoring $true; $true
131
132 build:mingw64:
133 stage: build
134 tags:
135 - saas-windows-medium-amd64
136 variables:
137 NO_PERL: 1
138 before_script:
139 - *windows_before_script
140 - ./ci/install-sdk.ps1 -directory "git-sdk"
141 script:
142 - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
143 artifacts:
144 paths:
145 - artifacts
146 - git-sdk
147
148 test:mingw64:
149 stage: test
150 tags:
151 - saas-windows-medium-amd64
152 needs:
153 - job: "build:mingw64"
154 artifacts: true
155 before_script:
156 - *windows_before_script
157 - git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
158 - New-Item -Path .git/info -ItemType Directory
159 - New-Item .git/info/exclude -ItemType File -Value "/git-sdk"
160 script:
161 - git-sdk/usr/bin/bash.exe -l -c "ci/run-test-slice.sh $CI_NODE_INDEX $CI_NODE_TOTAL"
162 after_script:
163 - git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh'
164 parallel: 10
165
166 .msvc-meson:
167 variables:
168 TEST_OUTPUT_DIRECTORY: "C:/Git-Test"
169 tags:
170 - saas-windows-medium-amd64
171 before_script:
172 - *windows_before_script
173 - choco install -y git meson ninja rust-ms
174 - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
175 - refreshenv
176 - New-Item -Path $env:TEST_OUTPUT_DIRECTORY -ItemType Directory
177
178 build:msvc-meson:
179 extends: .msvc-meson
180 stage: build
181 script:
182 - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred -Dtest_output_directory="$TEST_OUTPUT_DIRECTORY"
183 - meson compile -C build
184 artifacts:
185 paths:
186 - build
187
188 test:msvc-meson:
189 extends: .msvc-meson
190 stage: test
191 timeout: 6h
192 needs:
193 - job: "build:msvc-meson"
194 artifacts: true
195 script:
196 - |
197 & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/run-test-slice-meson.sh build $CI_NODE_INDEX $CI_NODE_TOTAL'
198 after_script:
199 - |
200 if ($env:CI_JOB_STATUS -ne "success") {
201 & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/print-test-failures.sh'
202 Move-Item -Path "$env:TEST_OUTPUT_DIRECTORY/failed-test-artifacts" -Destination t/
203 }
204 parallel: 10
205 artifacts:
206 paths:
207 - t/failed-test-artifacts
208 reports:
209 junit: build/meson-logs/testlog.junit.xml
210 when: on_failure
211
212 test:fuzz-smoke-tests:
213 image: ubuntu:latest
214 stage: test
215 needs: [ ]
216 variables:
217 CC: clang
218 before_script:
219 - ./ci/install-dependencies.sh
220 script:
221 - ./ci/run-build-and-minimal-fuzzers.sh
222
223 static-analysis:
224 image: ubuntu:22.04
225 stage: analyze
226 needs: [ ]
227 variables:
228 jobname: StaticAnalysis
229 before_script:
230 - ./ci/install-dependencies.sh
231 script:
232 - ./ci/run-static-analysis.sh
233 - ./ci/check-directional-formatting.bash
234
235 rust-analysis:
236 image: ubuntu:rolling
237 stage: analyze
238 needs: [ ]
239 variables:
240 jobname: RustAnalysis
241 before_script:
242 - ./ci/install-dependencies.sh
243 script:
244 - ./ci/run-rust-checks.sh
245
246 check-whitespace:
247 image: ubuntu:latest
248 stage: analyze
249 needs: [ ]
250 before_script:
251 - ./ci/install-dependencies.sh
252 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
253 # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
254 # be defined in all pipelines.
255 script:
256 - |
257 R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
258 ./ci/check-whitespace.sh "$R"
259 rules:
260 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
261
262 check-style:
263 image: ubuntu:latest
264 stage: analyze
265 needs: [ ]
266 allow_failure: true
267 variables:
268 CC: clang
269 jobname: ClangFormat
270 before_script:
271 - ./ci/install-dependencies.sh
272 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
273 # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
274 # be defined in all pipelines.
275 script:
276 - |
277 R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
278 ./ci/run-style-check.sh "$R"
279 rules:
280 - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
281
282 documentation:
283 image: ubuntu:latest
284 stage: analyze
285 needs: [ ]
286 variables:
287 jobname: Documentation
288 before_script:
289 - ./ci/install-dependencies.sh
290 script:
291 - ./ci/test-documentation.sh