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