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
81 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
82 moxie-softmmu microblazeel-softmmu mips64el-softmmu
83 MAKE_CHECK_ARGS: check-build
84 CONFIGURE_ARGS: --enable-docs
88 - .git-submodule-status
92 <<: *native_test_job_definition
94 - job: build-system-alpine
98 MAKE_CHECK_ARGS: check
100 acceptance-system-alpine:
101 <<: *native_test_job_definition
103 - job: build-system-alpine
107 MAKE_CHECK_ARGS: check-acceptance
108 <<: *acceptance_definition
111 <<: *native_build_job_definition
113 job: amd64-ubuntu2004-container
116 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
117 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
118 moxie-softmmu microblazeel-softmmu mips64el-softmmu
119 MAKE_CHECK_ARGS: check-build
126 <<: *native_test_job_definition
128 - job: build-system-ubuntu
132 MAKE_CHECK_ARGS: check
134 acceptance-system-ubuntu:
135 <<: *native_test_job_definition
137 - job: build-system-ubuntu
141 MAKE_CHECK_ARGS: check-acceptance
142 <<: *acceptance_definition
145 <<: *native_build_job_definition
147 job: amd64-debian-container
150 CONFIGURE_ARGS: --enable-fdt=system
151 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
152 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
153 MAKE_CHECK_ARGS: check-build
160 <<: *native_test_job_definition
162 - job: build-system-debian
166 MAKE_CHECK_ARGS: check
168 # No targets are built here, just tools, docs, and unit tests. This
169 # also feeds into the eventual documentation deployment steps later
170 build-tools-and-docs-debian:
171 <<: *native_build_job_definition
174 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
175 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
181 acceptance-system-debian:
182 <<: *native_test_job_definition
184 - job: build-system-debian
188 MAKE_CHECK_ARGS: check-acceptance
189 <<: *acceptance_definition
192 <<: *native_build_job_definition
194 job: amd64-fedora-container
197 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
198 --enable-fdt=system --enable-slirp=system --enable-capstone=system
199 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
200 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
201 MAKE_CHECK_ARGS: check-build
208 <<: *native_test_job_definition
210 - job: build-system-fedora
214 MAKE_CHECK_ARGS: check
216 acceptance-system-fedora:
217 <<: *native_test_job_definition
219 - job: build-system-fedora
223 MAKE_CHECK_ARGS: check-acceptance
224 <<: *acceptance_definition
227 <<: *native_build_job_definition
229 job: amd64-centos8-container
232 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
234 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
235 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
236 MAKE_CHECK_ARGS: check-build
243 <<: *native_test_job_definition
245 - job: build-system-centos
249 MAKE_CHECK_ARGS: check
251 acceptance-system-centos:
252 <<: *native_test_job_definition
254 - job: build-system-centos
258 MAKE_CHECK_ARGS: check-acceptance
259 <<: *acceptance_definition
261 build-system-opensuse:
262 <<: *native_build_job_definition
264 job: amd64-opensuse-leap-container
267 CONFIGURE_ARGS: --enable-fdt=system
268 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
269 MAKE_CHECK_ARGS: check-build
275 check-system-opensuse:
276 <<: *native_test_job_definition
278 - job: build-system-opensuse
282 MAKE_CHECK_ARGS: check
284 acceptance-system-opensuse:
285 <<: *native_test_job_definition
287 - job: build-system-opensuse
291 MAKE_CHECK_ARGS: check-acceptance
292 <<: *acceptance_definition
296 <<: *native_build_job_definition
298 job: amd64-fedora-container
311 --disable-coroutine-pool
320 --disable-guest-agent
331 --disable-live-block-migration
333 --disable-malloc-trim
342 --disable-qom-cast-debug
345 --disable-replication
358 --disable-vhost-crypto
363 --disable-vhost-vsock
364 --disable-virglrenderer
370 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
371 s390x-softmmu i386-linux-user
372 MAKE_CHECK_ARGS: check-qtest SPEED=slow
374 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
375 # the configure script. The container doesn't contain Xen headers so
376 # Xen accelerator is not detected / selected. As result it build the
377 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
380 <<: *native_build_job_definition
382 job: amd64-centos8-container
388 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
391 - make check-qapi-schema
392 - cd tests/qemu-iotests/
393 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
394 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
395 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
396 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
397 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
398 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
399 260 261 262 263 264 270 272 273 277 279
402 <<: *native_build_job_definition
404 job: amd64-debian-user-cross-container
406 IMAGE: debian-all-test-cross
407 CONFIGURE_ARGS: --disable-tools --disable-system
408 MAKE_CHECK_ARGS: check-tcg
411 <<: *native_build_job_definition
413 job: amd64-debian-user-cross-container
415 IMAGE: debian-all-test-cross
416 CONFIGURE_ARGS: --disable-tools --disable-system --static
417 MAKE_CHECK_ARGS: check-tcg
419 # Only build the softmmu targets we have check-tcg tests for
421 <<: *native_build_job_definition
423 job: amd64-debian-user-cross-container
425 IMAGE: debian-all-test-cross
426 CONFIGURE_ARGS: --disable-tools --enable-debug
427 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
428 MAKE_CHECK_ARGS: check-tcg
430 # Run check-tcg against linux-user (with plugins)
431 # we skip sparc64-linux-user until it has been fixed somewhat
432 # we skip cris-linux-user as it doesn't use the common run loop
434 <<: *native_build_job_definition
436 job: amd64-debian-user-cross-container
438 IMAGE: debian-all-test-cross
439 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
440 MAKE_CHECK_ARGS: check-tcg
444 <<: *native_build_job_definition
447 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
448 MAKE_CHECK_ARGS: check-tcg
450 build-some-softmmu-plugins:
451 <<: *native_build_job_definition
453 job: amd64-debian-user-cross-container
455 IMAGE: debian-all-test-cross
456 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
457 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
458 MAKE_CHECK_ARGS: check-tcg
461 <<: *native_build_job_definition
463 job: amd64-fedora-container
466 CONFIGURE_ARGS: --cc=clang --cxx=clang++
467 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
468 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
469 ppc-softmmu s390x-softmmu
470 MAKE_CHECK_ARGS: check-qtest check-tcg
473 <<: *native_build_job_definition
475 IMAGE: debian-all-test-cross
476 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
477 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
478 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
479 MAKE_CHECK_ARGS: check-unit check-tcg
482 <<: *native_build_job_definition
485 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
486 --enable-fdt=system --enable-slirp=system
487 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
488 MAKE_CHECK_ARGS: bench V=1
490 # These targets are on the way out
492 <<: *native_build_job_definition
494 job: amd64-debian-user-cross-container
496 IMAGE: debian-all-test-cross
497 CONFIGURE_ARGS: --disable-docs --disable-tools
498 MAKE_CHECK_ARGS: build-tcg
499 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
506 # We split the check-tcg step as test failures are expected but we still
507 # want to catch the build breaking.
509 <<: *native_test_job_definition
511 - job: build-deprecated
514 IMAGE: debian-all-test-cross
515 MAKE_CHECK_ARGS: check-tcg
518 # gprof/gcov are GCC features
520 <<: *native_build_job_definition
523 CONFIGURE_ARGS: --enable-gprof --enable-gcov
524 MAKE_CHECK_ARGS: check
525 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
528 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
531 <<: *native_build_job_definition
533 job: amd64-fedora-container
537 - mkdir build-oss-fuzz
538 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
539 ./scripts/oss-fuzz/build.sh
540 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
541 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
543 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
544 echo Testing ${fuzzer} ... ;
545 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
547 # Unrelated to fuzzer: run some tests with -fsanitize=address
548 - cd build-oss-fuzz && make check-qtest-i386 check-unit
551 <<: *native_build_job_definition
553 job: amd64-fedora-container
557 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
560 - ../configure --enable-tcg-interpreter
561 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
563 - make run-tcg-tests-x86_64-softmmu
564 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
565 - for tg in $TARGETS ; do
566 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
567 ./tests/qtest/boot-serial-test || exit 1 ;
568 ./tests/qtest/cdrom-test || exit 1 ;
570 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
571 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
573 # Alternate coroutines implementations are only really of interest to KVM users
574 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
575 build-coroutine-ucontext:
576 <<: *native_build_job_definition
578 job: amd64-ubuntu2004-container
581 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
582 MAKE_CHECK_ARGS: check-unit
584 build-coroutine-sigaltstack:
585 <<: *native_build_job_definition
587 job: amd64-ubuntu2004-container
590 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
591 MAKE_CHECK_ARGS: check-unit
593 # Most jobs test latest gcrypt or nettle builds
595 # These jobs test old gcrypt and nettle from RHEL7
596 # which had some API differences.
597 build-crypto-old-nettle:
598 <<: *native_build_job_definition
600 job: amd64-centos7-container
603 TARGETS: x86_64-softmmu x86_64-linux-user
604 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
605 MAKE_CHECK_ARGS: check-build
610 check-crypto-old-nettle:
611 <<: *native_test_job_definition
613 - job: build-crypto-old-nettle
617 MAKE_CHECK_ARGS: check
620 build-crypto-old-gcrypt:
621 <<: *native_build_job_definition
623 job: amd64-centos7-container
626 TARGETS: x86_64-softmmu x86_64-linux-user
627 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
628 MAKE_CHECK_ARGS: check-build
633 check-crypto-old-gcrypt:
634 <<: *native_test_job_definition
636 - job: build-crypto-old-gcrypt
640 MAKE_CHECK_ARGS: check
643 build-crypto-only-gnutls:
644 <<: *native_build_job_definition
646 job: amd64-centos7-container
649 TARGETS: x86_64-softmmu x86_64-linux-user
650 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
651 MAKE_CHECK_ARGS: check-build
656 check-crypto-only-gnutls:
657 <<: *native_test_job_definition
659 - job: build-crypto-only-gnutls
663 MAKE_CHECK_ARGS: check
665 # We don't need to exercise every backend with every front-end
666 build-trace-multi-user:
667 <<: *native_build_job_definition
669 job: amd64-ubuntu2004-container
672 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
674 build-trace-ftrace-system:
675 <<: *native_build_job_definition
677 job: amd64-ubuntu2004-container
680 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
682 build-trace-ust-system:
683 <<: *native_build_job_definition
685 job: amd64-ubuntu2004-container
688 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
690 # Check our reduced build configurations
691 build-without-default-devices:
692 <<: *native_build_job_definition
694 job: amd64-centos8-container
697 CONFIGURE_ARGS: --without-default-devices --disable-user
699 build-without-default-features:
700 <<: *native_build_job_definition
702 job: amd64-debian-container
705 CONFIGURE_ARGS: --without-default-features --disable-user
706 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
707 MAKE_CHECK_ARGS: check-unit
711 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
713 job: amd64-centos8-container
714 script: .gitlab-ci.d/check-patch.py
717 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
724 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
726 job: amd64-centos8-container
727 script: .gitlab-ci.d/check-dco.py
730 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
736 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
738 job: amd64-fedora-container
740 - dnf install -y meson ninja-build
742 - mkdir subprojects/libvhost-user/build
743 - cd subprojects/libvhost-user/build
747 # Prepare for GitLab pages deployment. Anything copied into the
748 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
750 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
753 - job: build-tools-and-docs-debian
756 # HTML-ised source tree
758 - htags -anT --tree-view=filetree -m qemu_init
759 -t "Welcome to the QEMU sourcecode"
761 # Project documentation
762 - make -C build install DESTDIR=$(pwd)/temp-install
763 - mv temp-install/usr/local/share/doc/qemu/* public/