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