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"]'
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
114 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
115 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
116 moxie-softmmu microblazeel-softmmu mips64el-softmmu
117 MAKE_CHECK_ARGS: check-build
124 <<: *native_test_job_definition
126 - job: build-system-ubuntu
130 MAKE_CHECK_ARGS: check
132 acceptance-system-ubuntu:
133 <<: *native_test_job_definition
135 - job: build-system-ubuntu
139 MAKE_CHECK_ARGS: check-acceptance
140 <<: *acceptance_definition
143 <<: *native_build_job_definition
146 CONFIGURE_ARGS: --enable-fdt=system
147 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
148 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
149 MAKE_CHECK_ARGS: check-build
156 <<: *native_test_job_definition
158 - job: build-system-debian
162 MAKE_CHECK_ARGS: check
164 # No targets are built here, just tools, docs, and unit tests. This
165 # also feeds into the eventual documentation deployment steps later
166 build-tools-and-docs-debian:
167 <<: *native_build_job_definition
170 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
171 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
177 acceptance-system-debian:
178 <<: *native_test_job_definition
180 - job: build-system-debian
184 MAKE_CHECK_ARGS: check-acceptance
185 <<: *acceptance_definition
188 <<: *native_build_job_definition
191 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
192 --enable-fdt=system --enable-slirp=system --enable-capstone=system
193 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
194 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
195 MAKE_CHECK_ARGS: check-build
202 <<: *native_test_job_definition
204 - job: build-system-fedora
208 MAKE_CHECK_ARGS: check
210 acceptance-system-fedora:
211 <<: *native_test_job_definition
213 - job: build-system-fedora
217 MAKE_CHECK_ARGS: check-acceptance
218 <<: *acceptance_definition
221 <<: *native_build_job_definition
224 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
226 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
227 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
228 MAKE_CHECK_ARGS: check-build
235 <<: *native_test_job_definition
237 - job: build-system-centos
241 MAKE_CHECK_ARGS: check
243 acceptance-system-centos:
244 <<: *native_test_job_definition
246 - job: build-system-centos
250 MAKE_CHECK_ARGS: check-acceptance
251 <<: *acceptance_definition
253 build-system-opensuse:
254 <<: *native_build_job_definition
257 CONFIGURE_ARGS: --enable-fdt=system
258 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
259 MAKE_CHECK_ARGS: check-build
265 check-system-opensuse:
266 <<: *native_test_job_definition
268 - job: build-system-opensuse
272 MAKE_CHECK_ARGS: check
274 acceptance-system-opensuse:
275 <<: *native_test_job_definition
277 - job: build-system-opensuse
281 MAKE_CHECK_ARGS: check-acceptance
282 <<: *acceptance_definition
286 <<: *native_build_job_definition
299 --disable-coroutine-pool
308 --disable-guest-agent
319 --disable-live-block-migration
321 --disable-malloc-trim
330 --disable-qom-cast-debug
333 --disable-replication
346 --disable-vhost-crypto
351 --disable-vhost-vsock
352 --disable-virglrenderer
358 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
359 s390x-softmmu i386-linux-user
360 MAKE_CHECK_ARGS: check-qtest SPEED=slow
362 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
363 # the configure script. The container doesn't contain Xen headers so
364 # Xen accelerator is not detected / selected. As result it build the
365 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
368 <<: *native_build_job_definition
374 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
377 - make check-qapi-schema
378 - cd tests/qemu-iotests/
379 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
380 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
381 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
382 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
383 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
384 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
385 260 261 262 263 264 270 272 273 277 279
388 <<: *native_build_job_definition
390 IMAGE: debian-all-test-cross
391 CONFIGURE_ARGS: --disable-tools --disable-system
392 MAKE_CHECK_ARGS: check-tcg
395 <<: *native_build_job_definition
397 IMAGE: debian-all-test-cross
398 CONFIGURE_ARGS: --disable-tools --disable-system --static
399 MAKE_CHECK_ARGS: check-tcg
401 # Only build the softmmu targets we have check-tcg tests for
403 <<: *native_build_job_definition
405 IMAGE: debian-all-test-cross
406 CONFIGURE_ARGS: --disable-tools --enable-debug
407 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
408 MAKE_CHECK_ARGS: check-tcg
410 # Run check-tcg against linux-user (with plugins)
411 # we skip sparc64-linux-user until it has been fixed somewhat
412 # we skip cris-linux-user as it doesn't use the common run loop
414 <<: *native_build_job_definition
416 IMAGE: debian-all-test-cross
417 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
418 MAKE_CHECK_ARGS: check-tcg
422 <<: *native_build_job_definition
425 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
426 MAKE_CHECK_ARGS: check-tcg
428 build-some-softmmu-plugins:
429 <<: *native_build_job_definition
431 IMAGE: debian-all-test-cross
432 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
433 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
434 MAKE_CHECK_ARGS: check-tcg
437 <<: *native_build_job_definition
440 CONFIGURE_ARGS: --cc=clang --cxx=clang++
441 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
442 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
443 ppc-softmmu s390x-softmmu
444 MAKE_CHECK_ARGS: check-qtest check-tcg
447 <<: *native_build_job_definition
449 IMAGE: debian-all-test-cross
450 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
451 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
452 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
453 MAKE_CHECK_ARGS: check-unit check-tcg
456 <<: *native_build_job_definition
459 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
460 --enable-fdt=system --enable-slirp=system
461 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
462 MAKE_CHECK_ARGS: bench V=1
464 # These targets are on the way out
466 <<: *native_build_job_definition
468 IMAGE: debian-all-test-cross
469 CONFIGURE_ARGS: --disable-docs --disable-tools
470 MAKE_CHECK_ARGS: build-tcg
471 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
478 # We split the check-tcg step as test failures are expected but we still
479 # want to catch the build breaking.
481 <<: *native_test_job_definition
483 - job: build-deprecated
486 IMAGE: debian-all-test-cross
487 MAKE_CHECK_ARGS: check-tcg
490 # gprof/gcov are GCC features
492 <<: *native_build_job_definition
495 CONFIGURE_ARGS: --enable-gprof --enable-gcov
496 MAKE_CHECK_ARGS: check
497 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
500 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
503 <<: *native_build_job_definition
507 - mkdir build-oss-fuzz
508 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
509 ./scripts/oss-fuzz/build.sh
510 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
511 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
513 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
514 echo Testing ${fuzzer} ... ;
515 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
517 # Unrelated to fuzzer: run some tests with -fsanitize=address
518 - cd build-oss-fuzz && make check-qtest-i386 check-unit
521 <<: *native_build_job_definition
525 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
528 - ../configure --enable-tcg-interpreter
529 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
531 - make run-tcg-tests-x86_64-softmmu
532 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
533 - for tg in $TARGETS ; do
534 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
535 ./tests/qtest/boot-serial-test || exit 1 ;
536 ./tests/qtest/cdrom-test || exit 1 ;
538 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
539 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
541 # Alternate coroutines implementations are only really of interest to KVM users
542 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
543 build-coroutine-ucontext:
544 <<: *native_build_job_definition
547 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
548 MAKE_CHECK_ARGS: check-unit
550 build-coroutine-sigaltstack:
551 <<: *native_build_job_definition
554 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
555 MAKE_CHECK_ARGS: check-unit
557 # Most jobs test latest gcrypt or nettle builds
559 # These jobs test old gcrypt and nettle from RHEL7
560 # which had some API differences.
561 build-crypto-old-nettle:
562 <<: *native_build_job_definition
565 TARGETS: x86_64-softmmu x86_64-linux-user
566 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
567 MAKE_CHECK_ARGS: check-build
572 check-crypto-old-nettle:
573 <<: *native_test_job_definition
575 - job: build-crypto-old-nettle
579 MAKE_CHECK_ARGS: check
582 build-crypto-old-gcrypt:
583 <<: *native_build_job_definition
586 TARGETS: x86_64-softmmu x86_64-linux-user
587 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
588 MAKE_CHECK_ARGS: check-build
593 check-crypto-old-gcrypt:
594 <<: *native_test_job_definition
596 - job: build-crypto-old-gcrypt
600 MAKE_CHECK_ARGS: check
603 build-crypto-only-gnutls:
604 <<: *native_build_job_definition
607 TARGETS: x86_64-softmmu x86_64-linux-user
608 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
609 MAKE_CHECK_ARGS: check-build
614 check-crypto-only-gnutls:
615 <<: *native_test_job_definition
617 - job: build-crypto-only-gnutls
621 MAKE_CHECK_ARGS: check
623 # We don't need to exercise every backend with every front-end
624 build-trace-multi-user:
625 <<: *native_build_job_definition
628 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
630 build-trace-ftrace-system:
631 <<: *native_build_job_definition
634 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
636 build-trace-ust-system:
637 <<: *native_build_job_definition
640 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
642 # Check our reduced build configurations
643 build-without-default-devices:
644 <<: *native_build_job_definition
647 CONFIGURE_ARGS: --without-default-devices --disable-user
649 build-without-default-features:
650 <<: *native_build_job_definition
653 CONFIGURE_ARGS: --without-default-features --disable-user
654 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
655 MAKE_CHECK_ARGS: check-unit
659 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
660 script: .gitlab-ci.d/check-patch.py
663 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
670 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
671 script: .gitlab-ci.d/check-dco.py
674 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
680 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
682 - dnf install -y meson ninja-build
684 - mkdir subprojects/libvhost-user/build
685 - cd subprojects/libvhost-user/build
689 # Prepare for GitLab pages deployment. Anything copied into the
690 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
692 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
695 - job: build-tools-and-docs-debian
698 # HTML-ised source tree
700 - htags -anT --tree-view=filetree -m qemu_init
701 -t "Welcome to the QEMU sourcecode"
703 # Project documentation
704 - make -C build install DESTDIR=$(pwd)/temp-install
705 - mv temp-install/usr/local/share/doc/qemu/* public/