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
361 --disable-vhost-kernel
364 --disable-vhost-vsock
365 --disable-virglrenderer
371 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
372 s390x-softmmu i386-linux-user
373 MAKE_CHECK_ARGS: check-qtest SPEED=slow
375 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
376 # the configure script. The container doesn't contain Xen headers so
377 # Xen accelerator is not detected / selected. As result it build the
378 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
381 <<: *native_build_job_definition
383 job: amd64-centos8-container
389 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
392 - make check-qapi-schema
393 - cd tests/qemu-iotests/
394 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
395 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
396 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
397 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
398 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
399 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
400 260 261 262 263 264 270 272 273 277 279
403 <<: *native_build_job_definition
405 job: amd64-debian-user-cross-container
407 IMAGE: debian-all-test-cross
408 CONFIGURE_ARGS: --disable-tools --disable-system
409 MAKE_CHECK_ARGS: check-tcg
412 <<: *native_build_job_definition
414 job: amd64-debian-user-cross-container
416 IMAGE: debian-all-test-cross
417 CONFIGURE_ARGS: --disable-tools --disable-system --static
418 MAKE_CHECK_ARGS: check-tcg
420 # Only build the softmmu targets we have check-tcg tests for
422 <<: *native_build_job_definition
424 job: amd64-debian-user-cross-container
426 IMAGE: debian-all-test-cross
427 CONFIGURE_ARGS: --disable-tools --enable-debug
428 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
429 MAKE_CHECK_ARGS: check-tcg
431 # Run check-tcg against linux-user (with plugins)
432 # we skip sparc64-linux-user until it has been fixed somewhat
433 # we skip cris-linux-user as it doesn't use the common run loop
435 <<: *native_build_job_definition
437 job: amd64-debian-user-cross-container
439 IMAGE: debian-all-test-cross
440 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
441 MAKE_CHECK_ARGS: check-tcg
445 <<: *native_build_job_definition
448 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
449 MAKE_CHECK_ARGS: check-tcg
451 build-some-softmmu-plugins:
452 <<: *native_build_job_definition
454 job: amd64-debian-user-cross-container
456 IMAGE: debian-all-test-cross
457 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
458 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
459 MAKE_CHECK_ARGS: check-tcg
462 <<: *native_build_job_definition
464 job: amd64-fedora-container
467 CONFIGURE_ARGS: --cc=clang --cxx=clang++
468 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
469 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
470 ppc-softmmu s390x-softmmu
471 MAKE_CHECK_ARGS: check-qtest check-tcg
474 <<: *native_build_job_definition
476 IMAGE: debian-all-test-cross
477 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
478 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
479 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
480 MAKE_CHECK_ARGS: check-unit check-tcg
483 <<: *native_build_job_definition
486 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
487 --enable-fdt=system --enable-slirp=system
488 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
489 MAKE_CHECK_ARGS: bench V=1
491 # These targets are on the way out
493 <<: *native_build_job_definition
495 job: amd64-debian-user-cross-container
497 IMAGE: debian-all-test-cross
498 CONFIGURE_ARGS: --disable-docs --disable-tools
499 MAKE_CHECK_ARGS: build-tcg
500 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
507 # We split the check-tcg step as test failures are expected but we still
508 # want to catch the build breaking.
510 <<: *native_test_job_definition
512 - job: build-deprecated
515 IMAGE: debian-all-test-cross
516 MAKE_CHECK_ARGS: check-tcg
519 # gprof/gcov are GCC features
521 <<: *native_build_job_definition
524 CONFIGURE_ARGS: --enable-gprof --enable-gcov
525 MAKE_CHECK_ARGS: check
526 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
529 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
532 <<: *native_build_job_definition
534 job: amd64-fedora-container
538 - mkdir build-oss-fuzz
539 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
540 ./scripts/oss-fuzz/build.sh
541 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
542 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
544 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
545 echo Testing ${fuzzer} ... ;
546 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
548 # Unrelated to fuzzer: run some tests with -fsanitize=address
549 - cd build-oss-fuzz && make check-qtest-i386 check-unit
552 <<: *native_build_job_definition
554 job: amd64-debian-user-cross-container
556 IMAGE: debian-all-test-cross
558 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
561 - ../configure --enable-tcg-interpreter
562 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
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
574 # Alternate coroutines implementations are only really of interest to KVM users
575 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
576 build-coroutine-ucontext:
577 <<: *native_build_job_definition
579 job: amd64-ubuntu2004-container
582 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
583 MAKE_CHECK_ARGS: check-unit
585 build-coroutine-sigaltstack:
586 <<: *native_build_job_definition
588 job: amd64-ubuntu2004-container
591 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
592 MAKE_CHECK_ARGS: check-unit
594 # Most jobs test latest gcrypt or nettle builds
596 # These jobs test old gcrypt and nettle from RHEL7
597 # which had some API differences.
598 build-crypto-old-nettle:
599 <<: *native_build_job_definition
601 job: amd64-centos7-container
604 TARGETS: x86_64-softmmu x86_64-linux-user
605 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
606 MAKE_CHECK_ARGS: check-build
611 check-crypto-old-nettle:
612 <<: *native_test_job_definition
614 - job: build-crypto-old-nettle
618 MAKE_CHECK_ARGS: check
621 build-crypto-old-gcrypt:
622 <<: *native_build_job_definition
624 job: amd64-centos7-container
627 TARGETS: x86_64-softmmu x86_64-linux-user
628 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
629 MAKE_CHECK_ARGS: check-build
634 check-crypto-old-gcrypt:
635 <<: *native_test_job_definition
637 - job: build-crypto-old-gcrypt
641 MAKE_CHECK_ARGS: check
644 build-crypto-only-gnutls:
645 <<: *native_build_job_definition
647 job: amd64-centos7-container
650 TARGETS: x86_64-softmmu x86_64-linux-user
651 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
652 MAKE_CHECK_ARGS: check-build
657 check-crypto-only-gnutls:
658 <<: *native_test_job_definition
660 - job: build-crypto-only-gnutls
664 MAKE_CHECK_ARGS: check
666 # We don't need to exercise every backend with every front-end
667 build-trace-multi-user:
668 <<: *native_build_job_definition
670 job: amd64-ubuntu2004-container
673 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
675 build-trace-ftrace-system:
676 <<: *native_build_job_definition
678 job: amd64-ubuntu2004-container
681 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
683 build-trace-ust-system:
684 <<: *native_build_job_definition
686 job: amd64-ubuntu2004-container
689 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
691 # Check our reduced build configurations
692 build-without-default-devices:
693 <<: *native_build_job_definition
695 job: amd64-centos8-container
698 CONFIGURE_ARGS: --without-default-devices --disable-user
700 build-without-default-features:
701 <<: *native_build_job_definition
703 job: amd64-debian-container
706 CONFIGURE_ARGS: --without-default-features --disable-user
707 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
708 MAKE_CHECK_ARGS: check-unit
712 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
714 job: amd64-centos8-container
715 script: .gitlab-ci.d/check-patch.py
718 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
725 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
727 job: amd64-centos8-container
728 script: .gitlab-ci.d/check-dco.py
731 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
737 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
739 job: amd64-fedora-container
741 - dnf install -y meson ninja-build
743 - mkdir subprojects/libvhost-user/build
744 - cd subprojects/libvhost-user/build
748 # Prepare for GitLab pages deployment. Anything copied into the
749 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
751 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
754 - job: build-tools-and-docs-debian
757 # HTML-ised source tree
759 - htags -anT --tree-view=filetree -m qemu_init
760 -t "Welcome to the QEMU sourcecode"
762 # Project documentation
763 - make -C build install DESTDIR=$(pwd)/temp-install
764 - mv temp-install/usr/local/share/doc/qemu/* public/