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
42 - find . -type f -exec touch {} +
43 - make $MAKE_CHECK_ARGS
45 .acceptance_template: &acceptance_definition
47 key: "${CI_JOB_NAME}-cache"
49 - ${CI_PROJECT_DIR}/avocado-cache
52 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
56 - build/tests/results/latest/results.xml
57 - build/tests/results/latest/test-results
59 junit: build/tests/results/latest/results.xml
61 - mkdir -p ~/.config/avocado
62 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
63 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
64 >> ~/.config/avocado/avocado.conf
65 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL"]'
66 >> ~/.config/avocado/avocado.conf
67 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
68 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
70 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
73 - du -chs ${CI_PROJECT_DIR}/avocado-cache
76 <<: *native_build_job_definition
79 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
80 moxie-softmmu microblazeel-softmmu mips64el-softmmu
81 MAKE_CHECK_ARGS: check-build
82 CONFIGURE_ARGS: --enable-docs
86 - .git-submodule-status
90 <<: *native_test_job_definition
92 - job: build-system-alpine
96 MAKE_CHECK_ARGS: check
98 acceptance-system-alpine:
99 <<: *native_test_job_definition
101 - job: build-system-alpine
105 MAKE_CHECK_ARGS: check-acceptance
106 <<: *acceptance_definition
109 <<: *native_build_job_definition
112 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
113 moxie-softmmu microblazeel-softmmu mips64el-softmmu
114 MAKE_CHECK_ARGS: check-build
121 <<: *native_test_job_definition
123 - job: build-system-ubuntu
127 MAKE_CHECK_ARGS: check
129 acceptance-system-ubuntu:
130 <<: *native_test_job_definition
132 - job: build-system-ubuntu
136 MAKE_CHECK_ARGS: check-acceptance
137 <<: *acceptance_definition
140 <<: *native_build_job_definition
143 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
144 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
145 MAKE_CHECK_ARGS: check-build
152 <<: *native_test_job_definition
154 - job: build-system-debian
158 MAKE_CHECK_ARGS: check
160 # No targets are built here, just tools, docs, and unit tests. This
161 # also feeds into the eventual documentation deployment steps later
162 build-tools-and-docs-debian:
163 <<: *native_build_job_definition
166 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
167 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
173 acceptance-system-debian:
174 <<: *native_test_job_definition
176 - job: build-system-debian
180 MAKE_CHECK_ARGS: check-acceptance
181 <<: *acceptance_definition
184 <<: *native_build_job_definition
187 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
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
219 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
220 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
221 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
222 MAKE_CHECK_ARGS: check-build
229 <<: *native_test_job_definition
231 - job: build-system-centos
235 MAKE_CHECK_ARGS: check
237 acceptance-system-centos:
238 <<: *native_test_job_definition
240 - job: build-system-centos
244 MAKE_CHECK_ARGS: check-acceptance
245 <<: *acceptance_definition
247 build-system-opensuse:
248 <<: *native_build_job_definition
251 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
252 MAKE_CHECK_ARGS: check-build
258 check-system-opensuse:
259 <<: *native_test_job_definition
261 - job: build-system-opensuse
265 MAKE_CHECK_ARGS: check
267 acceptance-system-opensuse:
268 <<: *native_test_job_definition
270 - job: build-system-opensuse
274 MAKE_CHECK_ARGS: check-acceptance
275 <<: *acceptance_definition
279 <<: *native_build_job_definition
292 --disable-coroutine-pool
301 --disable-guest-agent
312 --disable-live-block-migration
314 --disable-malloc-trim
323 --disable-qom-cast-debug
326 --disable-replication
339 --disable-vhost-crypto
344 --disable-vhost-vsock
345 --disable-virglrenderer
351 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
352 s390x-softmmu i386-linux-user
353 MAKE_CHECK_ARGS: check-qtest SPEED=slow
355 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
356 # the configure script. The container doesn't contain Xen headers so
357 # Xen accelerator is not detected / selected. As result it build the
358 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
361 <<: *native_build_job_definition
367 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
370 - make check-qapi-schema
371 - cd tests/qemu-iotests/
372 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
373 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
374 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
375 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
376 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
377 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
378 260 261 262 263 264 270 272 273 277 279
381 <<: *native_build_job_definition
383 IMAGE: debian-all-test-cross
384 CONFIGURE_ARGS: --disable-tools --disable-system
385 MAKE_CHECK_ARGS: check-tcg
388 <<: *native_build_job_definition
390 IMAGE: debian-all-test-cross
391 CONFIGURE_ARGS: --disable-tools --disable-system --static
392 MAKE_CHECK_ARGS: check-tcg
394 # Only build the softmmu targets we have check-tcg tests for
396 <<: *native_build_job_definition
398 IMAGE: debian-all-test-cross
399 CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
400 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
401 MAKE_CHECK_ARGS: check-tcg
403 # Run check-tcg against linux-user (with plugins)
404 # we skip sparc64-linux-user until it has been fixed somewhat
405 # we skip cris-linux-user as it doesn't use the common run loop
407 <<: *native_build_job_definition
409 IMAGE: debian-all-test-cross
410 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
411 MAKE_CHECK_ARGS: check-tcg
414 build-some-softmmu-plugins:
415 <<: *native_build_job_definition
417 IMAGE: debian-all-test-cross
418 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
419 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
420 MAKE_CHECK_ARGS: check-tcg
423 <<: *native_build_job_definition
426 CONFIGURE_ARGS: --cc=clang --cxx=clang++
427 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
428 ppc-softmmu s390x-softmmu arm-linux-user
429 MAKE_CHECK_ARGS: check
431 # These targets are on the way out
433 <<: *native_build_job_definition
435 IMAGE: debian-all-test-cross
436 CONFIGURE_ARGS: --disable-docs --disable-tools
437 MAKE_CHECK_ARGS: build-tcg
438 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
445 # We split the check-tcg step as test failures are expected but we still
446 # want to catch the build breaking.
448 <<: *native_test_job_definition
450 - job: build-deprecated
453 IMAGE: debian-all-test-cross
454 MAKE_CHECK_ARGS: check-tcg
458 <<: *native_build_job_definition
462 - mkdir build-oss-fuzz
463 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
464 ./scripts/oss-fuzz/build.sh
465 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
466 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
468 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
469 echo Testing ${fuzzer} ... ;
470 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
472 # Unrelated to fuzzer: run some tests with -fsanitize=address
473 - cd build-oss-fuzz && make check-qtest-i386 check-unit
476 <<: *native_build_job_definition
480 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
483 - ../configure --enable-tcg-interpreter
484 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
486 - make run-tcg-tests-x86_64-softmmu
487 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
488 - for tg in $TARGETS ; do
489 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
490 ./tests/qtest/boot-serial-test || exit 1 ;
491 ./tests/qtest/cdrom-test || exit 1 ;
493 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
494 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
496 # Alternate coroutines implementations are only really of interest to KVM users
497 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
498 build-coroutine-ucontext:
499 <<: *native_build_job_definition
502 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
503 MAKE_CHECK_ARGS: check-unit
505 build-coroutine-sigaltstack:
506 <<: *native_build_job_definition
509 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
510 MAKE_CHECK_ARGS: check-unit
512 # Most jobs test latest gcrypt or nettle builds
514 # These jobs test old gcrypt and nettle from RHEL7
515 # which had some API differences.
516 build-crypto-old-nettle:
517 <<: *native_build_job_definition
520 TARGETS: x86_64-softmmu x86_64-linux-user
521 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
522 MAKE_CHECK_ARGS: check-build
527 check-crypto-old-nettle:
528 <<: *native_test_job_definition
530 - job: build-crypto-old-nettle
534 MAKE_CHECK_ARGS: check
537 build-crypto-old-gcrypt:
538 <<: *native_build_job_definition
541 TARGETS: x86_64-softmmu x86_64-linux-user
542 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
543 MAKE_CHECK_ARGS: check-build
548 check-crypto-old-gcrypt:
549 <<: *native_test_job_definition
551 - job: build-crypto-old-gcrypt
555 MAKE_CHECK_ARGS: check
558 build-crypto-only-gnutls:
559 <<: *native_build_job_definition
562 TARGETS: x86_64-softmmu x86_64-linux-user
563 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
564 MAKE_CHECK_ARGS: check-build
569 check-crypto-only-gnutls:
570 <<: *native_test_job_definition
572 - job: build-crypto-only-gnutls
576 MAKE_CHECK_ARGS: check
578 # We don't need to exercise every backend with every front-end
579 build-trace-multi-user:
580 <<: *native_build_job_definition
583 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
585 build-trace-ftrace-system:
586 <<: *native_build_job_definition
589 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
591 build-trace-ust-system:
592 <<: *native_build_job_definition
595 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
597 # Check our reduced build configurations
598 build-without-default-devices:
599 <<: *native_build_job_definition
602 CONFIGURE_ARGS: --without-default-devices --disable-user
604 build-without-default-features:
605 <<: *native_build_job_definition
608 CONFIGURE_ARGS: --without-default-features --disable-user
609 MAKE_CHECK_ARGS: check-unit
613 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
614 script: .gitlab-ci.d/check-patch.py
617 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
624 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
625 script: .gitlab-ci.d/check-dco.py
628 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
634 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
636 - dnf install -y meson ninja-build
638 - mkdir subprojects/libvhost-user/build
639 - cd subprojects/libvhost-user/build
643 # Prepare for GitLab pages deployment. Anything copied into the
644 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
646 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
649 - job: build-tools-and-docs-debian
652 # HTML-ised source tree
654 - htags -anT --tree-view=filetree -m qemu_init
655 -t "Welcome to the QEMU sourcecode"
657 # Project documentation
658 - make -C build install DESTDIR=$(pwd)/temp-install
659 - mv temp-install/usr/local/share/doc/qemu/* public/