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