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
41 - scripts/git-submodule.sh update
42 $(grep GIT_SUBMODULES build/config-host.mak | sed 's/GIT_SUBMODULES=//')
44 - find . -type f -exec touch {} +
45 # Avoid recompiling by hiding ninja with NINJA=":"
46 - make NINJA=":" $MAKE_CHECK_ARGS
48 .acceptance_template: &acceptance_definition
50 key: "${CI_JOB_NAME}-cache"
52 - ${CI_PROJECT_DIR}/avocado-cache
55 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
59 - build/tests/results/latest/results.xml
60 - build/tests/results/latest/test-results
62 junit: build/tests/results/latest/results.xml
64 - mkdir -p ~/.config/avocado
65 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
66 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
67 >> ~/.config/avocado/avocado.conf
68 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL"]'
69 >> ~/.config/avocado/avocado.conf
70 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
71 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
73 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
76 - du -chs ${CI_PROJECT_DIR}/avocado-cache
79 <<: *native_build_job_definition
82 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
83 moxie-softmmu microblazeel-softmmu mips64el-softmmu
84 MAKE_CHECK_ARGS: check-build
85 CONFIGURE_ARGS: --enable-docs
89 - .git-submodule-status
93 <<: *native_test_job_definition
95 - job: build-system-alpine
99 MAKE_CHECK_ARGS: check
101 acceptance-system-alpine:
102 <<: *native_test_job_definition
104 - job: build-system-alpine
108 MAKE_CHECK_ARGS: check-acceptance
109 <<: *acceptance_definition
112 <<: *native_build_job_definition
115 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
116 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
117 moxie-softmmu microblazeel-softmmu mips64el-softmmu
118 MAKE_CHECK_ARGS: check-build
125 <<: *native_test_job_definition
127 - job: build-system-ubuntu
131 MAKE_CHECK_ARGS: check
133 acceptance-system-ubuntu:
134 <<: *native_test_job_definition
136 - job: build-system-ubuntu
140 MAKE_CHECK_ARGS: check-acceptance
141 <<: *acceptance_definition
144 <<: *native_build_job_definition
147 CONFIGURE_ARGS: --enable-fdt=system
148 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
149 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
150 MAKE_CHECK_ARGS: check-build
157 <<: *native_test_job_definition
159 - job: build-system-debian
163 MAKE_CHECK_ARGS: check
165 # No targets are built here, just tools, docs, and unit tests. This
166 # also feeds into the eventual documentation deployment steps later
167 build-tools-and-docs-debian:
168 <<: *native_build_job_definition
171 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
172 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
178 acceptance-system-debian:
179 <<: *native_test_job_definition
181 - job: build-system-debian
185 MAKE_CHECK_ARGS: check-acceptance
186 <<: *acceptance_definition
189 <<: *native_build_job_definition
192 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
193 --enable-fdt=system --enable-slirp=system --enable-capstone=system
194 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
195 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
196 MAKE_CHECK_ARGS: check-build
203 <<: *native_test_job_definition
205 - job: build-system-fedora
209 MAKE_CHECK_ARGS: check
211 acceptance-system-fedora:
212 <<: *native_test_job_definition
214 - job: build-system-fedora
218 MAKE_CHECK_ARGS: check-acceptance
219 <<: *acceptance_definition
222 <<: *native_build_job_definition
225 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-tcg
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 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
442 ppc-softmmu s390x-softmmu arm-linux-user
443 MAKE_CHECK_ARGS: check
445 # These targets are on the way out
447 <<: *native_build_job_definition
449 IMAGE: debian-all-test-cross
450 CONFIGURE_ARGS: --disable-docs --disable-tools
451 MAKE_CHECK_ARGS: build-tcg
452 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
459 # We split the check-tcg step as test failures are expected but we still
460 # want to catch the build breaking.
462 <<: *native_test_job_definition
464 - job: build-deprecated
467 IMAGE: debian-all-test-cross
468 MAKE_CHECK_ARGS: check-tcg
472 <<: *native_build_job_definition
476 - mkdir build-oss-fuzz
477 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
478 ./scripts/oss-fuzz/build.sh
479 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
480 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
482 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
483 echo Testing ${fuzzer} ... ;
484 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
486 # Unrelated to fuzzer: run some tests with -fsanitize=address
487 - cd build-oss-fuzz && make check-qtest-i386 check-unit
490 <<: *native_build_job_definition
494 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
497 - ../configure --enable-tcg-interpreter
498 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
500 - make run-tcg-tests-x86_64-softmmu
501 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
502 - for tg in $TARGETS ; do
503 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
504 ./tests/qtest/boot-serial-test || exit 1 ;
505 ./tests/qtest/cdrom-test || exit 1 ;
507 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
508 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
510 # Alternate coroutines implementations are only really of interest to KVM users
511 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
512 build-coroutine-ucontext:
513 <<: *native_build_job_definition
516 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
517 MAKE_CHECK_ARGS: check-unit
519 build-coroutine-sigaltstack:
520 <<: *native_build_job_definition
523 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
524 MAKE_CHECK_ARGS: check-unit
526 # Most jobs test latest gcrypt or nettle builds
528 # These jobs test old gcrypt and nettle from RHEL7
529 # which had some API differences.
530 build-crypto-old-nettle:
531 <<: *native_build_job_definition
534 TARGETS: x86_64-softmmu x86_64-linux-user
535 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
536 MAKE_CHECK_ARGS: check-build
541 check-crypto-old-nettle:
542 <<: *native_test_job_definition
544 - job: build-crypto-old-nettle
548 MAKE_CHECK_ARGS: check
551 build-crypto-old-gcrypt:
552 <<: *native_build_job_definition
555 TARGETS: x86_64-softmmu x86_64-linux-user
556 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
557 MAKE_CHECK_ARGS: check-build
562 check-crypto-old-gcrypt:
563 <<: *native_test_job_definition
565 - job: build-crypto-old-gcrypt
569 MAKE_CHECK_ARGS: check
572 build-crypto-only-gnutls:
573 <<: *native_build_job_definition
576 TARGETS: x86_64-softmmu x86_64-linux-user
577 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
578 MAKE_CHECK_ARGS: check-build
583 check-crypto-only-gnutls:
584 <<: *native_test_job_definition
586 - job: build-crypto-only-gnutls
590 MAKE_CHECK_ARGS: check
592 # We don't need to exercise every backend with every front-end
593 build-trace-multi-user:
594 <<: *native_build_job_definition
597 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
599 build-trace-ftrace-system:
600 <<: *native_build_job_definition
603 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
605 build-trace-ust-system:
606 <<: *native_build_job_definition
609 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
611 # Check our reduced build configurations
612 build-without-default-devices:
613 <<: *native_build_job_definition
616 CONFIGURE_ARGS: --without-default-devices --disable-user
618 build-without-default-features:
619 <<: *native_build_job_definition
622 CONFIGURE_ARGS: --without-default-features --disable-user
623 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
624 MAKE_CHECK_ARGS: check-unit
628 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
629 script: .gitlab-ci.d/check-patch.py
632 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
639 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
640 script: .gitlab-ci.d/check-dco.py
643 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
649 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
651 - dnf install -y meson ninja-build
653 - mkdir subprojects/libvhost-user/build
654 - cd subprojects/libvhost-user/build
658 # Prepare for GitLab pages deployment. Anything copied into the
659 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
661 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
664 - job: build-tools-and-docs-debian
667 # HTML-ised source tree
669 - htags -anT --tree-view=filetree -m qemu_init
670 -t "Welcome to the QEMU sourcecode"
672 # Project documentation
673 - make -C build install DESTDIR=$(pwd)/temp-install
674 - mv temp-install/usr/local/share/doc/qemu/* public/