gitlab-ci: Use separate arm64 build/test docker images
[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: "2019-10-30"
18 DEBIAN_ARM64_TAG: "arm64v8-2019-11-06"
19 DEBIAN_ARM64_TEST_TAG: "arm64v8-test-2019-11-06"
20 STRETCH_TAG: "2019-09-18"
21 DEBIAN_VERSION: buster-slim
22 STRETCH_VERSION: stretch-slim
23 DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
24 DEBIAN_ARM64_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_ARM64_TAG"
25 DEBIAN_ARM64_TEST_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_ARM64_TEST_TAG"
26 STRETCH_IMAGE: "$CI_REGISTRY_IMAGE/debian/$STRETCH_VERSION:$STRETCH_TAG"
27
28 include:
29 - project: 'wayland/ci-templates'
30 ref: 1f7f57c64ff4ebbf7292e3b7a13600518b8cb24c
31 file: '/templates/debian.yml'
32
33 include:
34 - local: '.gitlab-ci/lava-gitlab-ci.yml'
35
36 stages:
37 - container
38 - build
39 - test
40
41
42 # When to automatically run the CI
43 .ci-run-policy:
44 only:
45 refs:
46 - branches@mesa/mesa
47 - merge_requests
48 - /^ci([-/].*)?$/
49 changes:
50 - VERSION
51 - bin/**/*
52 # GitLab CI
53 - .gitlab-ci.yml
54 - .gitlab-ci/**/*
55 # Meson
56 - meson*
57 - build-support/**/*
58 - subprojects/**/*
59 # SCons
60 - SConstruct
61 - scons/**/*
62 - common.py
63 # Source code
64 - include/**/*
65 - src/**/*
66 retry:
67 max: 2
68 when:
69 - runner_system_failure
70
71 .ci-deqp-artifacts:
72 artifacts:
73 when: always
74 untracked: false
75 paths:
76 # Watch out! Artifacts are relative to the build dir.
77 # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
78 - artifacts
79
80 # Build the normal CI native and cross-build docker images.
81
82 .container:
83 stage: container
84 extends:
85 - .ci-run-policy
86 variables:
87 # no need to pull the whole repo to build the container image
88 GIT_STRATEGY: none
89
90 debian-10:amd64:
91 extends:
92 - .debian@container-ifnot-exists
93 - .container
94 variables:
95 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
96
97 .use-debian-10:amd64:
98 image: $DEBIAN_IMAGE
99 needs:
100 - debian-10:amd64
101
102 debian-9:amd64:
103 extends: debian-10:amd64
104 variables:
105 DEBIAN_TAG: $STRETCH_TAG
106 DEBIAN_VERSION: $STRETCH_VERSION
107 DEBIAN_IMAGE: $STRETCH_IMAGE
108 DEBIAN_EXEC: 'bash .gitlab-ci/debian-stretch-install.sh'
109
110 .use-debian-9:amd64:
111 image: $STRETCH_IMAGE
112 needs:
113 - debian-9:amd64
114
115 debian-10:arm64:
116 extends:
117 - .debian@container-ifnot-exists@arm64v8
118 - .container
119 variables:
120 DEBIAN_TAG: "$DEBIAN_ARM64_TAG"
121 DEBIAN_EXEC: 'bash .gitlab-ci/debian-arm64-install.sh'
122
123 debian-10-test:arm64:
124 extends:
125 - .debian@container-ifnot-exists@arm64v8
126 - .container
127 variables:
128 DEBIAN_TAG: "$DEBIAN_ARM64_TEST_TAG"
129 DEBIAN_EXEC: 'bash .gitlab-ci/debian-arm64-test-install.sh'
130
131
132 # BUILD
133
134 # Shared between windows and Linux
135 .build-common:
136 extends: .ci-run-policy
137 stage: build
138 artifacts:
139 when: always
140 paths:
141 - _build/meson-logs/*.txt
142 # scons:
143 - build/*/config.log
144 - shader-db
145
146 # Just Linux
147 .build-linux:
148 extends: .build-common
149 tags:
150 - mesa-autoscale
151 cache:
152 key: ${CI_JOB_NAME}
153 paths:
154 - ccache
155 variables:
156 CCACHE_COMPILERCHECK: "content"
157 NINJA_FLAGS: "-j8" # autoscale is provisioned at 4 CPUs/job.
158 # kubernetes (the mesa-autoscale runner) always has a clean working
159 # dir, so we can't reuse the git clone, but that also means we don't
160 # need to download any extra history (normally extra history is
161 # needed so that a future fetch can find a shared parent).
162 GIT_DEPTH: 1
163 # Autoscale runners have 300GB of disk (since iops/throughput
164 # scales with disk size!), but we want to leave lots of space for
165 # container caching.
166 CCACHE_SIZE: 20G
167 # Use ccache transparently, and print stats before/after
168 before_script:
169 - export PATH="/usr/lib/ccache:$PATH"
170 - export CCACHE_BASEDIR="$PWD"
171 - ccache --max-size="$CCACHE_SIZE" || true
172 - if [ "$CCACHE_DIR" = "$CI_PROJECT_DIR/ccache" ]; then ccache --zero-stats; fi
173 - ccache --show-stats || true
174 after_script:
175 # In case the install dir is being saved as artifacts, tar it up
176 # so that symlinks and hardlinks aren't each packed separately in
177 # the zip file.
178 - if [ -d install ]; then
179 tar -cf artifacts/install.tar install;
180 fi
181 - ccache --show-stats
182
183 .build-windows:
184 extends: .build-common
185 tags:
186 - mesa-windows
187 cache:
188 key: ${CI_JOB_NAME}
189 paths:
190 - subprojects/packagecache
191
192 .meson-build:
193 extends:
194 - .build-linux
195 - .use-debian-10:amd64
196 script:
197 - .gitlab-ci/meson-build.sh
198
199 .scons-build:
200 extends:
201 - .build-linux
202 - .use-debian-10:amd64
203 variables:
204 SCONSFLAGS: "-j8"
205 script:
206 - .gitlab-ci/scons-build.sh
207
208 meson-main:
209 extends:
210 - .meson-build
211 - .ci-deqp-artifacts
212 variables:
213 UNWIND: "true"
214 DRI_LOADERS: >
215 -D glx=dri
216 -D gbm=true
217 -D egl=true
218 -D platforms=x11,wayland,drm,surfaceless
219 DRI_DRIVERS: "i915,i965,r100,r200,nouveau"
220 GALLIUM_ST: >
221 -D dri3=true
222 -D gallium-extra-hud=true
223 -D gallium-vdpau=true
224 -D gallium-xvmc=true
225 -D gallium-omx=bellagio
226 -D gallium-va=true
227 -D gallium-xa=true
228 -D gallium-nine=true
229 -D gallium-opencl=disabled
230 GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink"
231 LLVM_VERSION: "7"
232 EXTRA_OPTION: >
233 -D osmesa=gallium
234 -D tools=all
235 MESON_SHADERDB: "true"
236 BUILDTYPE: "debugoptimized"
237
238 .meson-cross:
239 extends:
240 - .meson-build
241 variables:
242 UNWIND: "false"
243 DRI_LOADERS: >
244 -D glx=disabled
245 -D gbm=false
246 -D egl=true
247 -D platforms=surfaceless
248 -D osmesa=none
249 GALLIUM_ST: >
250 -D dri3=false
251 -D gallium-vdpau=false
252 -D gallium-xvmc=false
253 -D gallium-omx=disabled
254 -D gallium-va=false
255 -D gallium-xa=false
256 -D gallium-nine=false
257
258 .meson-arm:
259 extends: .meson-cross
260 image: $DEBIAN_ARM64_IMAGE
261 variables:
262 VULKAN_DRIVERS: freedreno
263 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
264 EXTRA_OPTION: >
265 -D I-love-half-baked-turnips=true
266 NINJA_FLAGS: "-j4"
267 CCACHE_DIR: "$CI_PROJECT_DIR/ccache"
268 CCACHE_SIZE: "1500M"
269 needs:
270 - debian-10:arm64
271 tags:
272 - aarch64
273
274 meson-armhf:
275 extends: .meson-arm
276 variables:
277 CROSS: armhf
278 LLVM_VERSION: "7"
279
280 meson-arm64:
281 extends:
282 - .meson-arm
283 - .ci-deqp-artifacts
284 variables:
285 BUILDTYPE: "debugoptimized"
286
287 # NOTE: Building SWR is 2x (yes two) times slower than all the other
288 # gallium drivers combined.
289 # Start this early so that it doesn't limit the total run time.
290 #
291 # We also stick the glvnd build here, since we want non-glvnd in
292 # meson-main for actual driver CI.
293 meson-swr-glvnd:
294 extends: .meson-build
295 variables:
296 UNWIND: "true"
297 DRI_LOADERS: >
298 -D glvnd=true
299 -D egl=true
300 GALLIUM_ST: >
301 -D dri3=true
302 -D gallium-vdpau=false
303 -D gallium-xvmc=false
304 -D gallium-omx=disabled
305 -D gallium-va=false
306 -D gallium-xa=false
307 -D gallium-nine=false
308 -D gallium-opencl=disabled
309 GALLIUM_DRIVERS: "swr,iris"
310 LLVM_VERSION: "6.0"
311
312 meson-clang:
313 extends: .meson-build
314 variables:
315 UNWIND: "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-debian-9:amd64
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=6.0 .gitlab-ci/scons-build.sh
448 - LLVM_VERSION=7 .gitlab-ci/scons-build.sh
449 - LLVM_VERSION=8 .gitlab-ci/scons-build.sh
450
451 scons-old-llvm:
452 extends:
453 - scons
454 - .use-debian-9:amd64
455 script:
456 - LLVM_VERSION=3.9 .gitlab-ci/scons-build.sh
457 - LLVM_VERSION=4.0 .gitlab-ci/scons-build.sh
458 - LLVM_VERSION=5.0 .gitlab-ci/scons-build.sh
459
460 .test:
461 extends: .ci-run-policy
462 stage: test
463 variables:
464 GIT_STRATEGY: none # testing doesn't build anything from source
465
466 .deqp-test:
467 extends:
468 - .test
469 - .use-debian-10:amd64
470 variables:
471 DEQP_SKIPS: deqp-default-skips.txt
472 script:
473 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
474 - rm -rf install
475 - tar -xf artifacts/install.tar
476 - LD_LIBRARY_PATH=install/lib ldd install/lib/{*,dri/swrast_dri}.so
477 - ./artifacts/deqp-runner.sh
478 artifacts:
479 when: on_failure
480 name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
481 paths:
482 - results/
483 dependencies:
484 - meson-main
485 needs:
486 - meson-main
487 - debian-10:amd64
488
489 test-llvmpipe-gles2:
490 parallel: 4
491 variables:
492 DEQP_VER: gles2
493 DEQP_EXPECTED_FAILS: deqp-llvmpipe-fails.txt
494 LIBGL_ALWAYS_SOFTWARE: "true"
495 DEQP_RENDERER_MATCH: "llvmpipe"
496 extends: .deqp-test
497
498 test-softpipe-gles2:
499 extends: test-llvmpipe-gles2
500 variables:
501 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
502 DEQP_RENDERER_MATCH: "softpipe"
503 GALLIUM_DRIVER: "softpipe"
504
505 # The GLES2 CTS run takes about 8 minutes of CPU time, while GLES3 is
506 # 25 minutes. Until we can get its runtime down, just do a partial
507 # (every 10 tests) run.
508 test-softpipe-gles3-limited:
509 variables:
510 DEQP_VER: gles3
511 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
512 LIBGL_ALWAYS_SOFTWARE: "true"
513 DEQP_RENDERER_MATCH: "softpipe"
514 GALLIUM_DRIVER: "softpipe"
515 CI_NODE_INDEX: 1
516 CI_NODE_TOTAL: 10
517 extends: .deqp-test
518
519 arm64_a630_gles2:
520 extends: .deqp-test
521 image: $DEBIAN_ARM64_TEST_IMAGE
522 variables:
523 DEQP_VER: gles2
524 DEQP_RENDERER_MATCH: "FD630"
525 DEQP_EXPECTED_FAILS: deqp-freedreno-a630-fails.txt
526 DEQP_SKIPS: deqp-freedreno-a630-skips.txt
527 NIR_VALIDATE: 0
528 tags:
529 - mesa-cheza
530 dependencies:
531 - meson-arm64
532 needs:
533 - meson-arm64
534 - debian-10-test:arm64
535
536 arm64_a630_gles31:
537 extends: arm64_a630_gles2
538 parallel: 4
539 variables:
540 DEQP_VER: gles31
541
542 arm64_a630_gles3:
543 parallel: 6
544 extends: arm64_a630_gles2
545 variables:
546 DEQP_VER: gles3
547
548 arm64_a306_gles2:
549 parallel: 4
550 extends: arm64_a630_gles2
551 variables:
552 DEQP_EXPECTED_FAILS: deqp-freedreno-a307-fails.txt
553 DEQP_SKIPS: deqp-default-skips.txt
554 DEQP_RENDERER_MATCH: "FD307"
555 tags:
556 - db410c