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