464c26d7d1b1ba49803e27c9ab5c91da1e498f7e
[mesa.git] / .gitlab-ci.yml
1 variables:
2 UPSTREAM_REPO: mesa/mesa
3
4 include:
5 - project: 'wayland/ci-templates'
6 # Must be the same as in .gitlab-ci/lava-gitlab-ci.yml
7 ref: 0a9bdd33a98f05af6761ab118b5074952242aab0
8 file: '/templates/debian.yml'
9 - local: '.gitlab-ci/lava-gitlab-ci.yml'
10
11 stages:
12 - container
13 - build
14 - test
15
16
17 # When to automatically run the CI
18 .ci-run-policy:
19 rules:
20 - when: on_success
21 retry:
22 max: 2
23 when:
24 - runner_system_failure
25 # Cancel CI run if a newer commit is pushed to the same branch
26 interruptible: true
27
28 .ci-deqp-artifacts:
29 artifacts:
30 when: always
31 untracked: false
32 paths:
33 # Watch out! Artifacts are relative to the build dir.
34 # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
35 - artifacts
36
37 # Build the CI docker images.
38 #
39 # DEBIAN_TAG is the tag of the docker image used by later stage jobs. If the
40 # image doesn't exist yet, the container stage job generates it.
41 #
42 # In order to generate a new image, one should generally change the tag.
43 # While removing the image from the registry would also work, that's not
44 # recommended except for ephemeral images during development: Replacing
45 # an image after a significant amount of time might pull in newer
46 # versions of gcc/clang or other packages, which might break the build
47 # with older commits using the same tag.
48 #
49 # After merging a change resulting in generating a new image to the
50 # main repository, it's recommended to remove the image from the source
51 # repository's container registry, so that the image from the main
52 # repository's registry will be used there as well.
53
54 .container:
55 stage: container
56 extends:
57 - .ci-run-policy
58 rules:
59 # Run pipeline by default for merge requests changing files affecting it
60 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
61 changes:
62 - VERSION
63 - bin/**/*
64 # GitLab CI
65 - .gitlab-ci.yml
66 - .gitlab-ci/**/*
67 # Meson
68 - meson*
69 - build-support/**/*
70 - subprojects/**/*
71 # SCons
72 - SConstruct
73 - scons/**/*
74 - common.py
75 # Source code
76 - include/**/*
77 - src/**/*
78 when: on_success
79 # Always run pipeline by default in the main project
80 - if: '$CI_PROJECT_PATH == "mesa/mesa"'
81 when: on_success
82 # Otherwise, allow triggering jobs manually
83 - when: manual
84 variables:
85 DEBIAN_VERSION: buster-slim
86 REPO_SUFFIX: $CI_JOB_NAME
87 DEBIAN_EXEC: 'bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
88 # no need to pull the whole repo to build the container image
89 GIT_STRATEGY: none
90
91 # Debian 10 based x86 build image
92 x86_build:
93 extends:
94 - .debian@container-ifnot-exists
95 - .container
96 variables:
97 DEBIAN_TAG: &x86_build "2020-01-14"
98
99 .use-x86_build:
100 variables:
101 TAG: *x86_build
102 image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG"
103 needs:
104 - x86_build
105
106 # Debian 10 based x86 test image for GL
107 x86_test-gl:
108 extends: x86_build
109 variables:
110 DEBIAN_TAG: &x86_test-gl "2020-01-14"
111
112 # Debian 10 based x86 test image for VK
113 x86_test-vk:
114 extends: x86_build
115 variables:
116 DEBIAN_TAG: &x86_test-vk "2020-01-14"
117 # Can only be triggered manually on personal branches because RADV is the only
118 # driver that does Vulkan testing at the moment.
119 rules:
120 # Never build the test image for VK by default in the main project.
121 - if: '$CI_PROJECT_PATH == "mesa/mesa"'
122 when: never
123 # Never build the test image for VK by default for merge requests.
124 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
125 when: never
126 # Otherwise, allow building it manually for personal branches.
127 - when: manual
128
129
130 # Debian 9 based x86 build image (old LLVM)
131 x86_build_old:
132 extends: x86_build
133 variables:
134 DEBIAN_TAG: &x86_build_old "2019-09-18"
135 DEBIAN_VERSION: stretch-slim
136
137 .use-x86_build_old:
138 variables:
139 TAG: *x86_build_old
140 image: "$CI_REGISTRY_IMAGE/debian/x86_build_old:$TAG"
141 needs:
142 - x86_build_old
143
144 # Debian 10 based ARM build image
145 arm_build:
146 extends:
147 - .debian@container-ifnot-exists@arm64v8
148 - .container
149 variables:
150 DEBIAN_TAG: &arm_build "2020-01-14"
151
152 .use-arm_build:
153 variables:
154 TAG: *arm_build
155 image: "$CI_REGISTRY_IMAGE/debian/arm_build:$TAG"
156 needs:
157 - arm_build
158
159 # Debian 10 based ARM test image
160 arm_test:
161 extends: arm_build
162 variables:
163 DEBIAN_TAG: &arm_test "2019-12-18"
164
165 .use-arm_test:
166 variables:
167 TAG: *arm_test
168 image: "$CI_REGISTRY_IMAGE/debian/arm_test:$TAG"
169 needs:
170 - meson-arm64
171 - arm_test
172
173
174 # BUILD
175
176 # Shared between windows and Linux
177 .build-common:
178 extends: .ci-run-policy
179 stage: build
180 artifacts:
181 when: always
182 paths:
183 - _build/meson-logs/*.txt
184 # scons:
185 - build/*/config.log
186 - shader-db
187
188 # Just Linux
189 .build-linux:
190 extends: .build-common
191 variables:
192 CCACHE_COMPILERCHECK: "content"
193 CCACHE_COMPRESS: "true"
194 CCACHE_DIR: /cache/mesa/ccache
195 # Use ccache transparently, and print stats before/after
196 before_script:
197 - export PATH="/usr/lib/ccache:$PATH"
198 - export CCACHE_BASEDIR="$PWD"
199 - ccache --show-stats
200 after_script:
201 - ccache --show-stats
202
203 .build-windows:
204 extends: .build-common
205 tags:
206 - mesa-windows
207 cache:
208 key: ${CI_JOB_NAME}
209 paths:
210 - subprojects/packagecache
211
212 .meson-build:
213 extends:
214 - .build-linux
215 - .use-x86_build
216 variables:
217 LLVM_VERSION: 9
218 script:
219 - .gitlab-ci/meson-build.sh
220
221 .scons-build:
222 extends:
223 - .build-linux
224 - .use-x86_build
225 variables:
226 SCONSFLAGS: "-j4"
227 script:
228 - .gitlab-ci/scons-build.sh
229
230 meson-testing:
231 extends:
232 - .meson-build
233 - .ci-deqp-artifacts
234 variables:
235 UNWIND: "true"
236 DRI_LOADERS: >
237 -D glx=dri
238 -D gbm=true
239 -D egl=true
240 -D platforms=x11,drm,surfaceless
241 GALLIUM_ST: >
242 -D dri3=true
243 GALLIUM_DRIVERS: "swrast"
244 VULKAN_DRIVERS: amd
245 BUILDTYPE: "debugoptimized"
246 script:
247 - .gitlab-ci/meson-build.sh
248 - .gitlab-ci/prepare-artifacts.sh
249
250 meson-main:
251 extends: .meson-build
252 variables:
253 UNWIND: "true"
254 DRI_LOADERS: >
255 -D glx=dri
256 -D gbm=true
257 -D egl=true
258 -D platforms=x11,wayland,drm,surfaceless
259 DRI_DRIVERS: "i915,i965,r100,r200,nouveau"
260 GALLIUM_ST: >
261 -D dri3=true
262 -D gallium-extra-hud=true
263 -D gallium-vdpau=true
264 -D gallium-xvmc=true
265 -D gallium-omx=bellagio
266 -D gallium-va=true
267 -D gallium-xa=true
268 -D gallium-nine=true
269 -D gallium-opencl=disabled
270 GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swr,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink"
271 EXTRA_OPTION: >
272 -D osmesa=gallium
273 -D tools=all
274 script:
275 - .gitlab-ci/meson-build.sh
276 - .gitlab-ci/run-shader-db.sh
277
278 .meson-cross:
279 extends:
280 - .meson-build
281 variables:
282 UNWIND: "false"
283 DRI_LOADERS: >
284 -D glx=disabled
285 -D gbm=false
286 -D egl=true
287 -D platforms=surfaceless
288 -D osmesa=none
289 GALLIUM_ST: >
290 -D dri3=false
291 -D gallium-vdpau=false
292 -D gallium-xvmc=false
293 -D gallium-omx=disabled
294 -D gallium-va=false
295 -D gallium-xa=false
296 -D gallium-nine=false
297
298 .meson-arm:
299 extends:
300 - .meson-cross
301 - .use-arm_build
302 variables:
303 VULKAN_DRIVERS: freedreno
304 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
305 BUILDTYPE: "debugoptimized"
306 EXTRA_OPTION: >
307 -D I-love-half-baked-turnips=true
308 tags:
309 - aarch64
310
311 meson-armhf:
312 extends:
313 - .meson-arm
314 - .ci-deqp-artifacts
315 variables:
316 CROSS: armhf
317 LLVM_VERSION: "7"
318 script:
319 - .gitlab-ci/meson-build.sh
320 - .gitlab-ci/prepare-artifacts.sh
321
322 meson-arm64:
323 extends:
324 - .meson-arm
325 - .ci-deqp-artifacts
326 variables:
327 LLVM_VERSION: "8"
328 VULKAN_DRIVERS: "freedreno,amd"
329 script:
330 - .gitlab-ci/meson-build.sh
331 - .gitlab-ci/prepare-artifacts.sh
332
333 meson-clang:
334 extends: .meson-build
335 variables:
336 UNWIND: "true"
337 DRI_LOADERS: >
338 -D glvnd=true
339 DRI_DRIVERS: "auto"
340 GALLIUM_DRIVERS: "auto"
341 VULKAN_DRIVERS: intel,amd,freedreno
342 CC: "ccache clang-9"
343 CXX: "ccache clang++-9"
344
345 .meson-windows:
346 extends:
347 - .build-windows
348 before_script:
349 - $ENV:ARCH = "x86"
350 - $ENV:VERSION = "2019\Community"
351 script:
352 - cmd /C .gitlab-ci\meson-build.bat
353
354 scons-swr:
355 extends: .scons-build
356 variables:
357 SCONS_TARGET: "swr=1"
358 SCONS_CHECK_COMMAND: "true"
359 LLVM_VERSION: "6.0"
360
361 scons-win64:
362 extends: .scons-build
363 variables:
364 SCONS_TARGET: platform=windows machine=x86_64
365 SCONS_CHECK_COMMAND: "true"
366
367 meson-clover:
368 extends: .meson-build
369 variables:
370 UNWIND: "true"
371 DRI_LOADERS: >
372 -D glx=disabled
373 -D egl=false
374 -D gbm=false
375 GALLIUM_ST: >
376 -D dri3=false
377 -D gallium-vdpau=false
378 -D gallium-xvmc=false
379 -D gallium-omx=disabled
380 -D gallium-va=false
381 -D gallium-xa=false
382 -D gallium-nine=false
383 -D gallium-opencl=icd
384 script:
385 - export GALLIUM_DRIVERS="r600,radeonsi"
386 - .gitlab-ci/meson-build.sh
387 - LLVM_VERSION=8 .gitlab-ci/meson-build.sh
388 - export GALLIUM_DRIVERS="i915,r600"
389 - LLVM_VERSION=6.0 .gitlab-ci/meson-build.sh
390 - LLVM_VERSION=7 .gitlab-ci/meson-build.sh
391
392 meson-clover-old-llvm:
393 extends:
394 - meson-clover
395 - .use-x86_build_old
396 variables:
397 UNWIND: "false"
398 DRI_LOADERS: >
399 -D glx=disabled
400 -D egl=false
401 -D gbm=false
402 -D platforms=drm,surfaceless
403 GALLIUM_DRIVERS: "i915,r600"
404 script:
405 - LLVM_VERSION=3.9 .gitlab-ci/meson-build.sh
406 - LLVM_VERSION=4.0 .gitlab-ci/meson-build.sh
407 - LLVM_VERSION=5.0 .gitlab-ci/meson-build.sh
408
409 meson-vulkan:
410 extends: .meson-build
411 variables:
412 UNWIND: "false"
413 DRI_LOADERS: >
414 -D glx=disabled
415 -D gbm=false
416 -D egl=false
417 -D platforms=x11,wayland,drm
418 -D osmesa=none
419 GALLIUM_ST: >
420 -D dri3=true
421 -D gallium-vdpau=false
422 -D gallium-xvmc=false
423 -D gallium-omx=disabled
424 -D gallium-va=false
425 -D gallium-xa=false
426 -D gallium-nine=false
427 -D gallium-opencl=disabled
428 -D b_sanitize=undefined
429 -D c_args=-fno-sanitize-recover=all
430 -D cpp_args=-fno-sanitize-recover=all
431 UBSAN_OPTIONS: "print_stacktrace=1"
432 VULKAN_DRIVERS: intel,amd,freedreno
433 EXTRA_OPTION: >
434 -D vulkan-overlay-layer=true
435
436 # While the main point of this build is testing the i386 cross build,
437 # we also use this one to test some other options that are exclusive
438 # with meson-main's choices (classic swrast and osmesa)
439 meson-i386:
440 extends: .meson-cross
441 variables:
442 CROSS: i386
443 VULKAN_DRIVERS: intel
444 DRI_DRIVERS: "swrast"
445 GALLIUM_DRIVERS: "iris"
446 EXTRA_OPTION: >
447 -D vulkan-overlay-layer=true
448 -D llvm=false
449 -D osmesa=classic
450
451 meson-mingw32-x86_64:
452 extends: .meson-build
453 variables:
454 UNWIND: "false"
455 DRI_DRIVERS: ""
456 GALLIUM_DRIVERS: "swrast"
457 EXTRA_OPTION: >
458 -Dllvm=false
459 -Dosmesa=gallium
460 --cross-file=.gitlab-ci/x86_64-w64-mingw32
461
462 scons:
463 extends: .scons-build
464 variables:
465 SCONS_TARGET: "llvm=1"
466 SCONS_CHECK_COMMAND: "scons llvm=1 force_scons=1 check"
467 script:
468 - SCONS_TARGET="" SCONS_CHECK_COMMAND="scons check force_scons=1" .gitlab-ci/scons-build.sh
469 - LLVM_VERSION=9 .gitlab-ci/scons-build.sh
470
471 scons-old-llvm:
472 extends:
473 - scons
474 - .use-x86_build_old
475 script:
476 - LLVM_VERSION=3.9 .gitlab-ci/scons-build.sh
477
478 .test:
479 extends:
480 - .ci-run-policy
481 stage: test
482 variables:
483 GIT_STRATEGY: none # testing doesn't build anything from source
484 before_script:
485 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
486 - rm -rf install
487 - tar -xf artifacts/install.tar
488 - LD_LIBRARY_PATH=install/lib find install/lib -name "*.so" -print -exec ldd {} \;
489 artifacts:
490 when: always
491 name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
492 paths:
493 - results/
494 dependencies:
495 - meson-testing
496
497 .test-gl:
498 extends:
499 - .test
500 variables:
501 TAG: *x86_test-gl
502 image: "$CI_REGISTRY_IMAGE/debian/x86_test-gl:$TAG"
503 needs:
504 - meson-testing
505 - x86_test-gl
506
507 .test-vk:
508 extends:
509 - .test
510 variables:
511 TAG: *x86_test-vk
512 image: "$CI_REGISTRY_IMAGE/debian/x86_test-vk:$TAG"
513 needs:
514 - meson-testing
515 - x86_test-vk
516
517 .piglit-test:
518 extends: .test-gl
519 artifacts:
520 when: on_failure
521 name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
522 paths:
523 - summary/
524 variables:
525 LIBGL_ALWAYS_SOFTWARE: 1
526 PIGLIT_NO_WINDOW: 1
527 script:
528 - artifacts/piglit/run.sh
529
530 piglit-quick_gl:
531 extends: .piglit-test
532 variables:
533 LP_NUM_THREADS: 0
534 NIR_VALIDATE: 0
535 PIGLIT_OPTIONS: >
536 --process-isolation false
537 -x arb_gpu_shader5
538 -x egl_ext_device_
539 -x egl_ext_platform_device
540 -x glx-multithread-clearbuffer
541 -x glx-multithread-shader-compile
542 -x max-texture-size
543 -x maxsize
544 PIGLIT_PROFILES: quick_gl
545
546 piglit-glslparser:
547 extends: .piglit-test
548 variables:
549 LP_NUM_THREADS: 0
550 NIR_VALIDATE: 0
551 PIGLIT_PROFILES: glslparser
552
553 piglit-quick_shader:
554 extends: .piglit-test
555 variables:
556 LP_NUM_THREADS: 1
557 NIR_VALIDATE: 0
558 PIGLIT_PROFILES: quick_shader
559
560 .deqp-test:
561 variables:
562 DEQP_SKIPS: deqp-default-skips.txt
563 script:
564 - ./artifacts/deqp-runner.sh
565
566 .deqp-test-gl:
567 extends:
568 - .test-gl
569 - .deqp-test
570
571 .deqp-test-vk:
572 extends:
573 - .test-vk
574 - .deqp-test
575 variables:
576 DEQP_VER: vk
577
578 test-llvmpipe-gles2:
579 variables:
580 DEQP_VER: gles2
581 DEQP_PARALLEL: 4
582 NIR_VALIDATE: 0
583 # Don't use threads inside llvmpipe, we've already got all 4 cores
584 # busy with DEQP_PARALLEL.
585 LP_NUM_THREADS: 0
586 DEQP_EXPECTED_FAILS: deqp-llvmpipe-fails.txt
587 LIBGL_ALWAYS_SOFTWARE: "true"
588 extends: .deqp-test-gl
589
590 test-softpipe-gles2:
591 extends: test-llvmpipe-gles2
592 variables:
593 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
594 DEQP_SKIPS: deqp-softpipe-skips.txt
595 GALLIUM_DRIVER: "softpipe"
596
597 test-softpipe-gles3:
598 parallel: 2
599 variables:
600 DEQP_VER: gles3
601 extends: test-softpipe-gles2
602
603 test-softpipe-gles31:
604 parallel: 4
605 variables:
606 DEQP_VER: gles31
607 extends: test-softpipe-gles2
608
609 arm64_a630_gles2:
610 extends:
611 - .deqp-test-gl
612 - .use-arm_test
613 variables:
614 DEQP_VER: gles2
615 DEQP_EXPECTED_FAILS: deqp-freedreno-a630-fails.txt
616 DEQP_SKIPS: deqp-freedreno-a630-skips.txt
617 NIR_VALIDATE: 0
618 DEQP_PARALLEL: 4
619 FLAKES_CHANNEL: "#freedreno-ci"
620 tags:
621 - mesa-cheza
622 dependencies:
623 - meson-arm64
624
625 arm64_a630_gles31:
626 extends: arm64_a630_gles2
627 variables:
628 DEQP_VER: gles31
629
630 arm64_a630_gles3:
631 extends: arm64_a630_gles2
632 variables:
633 DEQP_VER: gles3
634
635 arm64_a306_gles2:
636 extends: arm64_a630_gles2
637 variables:
638 DEQP_EXPECTED_FAILS: deqp-freedreno-a307-fails.txt
639 DEQP_SKIPS: deqp-default-skips.txt
640 tags:
641 - db410c
642
643 # RADV CI
644 .test-radv:
645 variables:
646 VK_DRIVER: radeon
647 RADV_DEBUG: checkir
648 # Can only be triggered manually on personal branches because RADV is the only
649 # driver that does Vulkan testing at the moment.
650 rules:
651 # Never test RADV by default in the main project.
652 - if: '$CI_PROJECT_PATH == "mesa/mesa"'
653 when: never
654 # Never test RADV by default for merge requests.
655 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
656 when: never
657 # Otherwise, allow testing RADV if the test image for VK has been manually
658 # started.
659 - when: on_success
660
661 radv_polaris10_vkcts:
662 extends:
663 - .deqp-test-vk
664 - .test-radv
665 variables:
666 DEQP_PARALLEL: 4
667 DEQP_SKIPS: deqp-radv-polaris10-skips.txt
668 tags:
669 - polaris10