Revert "ci: Switch over to an autoscaling GKE cluster for builds."
[mesa.git] / .gitlab-ci.yml
1 # This is the tag of the docker image used for the build jobs. If the
2 # image doesn't exist yet, the containers stage generates it.
3 #
4 # In order to generate a new image, one should generally change the tag.
5 # While removing the image from the registry would also work, that's not
6 # recommended except for ephemeral images during development: Replacing
7 # an image after a significant amount of time might pull in newer
8 # versions of gcc/clang or other packages, which might break the build
9 # with older commits using the same tag.
10 #
11 # After merging a change resulting in generating a new image to the
12 # main repository, it's recommended to remove the image from the source
13 # repository's container registry, so that the image from the main
14 # repository's registry will be used there as well.
15 variables:
16 UPSTREAM_REPO: mesa/mesa
17 DEBIAN_TAG: "2019-10-30"
18 DEBIAN_ARM64_TAG: "arm64v8-2019-11-06"
19 DEBIAN_ARM64_TEST_TAG: "arm64v8-test-2019-11-06"
20 STRETCH_TAG: "2019-09-18"
21 DEBIAN_VERSION: buster-slim
22 STRETCH_VERSION: stretch-slim
23 DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
24 DEBIAN_ARM64_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_ARM64_TAG"
25 DEBIAN_ARM64_TEST_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_ARM64_TEST_TAG"
26 STRETCH_IMAGE: "$CI_REGISTRY_IMAGE/debian/$STRETCH_VERSION:$STRETCH_TAG"
27
28 include:
29 - project: 'wayland/ci-templates'
30 ref: 1f7f57c64ff4ebbf7292e3b7a13600518b8cb24c
31 file: '/templates/debian.yml'
32
33 include:
34 - local: '.gitlab-ci/lava-gitlab-ci.yml'
35
36 stages:
37 - container
38 - build
39 - test
40
41
42 # When to automatically run the CI
43 .ci-run-policy:
44 only:
45 refs:
46 - branches@mesa/mesa
47 - merge_requests
48 - /^ci([-/].*)?$/
49 changes:
50 - VERSION
51 - bin/**/*
52 # GitLab CI
53 - .gitlab-ci.yml
54 - .gitlab-ci/**/*
55 # Meson
56 - meson*
57 - build-support/**/*
58 - subprojects/**/*
59 # SCons
60 - SConstruct
61 - scons/**/*
62 - common.py
63 # Source code
64 - include/**/*
65 - src/**/*
66 retry:
67 max: 2
68 when:
69 - runner_system_failure
70
71 .ci-deqp-artifacts:
72 artifacts:
73 when: always
74 untracked: false
75 paths:
76 # Watch out! Artifacts are relative to the build dir.
77 # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
78 - artifacts
79
80 # Build the normal CI native and cross-build docker images.
81
82 .container:
83 stage: container
84 extends:
85 - .ci-run-policy
86 variables:
87 # no need to pull the whole repo to build the container image
88 GIT_STRATEGY: none
89
90 debian-10:amd64:
91 extends:
92 - .debian@container-ifnot-exists
93 - .container
94 variables:
95 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
96
97 .use-debian-10:amd64:
98 image: $DEBIAN_IMAGE
99 needs:
100 - debian-10:amd64
101
102 debian-9:amd64:
103 extends: debian-10:amd64
104 variables:
105 DEBIAN_TAG: $STRETCH_TAG
106 DEBIAN_VERSION: $STRETCH_VERSION
107 DEBIAN_IMAGE: $STRETCH_IMAGE
108 DEBIAN_EXEC: 'bash .gitlab-ci/debian-stretch-install.sh'
109
110 .use-debian-9:amd64:
111 image: $STRETCH_IMAGE
112 needs:
113 - debian-9:amd64
114
115 debian-10:arm64:
116 extends:
117 - .debian@container-ifnot-exists@arm64v8
118 - .container
119 variables:
120 DEBIAN_TAG: "$DEBIAN_ARM64_TAG"
121 DEBIAN_EXEC: 'bash .gitlab-ci/debian-arm64-install.sh'
122
123 debian-10-test:arm64:
124 extends:
125 - .debian@container-ifnot-exists@arm64v8
126 - .container
127 variables:
128 DEBIAN_TAG: "$DEBIAN_ARM64_TEST_TAG"
129 DEBIAN_EXEC: 'bash .gitlab-ci/debian-arm64-test-install.sh'
130
131
132 # BUILD
133
134 # Shared between windows and Linux
135 .build-common:
136 extends: .ci-run-policy
137 stage: build
138 artifacts:
139 when: always
140 paths:
141 - _build/meson-logs/*.txt
142 # scons:
143 - build/*/config.log
144 - shader-db
145
146 # Just Linux
147 .build-linux:
148 extends: .build-common
149 cache:
150 key: ${CI_JOB_NAME}
151 paths:
152 - ccache
153 variables:
154 CCACHE_COMPILERCHECK: "content"
155 # Use ccache transparently, and print stats before/after
156 before_script:
157 - export PATH="/usr/lib/ccache:$PATH"
158 - export CCACHE_BASEDIR="$PWD"
159 - export CCACHE_DIR="$PWD/ccache"
160 - ccache --max-size=1500M
161 - ccache --zero-stats || true
162 - ccache --show-stats || true
163 after_script:
164 # In case the install dir is being saved as artifacts, tar it up
165 # so that symlinks and hardlinks aren't each packed separately in
166 # the zip file.
167 - if [ -d install ]; then
168 tar -cf artifacts/install.tar install;
169 fi
170 - export CCACHE_DIR="$PWD/ccache"
171 - ccache --show-stats
172
173 .build-windows:
174 extends: .build-common
175 tags:
176 - mesa-windows
177 cache:
178 key: ${CI_JOB_NAME}
179 paths:
180 - subprojects/packagecache
181
182 .meson-build:
183 extends:
184 - .build-linux
185 - .use-debian-10:amd64
186 script:
187 - .gitlab-ci/meson-build.sh
188
189 .scons-build:
190 extends:
191 - .build-linux
192 - .use-debian-10:amd64
193 variables:
194 SCONSFLAGS: "-j4"
195 script:
196 - .gitlab-ci/scons-build.sh
197
198 meson-main:
199 extends:
200 - .meson-build
201 - .ci-deqp-artifacts
202 variables:
203 UNWIND: "true"
204 DRI_LOADERS: >
205 -D glx=dri
206 -D gbm=true
207 -D egl=true
208 -D platforms=x11,wayland,drm,surfaceless
209 DRI_DRIVERS: "i915,i965,r100,r200,nouveau"
210 GALLIUM_ST: >
211 -D dri3=true
212 -D gallium-extra-hud=true
213 -D gallium-vdpau=true
214 -D gallium-xvmc=true
215 -D gallium-omx=bellagio
216 -D gallium-va=true
217 -D gallium-xa=true
218 -D gallium-nine=true
219 -D gallium-opencl=disabled
220 GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink"
221 LLVM_VERSION: "7"
222 EXTRA_OPTION: >
223 -D osmesa=gallium
224 -D tools=all
225 MESON_SHADERDB: "true"
226 BUILDTYPE: "debugoptimized"
227
228 .meson-cross:
229 extends:
230 - .meson-build
231 variables:
232 UNWIND: "false"
233 DRI_LOADERS: >
234 -D glx=disabled
235 -D gbm=false
236 -D egl=true
237 -D platforms=surfaceless
238 -D osmesa=none
239 GALLIUM_ST: >
240 -D dri3=false
241 -D gallium-vdpau=false
242 -D gallium-xvmc=false
243 -D gallium-omx=disabled
244 -D gallium-va=false
245 -D gallium-xa=false
246 -D gallium-nine=false
247
248 .meson-arm:
249 extends: .meson-cross
250 image: $DEBIAN_ARM64_IMAGE
251 variables:
252 VULKAN_DRIVERS: freedreno
253 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
254 EXTRA_OPTION: >
255 -D I-love-half-baked-turnips=true
256 needs:
257 - debian-10:arm64
258 tags:
259 - aarch64
260
261 meson-armhf:
262 extends: .meson-arm
263 variables:
264 CROSS: armhf
265 LLVM_VERSION: "7"
266
267 meson-arm64:
268 extends:
269 - .meson-arm
270 - .ci-deqp-artifacts
271 variables:
272 BUILDTYPE: "debugoptimized"
273
274 # NOTE: Building SWR is 2x (yes two) times slower than all the other
275 # gallium drivers combined.
276 # Start this early so that it doesn't limit the total run time.
277 #
278 # We also stick the glvnd build here, since we want non-glvnd in
279 # meson-main for actual driver CI.
280 meson-swr-glvnd:
281 extends: .meson-build
282 variables:
283 UNWIND: "true"
284 DRI_LOADERS: >
285 -D glvnd=true
286 -D egl=true
287 GALLIUM_ST: >
288 -D dri3=true
289 -D gallium-vdpau=false
290 -D gallium-xvmc=false
291 -D gallium-omx=disabled
292 -D gallium-va=false
293 -D gallium-xa=false
294 -D gallium-nine=false
295 -D gallium-opencl=disabled
296 GALLIUM_DRIVERS: "swr,iris"
297 LLVM_VERSION: "6.0"
298
299 meson-clang:
300 extends: .meson-build
301 variables:
302 UNWIND: "true"
303 DRI_DRIVERS: "auto"
304 GALLIUM_DRIVERS: "auto"
305 VULKAN_DRIVERS: intel,amd,freedreno
306 CC: "ccache clang-8"
307 CXX: "ccache clang++-8"
308
309 .meson-windows:
310 extends:
311 - .build-windows
312 before_script:
313 - $ENV:ARCH = "x86"
314 - $ENV:VERSION = "2019\Community"
315 script:
316 - cmd /C .gitlab-ci\meson-build.bat
317
318 scons-swr:
319 extends: .scons-build
320 variables:
321 SCONS_TARGET: "swr=1"
322 SCONS_CHECK_COMMAND: "true"
323 LLVM_VERSION: "6.0"
324
325 scons-win64:
326 extends: .scons-build
327 variables:
328 SCONS_TARGET: platform=windows machine=x86_64
329 SCONS_CHECK_COMMAND: "true"
330
331 meson-clover:
332 extends: .meson-build
333 variables:
334 UNWIND: "true"
335 DRI_LOADERS: >
336 -D glx=disabled
337 -D egl=false
338 -D gbm=false
339 GALLIUM_ST: >
340 -D dri3=false
341 -D gallium-vdpau=false
342 -D gallium-xvmc=false
343 -D gallium-omx=disabled
344 -D gallium-va=false
345 -D gallium-xa=false
346 -D gallium-nine=false
347 -D gallium-opencl=icd
348 script:
349 - export GALLIUM_DRIVERS="r600,radeonsi"
350 - .gitlab-ci/meson-build.sh
351 - LLVM_VERSION=8 .gitlab-ci/meson-build.sh
352 - export GALLIUM_DRIVERS="i915,r600"
353 - LLVM_VERSION=6.0 .gitlab-ci/meson-build.sh
354 - LLVM_VERSION=7 .gitlab-ci/meson-build.sh
355
356 meson-clover-old-llvm:
357 extends:
358 - meson-clover
359 - .use-debian-9:amd64
360 variables:
361 UNWIND: "false"
362 DRI_LOADERS: >
363 -D glx=disabled
364 -D egl=false
365 -D gbm=false
366 -D platforms=drm,surfaceless
367 GALLIUM_DRIVERS: "i915,r600"
368 script:
369 - LLVM_VERSION=3.9 .gitlab-ci/meson-build.sh
370 - LLVM_VERSION=4.0 .gitlab-ci/meson-build.sh
371 - LLVM_VERSION=5.0 .gitlab-ci/meson-build.sh
372
373 meson-vulkan:
374 extends: .meson-build
375 variables:
376 UNWIND: "false"
377 DRI_LOADERS: >
378 -D glx=disabled
379 -D gbm=false
380 -D egl=false
381 -D platforms=x11,wayland,drm
382 -D osmesa=none
383 GALLIUM_ST: >
384 -D dri3=true
385 -D gallium-vdpau=false
386 -D gallium-xvmc=false
387 -D gallium-omx=disabled
388 -D gallium-va=false
389 -D gallium-xa=false
390 -D gallium-nine=false
391 -D gallium-opencl=disabled
392 -D b_sanitize=undefined
393 -D c_args=-fno-sanitize-recover=all
394 -D cpp_args=-fno-sanitize-recover=all
395 UBSAN_OPTIONS: "print_stacktrace=1"
396 VULKAN_DRIVERS: intel,amd,freedreno
397 LLVM_VERSION: "8"
398 EXTRA_OPTION: >
399 -D vulkan-overlay-layer=true
400
401 # While the main point of this build is testing the i386 cross build,
402 # we also use this one to test some other options that are exclusive
403 # with meson-main's choices (classic swrast and osmesa)
404 meson-i386:
405 extends: .meson-cross
406 variables:
407 CROSS: i386
408 VULKAN_DRIVERS: intel
409 DRI_DRIVERS: "swrast"
410 GALLIUM_DRIVERS: "iris"
411 EXTRA_OPTION: >
412 -D vulkan-overlay-layer=true
413 -D llvm=false
414 -D osmesa=classic
415
416 meson-mingw32-x86_64:
417 extends: .meson-build
418 variables:
419 UNWIND: "false"
420 DRI_DRIVERS: ""
421 GALLIUM_DRIVERS: "swrast"
422 EXTRA_OPTION: >
423 -Dllvm=false
424 -Dosmesa=gallium
425 --cross-file=.gitlab-ci/x86_64-w64-mingw32
426
427 scons:
428 extends: .scons-build
429 variables:
430 SCONS_TARGET: "llvm=1"
431 SCONS_CHECK_COMMAND: "scons llvm=1 force_scons=1 check"
432 script:
433 - SCONS_TARGET="" SCONS_CHECK_COMMAND="scons check force_scons=1" .gitlab-ci/scons-build.sh
434 - LLVM_VERSION=6.0 .gitlab-ci/scons-build.sh
435 - LLVM_VERSION=7 .gitlab-ci/scons-build.sh
436 - LLVM_VERSION=8 .gitlab-ci/scons-build.sh
437
438 scons-old-llvm:
439 extends:
440 - scons
441 - .use-debian-9:amd64
442 script:
443 - LLVM_VERSION=3.9 .gitlab-ci/scons-build.sh
444 - LLVM_VERSION=4.0 .gitlab-ci/scons-build.sh
445 - LLVM_VERSION=5.0 .gitlab-ci/scons-build.sh
446
447 .test:
448 extends: .ci-run-policy
449 stage: test
450 variables:
451 GIT_STRATEGY: none # testing doesn't build anything from source
452
453 .deqp-test:
454 extends:
455 - .test
456 - .use-debian-10:amd64
457 variables:
458 DEQP_SKIPS: deqp-default-skips.txt
459 script:
460 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
461 - rm -rf install
462 - tar -xf artifacts/install.tar
463 - LD_LIBRARY_PATH=install/lib ldd install/lib/{*,dri/swrast_dri}.so
464 - ./artifacts/deqp-runner.sh
465 artifacts:
466 when: on_failure
467 name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
468 paths:
469 - results/
470 dependencies:
471 - meson-main
472 needs:
473 - meson-main
474 - debian-10:amd64
475
476 test-llvmpipe-gles2:
477 parallel: 4
478 variables:
479 DEQP_VER: gles2
480 DEQP_EXPECTED_FAILS: deqp-llvmpipe-fails.txt
481 LIBGL_ALWAYS_SOFTWARE: "true"
482 DEQP_RENDERER_MATCH: "llvmpipe"
483 extends: .deqp-test
484
485 test-softpipe-gles2:
486 extends: test-llvmpipe-gles2
487 variables:
488 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
489 DEQP_RENDERER_MATCH: "softpipe"
490 GALLIUM_DRIVER: "softpipe"
491
492 # The GLES2 CTS run takes about 8 minutes of CPU time, while GLES3 is
493 # 25 minutes. Until we can get its runtime down, just do a partial
494 # (every 10 tests) run.
495 test-softpipe-gles3-limited:
496 variables:
497 DEQP_VER: gles3
498 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
499 LIBGL_ALWAYS_SOFTWARE: "true"
500 DEQP_RENDERER_MATCH: "softpipe"
501 GALLIUM_DRIVER: "softpipe"
502 CI_NODE_INDEX: 1
503 CI_NODE_TOTAL: 10
504 extends: .deqp-test
505
506 arm64_a630_gles2:
507 extends: .deqp-test
508 image: $DEBIAN_ARM64_TEST_IMAGE
509 variables:
510 DEQP_VER: gles2
511 DEQP_RENDERER_MATCH: "FD630"
512 DEQP_EXPECTED_FAILS: deqp-freedreno-a630-fails.txt
513 DEQP_SKIPS: deqp-freedreno-a630-skips.txt
514 NIR_VALIDATE: 0
515 tags:
516 - mesa-cheza
517 dependencies:
518 - meson-arm64
519 needs:
520 - meson-arm64
521 - debian-10-test:arm64
522
523 arm64_a630_gles31:
524 extends: arm64_a630_gles2
525 parallel: 4
526 variables:
527 DEQP_VER: gles31
528
529 arm64_a630_gles3:
530 parallel: 6
531 extends: arm64_a630_gles2
532 variables:
533 DEQP_VER: gles3
534
535 arm64_a306_gles2:
536 parallel: 4
537 extends: arm64_a630_gles2
538 variables:
539 DEQP_EXPECTED_FAILS: deqp-freedreno-a307-fails.txt
540 DEQP_SKIPS: deqp-default-skips.txt
541 DEQP_RENDERER_MATCH: "FD307"
542 tags:
543 - db410c