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)
24 - if test -n "$TARGETS";
26 ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
28 ../configure --enable-werror $CONFIGURE_ARGS ;
29 fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
31 - if test -n "$MAKE_CHECK_ARGS";
33 make -j"$JOBS" $MAKE_CHECK_ARGS ;
36 .native_test_job_template: &native_test_job_definition
38 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
40 - scripts/git-submodule.sh update
41 $(grep GIT_SUBMODULES build/config-host.mak | sed 's/GIT_SUBMODULES=//')
43 - find . -type f -exec touch {} +
44 # Avoid recompiling by hiding ninja with NINJA=":"
45 - make NINJA=":" $MAKE_CHECK_ARGS
47 .acceptance_template: &acceptance_definition
49 key: "${CI_JOB_NAME}-cache"
51 - ${CI_PROJECT_DIR}/avocado-cache
54 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
58 - build/tests/results/latest/results.xml
59 - build/tests/results/latest/test-results
61 junit: build/tests/results/latest/results.xml
63 - mkdir -p ~/.config/avocado
64 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
65 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
66 >> ~/.config/avocado/avocado.conf
67 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
68 >> ~/.config/avocado/avocado.conf
69 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
70 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
72 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
75 - du -chs ${CI_PROJECT_DIR}/avocado-cache
78 <<: *native_build_job_definition
80 - job: amd64-alpine-container
83 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
84 moxie-softmmu microblazeel-softmmu mips64el-softmmu
85 MAKE_CHECK_ARGS: check-build
86 CONFIGURE_ARGS: --enable-docs
90 - .git-submodule-status
94 <<: *native_test_job_definition
96 - job: build-system-alpine
100 MAKE_CHECK_ARGS: check
102 acceptance-system-alpine:
103 <<: *native_test_job_definition
105 - job: build-system-alpine
109 MAKE_CHECK_ARGS: check-acceptance
110 <<: *acceptance_definition
113 <<: *native_build_job_definition
115 job: amd64-ubuntu2004-container
118 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
119 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
120 moxie-softmmu microblazeel-softmmu mips64el-softmmu
121 MAKE_CHECK_ARGS: check-build
128 <<: *native_test_job_definition
130 - job: build-system-ubuntu
134 MAKE_CHECK_ARGS: check
136 acceptance-system-ubuntu:
137 <<: *native_test_job_definition
139 - job: build-system-ubuntu
143 MAKE_CHECK_ARGS: check-acceptance
144 <<: *acceptance_definition
147 <<: *native_build_job_definition
149 job: amd64-debian-container
152 CONFIGURE_ARGS: --enable-fdt=system
153 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
154 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
155 MAKE_CHECK_ARGS: check-build
162 <<: *native_test_job_definition
164 - job: build-system-debian
168 MAKE_CHECK_ARGS: check
170 acceptance-system-debian:
171 <<: *native_test_job_definition
173 - job: build-system-debian
177 MAKE_CHECK_ARGS: check-acceptance
178 <<: *acceptance_definition
181 <<: *native_build_job_definition
183 job: amd64-fedora-container
186 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
187 --enable-fdt=system --enable-slirp=system --enable-capstone=system
188 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
189 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
190 MAKE_CHECK_ARGS: check-build
197 <<: *native_test_job_definition
199 - job: build-system-fedora
203 MAKE_CHECK_ARGS: check
205 acceptance-system-fedora:
206 <<: *native_test_job_definition
208 - job: build-system-fedora
212 MAKE_CHECK_ARGS: check-acceptance
213 <<: *acceptance_definition
216 <<: *native_build_job_definition
218 job: amd64-centos8-container
221 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
223 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
224 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
225 MAKE_CHECK_ARGS: check-build
232 <<: *native_test_job_definition
234 - job: build-system-centos
238 MAKE_CHECK_ARGS: check
240 acceptance-system-centos:
241 <<: *native_test_job_definition
243 - job: build-system-centos
247 MAKE_CHECK_ARGS: check-acceptance
248 <<: *acceptance_definition
250 build-system-opensuse:
251 <<: *native_build_job_definition
253 job: amd64-opensuse-leap-container
256 CONFIGURE_ARGS: --enable-fdt=system
257 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
258 MAKE_CHECK_ARGS: check-build
264 check-system-opensuse:
265 <<: *native_test_job_definition
267 - job: build-system-opensuse
271 MAKE_CHECK_ARGS: check
273 acceptance-system-opensuse:
274 <<: *native_test_job_definition
276 - job: build-system-opensuse
280 MAKE_CHECK_ARGS: check-acceptance
281 <<: *acceptance_definition
285 <<: *native_build_job_definition
287 job: amd64-fedora-container
300 --disable-coroutine-pool
309 --disable-guest-agent
320 --disable-live-block-migration
322 --disable-malloc-trim
331 --disable-qom-cast-debug
334 --disable-replication
347 --disable-vhost-crypto
350 --disable-vhost-kernel
353 --disable-vhost-vsock
354 --disable-virglrenderer
360 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
361 s390x-softmmu i386-linux-user
362 MAKE_CHECK_ARGS: check-qtest SPEED=slow
364 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
365 # the configure script. The container doesn't contain Xen headers so
366 # Xen accelerator is not detected / selected. As result it build the
367 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
370 <<: *native_build_job_definition
372 job: amd64-centos8-container
378 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
381 - make check-qapi-schema
382 - cd tests/qemu-iotests/
383 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
384 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
385 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
386 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
387 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
388 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
389 260 261 262 263 264 270 272 273 277 279
392 <<: *native_build_job_definition
394 job: amd64-debian-user-cross-container
396 IMAGE: debian-all-test-cross
397 CONFIGURE_ARGS: --disable-tools --disable-system
398 MAKE_CHECK_ARGS: check-tcg
401 <<: *native_build_job_definition
403 job: amd64-debian-user-cross-container
405 IMAGE: debian-all-test-cross
406 CONFIGURE_ARGS: --disable-tools --disable-system --static
407 MAKE_CHECK_ARGS: check-tcg
409 # Only build the softmmu targets we have check-tcg tests for
411 <<: *native_build_job_definition
413 job: amd64-debian-user-cross-container
415 IMAGE: debian-all-test-cross
416 CONFIGURE_ARGS: --disable-tools --enable-debug
417 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
418 MAKE_CHECK_ARGS: check-tcg
420 # Run check-tcg against linux-user (with plugins)
421 # we skip sparc64-linux-user until it has been fixed somewhat
422 # we skip cris-linux-user as it doesn't use the common run loop
424 <<: *native_build_job_definition
426 job: amd64-debian-user-cross-container
428 IMAGE: debian-all-test-cross
429 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
430 MAKE_CHECK_ARGS: check-tcg
434 <<: *native_build_job_definition
436 job: amd64-centos7-container
439 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
440 MAKE_CHECK_ARGS: check-tcg
442 build-some-softmmu-plugins:
443 <<: *native_build_job_definition
445 job: amd64-debian-user-cross-container
447 IMAGE: debian-all-test-cross
448 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
449 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
450 MAKE_CHECK_ARGS: check-tcg
453 <<: *native_build_job_definition
455 job: amd64-fedora-container
458 CONFIGURE_ARGS: --cc=clang --cxx=clang++
459 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
460 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
461 ppc-softmmu s390x-softmmu
462 MAKE_CHECK_ARGS: check-qtest check-tcg
465 <<: *native_build_job_definition
467 job: amd64-debian-user-cross-container
469 IMAGE: debian-all-test-cross
470 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
471 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
472 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
473 MAKE_CHECK_ARGS: check-unit check-tcg
476 <<: *native_build_job_definition
478 job: amd64-ubuntu2004-container
481 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
482 --enable-fdt=system --enable-slirp=system
483 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
484 MAKE_CHECK_ARGS: bench V=1
486 # These targets are on the way out
488 <<: *native_build_job_definition
490 job: amd64-debian-user-cross-container
492 IMAGE: debian-all-test-cross
493 CONFIGURE_ARGS: --disable-docs --disable-tools
494 MAKE_CHECK_ARGS: build-tcg
495 TARGETS: ppc64abi32-linux-user lm32-softmmu unicore32-softmmu
501 # We split the check-tcg step as test failures are expected but we still
502 # want to catch the build breaking.
504 <<: *native_test_job_definition
506 - job: build-deprecated
509 IMAGE: debian-all-test-cross
510 MAKE_CHECK_ARGS: check-tcg
513 # gprof/gcov are GCC features
515 <<: *native_build_job_definition
517 job: amd64-ubuntu2004-container
520 CONFIGURE_ARGS: --enable-gprof --enable-gcov
521 MAKE_CHECK_ARGS: check
522 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
525 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
528 <<: *native_build_job_definition
530 job: amd64-fedora-container
534 - mkdir build-oss-fuzz
535 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
536 ./scripts/oss-fuzz/build.sh
537 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
538 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
540 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
541 echo Testing ${fuzzer} ... ;
542 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
544 # Unrelated to fuzzer: run some tests with -fsanitize=address
545 - cd build-oss-fuzz && make check-qtest-i386 check-unit
548 <<: *native_build_job_definition
550 job: amd64-debian-user-cross-container
552 IMAGE: debian-all-test-cross
554 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
557 - ../configure --enable-tcg-interpreter
558 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
560 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
561 - for tg in $TARGETS ; do
562 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
563 ./tests/qtest/boot-serial-test || exit 1 ;
564 ./tests/qtest/cdrom-test || exit 1 ;
566 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
567 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
570 # Alternate coroutines implementations are only really of interest to KVM users
571 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
572 build-coroutine-ucontext:
573 <<: *native_build_job_definition
575 job: amd64-ubuntu2004-container
578 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
579 MAKE_CHECK_ARGS: check-unit
581 build-coroutine-sigaltstack:
582 <<: *native_build_job_definition
584 job: amd64-ubuntu2004-container
587 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
588 MAKE_CHECK_ARGS: check-unit
590 # Most jobs test latest gcrypt or nettle builds
592 # These jobs test old gcrypt and nettle from RHEL7
593 # which had some API differences.
594 build-crypto-old-nettle:
595 <<: *native_build_job_definition
597 job: amd64-centos7-container
600 TARGETS: x86_64-softmmu x86_64-linux-user
601 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
602 MAKE_CHECK_ARGS: check-build
607 check-crypto-old-nettle:
608 <<: *native_test_job_definition
610 - job: build-crypto-old-nettle
614 MAKE_CHECK_ARGS: check
617 build-crypto-old-gcrypt:
618 <<: *native_build_job_definition
620 job: amd64-centos7-container
623 TARGETS: x86_64-softmmu x86_64-linux-user
624 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
625 MAKE_CHECK_ARGS: check-build
630 check-crypto-old-gcrypt:
631 <<: *native_test_job_definition
633 - job: build-crypto-old-gcrypt
637 MAKE_CHECK_ARGS: check
640 build-crypto-only-gnutls:
641 <<: *native_build_job_definition
643 job: amd64-centos7-container
646 TARGETS: x86_64-softmmu x86_64-linux-user
647 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
648 MAKE_CHECK_ARGS: check-build
653 check-crypto-only-gnutls:
654 <<: *native_test_job_definition
656 - job: build-crypto-only-gnutls
660 MAKE_CHECK_ARGS: check
662 # We don't need to exercise every backend with every front-end
663 build-trace-multi-user:
664 <<: *native_build_job_definition
666 job: amd64-ubuntu2004-container
669 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
671 build-trace-ftrace-system:
672 <<: *native_build_job_definition
674 job: amd64-ubuntu2004-container
677 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
679 build-trace-ust-system:
680 <<: *native_build_job_definition
682 job: amd64-ubuntu2004-container
685 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
687 # Check our reduced build configurations
688 build-without-default-devices:
689 <<: *native_build_job_definition
691 job: amd64-centos8-container
694 CONFIGURE_ARGS: --without-default-devices --disable-user
696 build-without-default-features:
697 <<: *native_build_job_definition
699 job: amd64-debian-container
702 CONFIGURE_ARGS: --without-default-features --disable-user
703 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
704 MAKE_CHECK_ARGS: check-unit
708 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
710 job: amd64-centos8-container
711 script: .gitlab-ci.d/check-patch.py
714 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
721 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
723 job: amd64-centos8-container
724 script: .gitlab-ci.d/check-dco.py
727 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
733 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
735 job: amd64-fedora-container
737 - dnf install -y meson ninja-build
739 - mkdir subprojects/libvhost-user/build
740 - cd subprojects/libvhost-user/build
744 # No targets are built here, just tools, docs, and unit tests. This
745 # also feeds into the eventual documentation deployment steps later
746 build-tools-and-docs-debian:
747 <<: *native_build_job_definition
749 job: amd64-debian-container
752 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
753 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
759 # Prepare for GitLab pages deployment. Anything copied into the
760 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
762 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
765 - job: build-tools-and-docs-debian
768 # HTML-ised source tree
770 - htags -anT --tree-view=filetree -m qemu_init
771 -t "Welcome to the QEMU sourcecode"
773 # Project documentation
774 - make -C build install DESTDIR=$(pwd)/temp-install
775 - mv temp-install/usr/local/share/doc/qemu/* public/