1 # Currently we have two build stages after our containers are built:
2 # - build (for traditional build and test or first stage build)
3 # - test (for test stages, using build artefacts from a build stage)
11 - local: '/.gitlab-ci.d/edk2.yml'
12 - local: '/.gitlab-ci.d/opensbi.yml'
13 - local: '/.gitlab-ci.d/containers.yml'
14 - local: '/.gitlab-ci.d/crossbuilds.yml'
16 .native_build_job_template: &native_build_job_definition
18 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
20 - JOBS=$(expr $(nproc) + 1)
21 - sed -i s,git.qemu.org/git,gitlab.com/qemu-project, .gitmodules
25 - if test -n "$TARGETS";
27 ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
29 ../configure --enable-werror $CONFIGURE_ARGS ;
30 fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
32 - if test -n "$MAKE_CHECK_ARGS";
34 make -j"$JOBS" $MAKE_CHECK_ARGS ;
37 .native_test_job_template: &native_test_job_definition
39 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
42 - find . -type f -exec touch {} +
43 - make $MAKE_CHECK_ARGS
45 .acceptance_template: &acceptance_definition
47 key: "${CI_JOB_NAME}-cache"
49 - ${CI_PROJECT_DIR}/avocado-cache
52 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
56 - build/tests/results/latest/results.xml
57 - build/tests/results/latest/test-results
59 junit: build/tests/results/latest/results.xml
61 - mkdir -p ~/.config/avocado
62 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
63 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
64 >> ~/.config/avocado/avocado.conf
65 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL"]'
66 >> ~/.config/avocado/avocado.conf
67 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
68 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
70 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
73 - du -chs ${CI_PROJECT_DIR}/avocado-cache
76 <<: *native_build_job_definition
79 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
80 moxie-softmmu microblazeel-softmmu mips64el-softmmu
81 MAKE_CHECK_ARGS: check-build
82 CONFIGURE_ARGS: --enable-docs
89 <<: *native_test_job_definition
91 - job: build-system-ubuntu
95 MAKE_CHECK_ARGS: check
97 acceptance-system-ubuntu:
98 <<: *native_test_job_definition
100 - job: build-system-ubuntu
104 MAKE_CHECK_ARGS: check-acceptance
105 <<: *acceptance_definition
108 <<: *native_build_job_definition
111 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
112 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
113 MAKE_CHECK_ARGS: check-build
114 CONFIGURE_ARGS: --enable-docs
121 <<: *native_test_job_definition
123 - job: build-system-debian
127 MAKE_CHECK_ARGS: check
129 acceptance-system-debian:
130 <<: *native_test_job_definition
132 - job: build-system-debian
136 MAKE_CHECK_ARGS: check-acceptance
137 <<: *acceptance_definition
140 <<: *native_build_job_definition
143 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
144 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
145 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
146 MAKE_CHECK_ARGS: check-build
153 <<: *native_test_job_definition
155 - job: build-system-fedora
159 MAKE_CHECK_ARGS: check
161 acceptance-system-fedora:
162 <<: *native_test_job_definition
164 - job: build-system-fedora
168 MAKE_CHECK_ARGS: check-acceptance
169 <<: *acceptance_definition
172 <<: *native_build_job_definition
175 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
176 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
177 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
178 MAKE_CHECK_ARGS: check-build
185 <<: *native_test_job_definition
187 - job: build-system-centos
191 MAKE_CHECK_ARGS: check
193 acceptance-system-centos:
194 <<: *native_test_job_definition
196 - job: build-system-centos
200 MAKE_CHECK_ARGS: check-acceptance
201 <<: *acceptance_definition
203 build-system-opensuse:
204 <<: *native_build_job_definition
207 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
208 MAKE_CHECK_ARGS: check-build
214 check-system-opensuse:
215 <<: *native_test_job_definition
217 - job: build-system-opensuse
221 MAKE_CHECK_ARGS: check
223 acceptance-system-opensuse:
224 <<: *native_test_job_definition
226 - job: build-system-opensuse
230 MAKE_CHECK_ARGS: check-acceptance
231 <<: *acceptance_definition
235 <<: *native_build_job_definition
248 --disable-coroutine-pool
257 --disable-guest-agent
268 --disable-live-block-migration
270 --disable-malloc-trim
279 --disable-qom-cast-debug
282 --disable-replication
295 --disable-vhost-crypto
300 --disable-vhost-vsock
301 --disable-virglrenderer
307 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
308 s390x-softmmu i386-linux-user
309 MAKE_CHECK_ARGS: check-qtest SPEED=slow
311 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
312 # the configure script. The container doesn't contain Xen headers so
313 # Xen accelerator is not detected / selected. As result it build the
314 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
317 <<: *native_build_job_definition
323 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
326 - make check-qapi-schema
327 - cd tests/qemu-iotests/
328 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
329 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
330 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
331 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
332 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
333 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
334 260 261 262 263 264 270 272 273 277 279
337 <<: *native_build_job_definition
339 IMAGE: debian-all-test-cross
340 CONFIGURE_ARGS: --disable-tools --disable-system
341 MAKE_CHECK_ARGS: check-tcg
344 <<: *native_build_job_definition
346 IMAGE: debian-all-test-cross
347 CONFIGURE_ARGS: --disable-tools --disable-system --static
348 MAKE_CHECK_ARGS: check-tcg
350 # Only build the softmmu targets we have check-tcg tests for
352 <<: *native_build_job_definition
354 IMAGE: debian-all-test-cross
355 CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
356 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
357 MAKE_CHECK_ARGS: check-tcg
359 # Run check-tcg against linux-user (with plugins)
360 # we skip sparc64-linux-user until it has been fixed somewhat
361 # we skip cris-linux-user as it doesn't use the common run loop
363 <<: *native_build_job_definition
365 IMAGE: debian-all-test-cross
366 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
367 MAKE_CHECK_ARGS: check-tcg
370 build-some-softmmu-plugins:
371 <<: *native_build_job_definition
373 IMAGE: debian-all-test-cross
374 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
375 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
376 MAKE_CHECK_ARGS: check-tcg
379 <<: *native_build_job_definition
382 CONFIGURE_ARGS: --cc=clang --cxx=clang++
383 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
384 ppc-softmmu s390x-softmmu arm-linux-user
385 MAKE_CHECK_ARGS: check
387 # These targets are on the way out
389 <<: *native_build_job_definition
391 IMAGE: debian-all-test-cross
392 CONFIGURE_ARGS: --disable-docs --disable-tools
393 MAKE_CHECK_ARGS: build-tcg
394 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
401 # We split the check-tcg step as test failures are expected but we still
402 # want to catch the build breaking.
404 <<: *native_test_job_definition
406 - job: build-deprecated
409 IMAGE: debian-all-test-cross
410 MAKE_CHECK_ARGS: check-tcg
414 <<: *native_build_job_definition
418 - mkdir build-oss-fuzz
419 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
420 ./scripts/oss-fuzz/build.sh
421 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
422 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
424 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
425 echo Testing ${fuzzer} ... ;
426 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
428 # Unrelated to fuzzer: run some tests with -fsanitize=address
429 - cd build-oss-fuzz && make check-qtest-i386 check-unit
432 <<: *native_build_job_definition
436 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
439 - ../configure --enable-tcg-interpreter
440 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
442 - make run-tcg-tests-x86_64-softmmu
443 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
444 - for tg in $TARGETS ; do
445 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
446 ./tests/qtest/boot-serial-test || exit 1 ;
447 ./tests/qtest/cdrom-test || exit 1 ;
449 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
450 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
452 # Alternate coroutines implementations are only really of interest to KVM users
453 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
454 build-coroutine-ucontext:
455 <<: *native_build_job_definition
458 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
459 MAKE_CHECK_ARGS: check-unit
461 build-coroutine-sigaltstack:
462 <<: *native_build_job_definition
465 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
466 MAKE_CHECK_ARGS: check-unit
468 # Most jobs test latest gcrypt or nettle builds
470 # These jobs test old gcrypt and nettle from RHEL7
471 # which had some API differences.
472 build-crypto-old-nettle:
473 <<: *native_build_job_definition
476 TARGETS: x86_64-softmmu x86_64-linux-user
477 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
478 MAKE_CHECK_ARGS: check-build
483 check-crypto-old-nettle:
484 <<: *native_test_job_definition
486 - job: build-crypto-old-nettle
490 MAKE_CHECK_ARGS: check
493 build-crypto-old-gcrypt:
494 <<: *native_build_job_definition
497 TARGETS: x86_64-softmmu x86_64-linux-user
498 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
499 MAKE_CHECK_ARGS: check-build
504 check-crypto-old-gcrypt:
505 <<: *native_test_job_definition
507 - job: build-crypto-old-gcrypt
511 MAKE_CHECK_ARGS: check
514 build-crypto-only-gnutls:
515 <<: *native_build_job_definition
518 TARGETS: x86_64-softmmu x86_64-linux-user
519 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
520 MAKE_CHECK_ARGS: check-build
525 check-crypto-only-gnutls:
526 <<: *native_test_job_definition
528 - job: build-crypto-only-gnutls
532 MAKE_CHECK_ARGS: check
534 # We don't need to exercise every backend with every front-end
535 build-trace-multi-user:
536 <<: *native_build_job_definition
539 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
541 build-trace-ftrace-system:
542 <<: *native_build_job_definition
545 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
547 build-trace-ust-system:
548 <<: *native_build_job_definition
551 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
553 # Check our reduced build configurations
554 build-without-default-devices:
555 <<: *native_build_job_definition
558 CONFIGURE_ARGS: --without-default-devices --disable-user
560 build-without-default-features:
561 <<: *native_build_job_definition
564 CONFIGURE_ARGS: --without-default-features --disable-user
565 MAKE_CHECK_ARGS: check-unit
569 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
570 script: .gitlab-ci.d/check-patch.py
573 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
580 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
581 script: .gitlab-ci.d/check-dco.py
584 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
590 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
592 - dnf install -y meson ninja-build
594 - mkdir subprojects/libvhost-user/build
595 - cd subprojects/libvhost-user/build
600 image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest
603 - job: build-system-ubuntu
607 - mv build/docs/index.html public/
608 - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done