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 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
113 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
114 moxie-softmmu microblazeel-softmmu mips64el-softmmu
115 MAKE_CHECK_ARGS: check-build
122 <<: *native_test_job_definition
124 - job: build-system-ubuntu
128 MAKE_CHECK_ARGS: check
130 acceptance-system-ubuntu:
131 <<: *native_test_job_definition
133 - job: build-system-ubuntu
137 MAKE_CHECK_ARGS: check-acceptance
138 <<: *acceptance_definition
141 <<: *native_build_job_definition
144 CONFIGURE_ARGS: --enable-fdt=system
145 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
146 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
147 MAKE_CHECK_ARGS: check-build
154 <<: *native_test_job_definition
156 - job: build-system-debian
160 MAKE_CHECK_ARGS: check
162 # No targets are built here, just tools, docs, and unit tests. This
163 # also feeds into the eventual documentation deployment steps later
164 build-tools-and-docs-debian:
165 <<: *native_build_job_definition
168 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
169 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
175 acceptance-system-debian:
176 <<: *native_test_job_definition
178 - job: build-system-debian
182 MAKE_CHECK_ARGS: check-acceptance
183 <<: *acceptance_definition
186 <<: *native_build_job_definition
189 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
190 --enable-fdt=system --enable-slirp=system --enable-capstone=system
191 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
192 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
193 MAKE_CHECK_ARGS: check-build
200 <<: *native_test_job_definition
202 - job: build-system-fedora
206 MAKE_CHECK_ARGS: check
208 acceptance-system-fedora:
209 <<: *native_test_job_definition
211 - job: build-system-fedora
215 MAKE_CHECK_ARGS: check-acceptance
216 <<: *acceptance_definition
219 <<: *native_build_job_definition
222 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
223 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
224 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
225 MAKE_CHECK_ARGS: check-build
232 <<: *native_test_job_definition
234 - job: build-system-centos
238 MAKE_CHECK_ARGS: check
240 acceptance-system-centos:
241 <<: *native_test_job_definition
243 - job: build-system-centos
247 MAKE_CHECK_ARGS: check-acceptance
248 <<: *acceptance_definition
250 build-system-opensuse:
251 <<: *native_build_job_definition
254 CONFIGURE_ARGS: --enable-fdt=system
255 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
256 MAKE_CHECK_ARGS: check-build
262 check-system-opensuse:
263 <<: *native_test_job_definition
265 - job: build-system-opensuse
269 MAKE_CHECK_ARGS: check
271 acceptance-system-opensuse:
272 <<: *native_test_job_definition
274 - job: build-system-opensuse
278 MAKE_CHECK_ARGS: check-acceptance
279 <<: *acceptance_definition
283 <<: *native_build_job_definition
296 --disable-coroutine-pool
305 --disable-guest-agent
316 --disable-live-block-migration
318 --disable-malloc-trim
327 --disable-qom-cast-debug
330 --disable-replication
343 --disable-vhost-crypto
348 --disable-vhost-vsock
349 --disable-virglrenderer
355 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
356 s390x-softmmu i386-linux-user
357 MAKE_CHECK_ARGS: check-qtest SPEED=slow
359 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
360 # the configure script. The container doesn't contain Xen headers so
361 # Xen accelerator is not detected / selected. As result it build the
362 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
365 <<: *native_build_job_definition
371 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
374 - make check-qapi-schema
375 - cd tests/qemu-iotests/
376 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
377 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
378 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
379 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
380 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
381 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
382 260 261 262 263 264 270 272 273 277 279
385 <<: *native_build_job_definition
387 IMAGE: debian-all-test-cross
388 CONFIGURE_ARGS: --disable-tools --disable-system
389 MAKE_CHECK_ARGS: check-tcg
392 <<: *native_build_job_definition
394 IMAGE: debian-all-test-cross
395 CONFIGURE_ARGS: --disable-tools --disable-system --static
396 MAKE_CHECK_ARGS: check-tcg
398 # Only build the softmmu targets we have check-tcg tests for
400 <<: *native_build_job_definition
402 IMAGE: debian-all-test-cross
403 CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
404 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
405 MAKE_CHECK_ARGS: check-tcg
407 # Run check-tcg against linux-user (with plugins)
408 # we skip sparc64-linux-user until it has been fixed somewhat
409 # we skip cris-linux-user as it doesn't use the common run loop
411 <<: *native_build_job_definition
413 IMAGE: debian-all-test-cross
414 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
415 MAKE_CHECK_ARGS: check-tcg
419 <<: *native_build_job_definition
422 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
423 MAKE_CHECK_ARGS: check-tcg
425 build-some-softmmu-plugins:
426 <<: *native_build_job_definition
428 IMAGE: debian-all-test-cross
429 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
430 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
431 MAKE_CHECK_ARGS: check-tcg
434 <<: *native_build_job_definition
437 CONFIGURE_ARGS: --cc=clang --cxx=clang++
438 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
439 ppc-softmmu s390x-softmmu arm-linux-user
440 MAKE_CHECK_ARGS: check
442 # These targets are on the way out
444 <<: *native_build_job_definition
446 IMAGE: debian-all-test-cross
447 CONFIGURE_ARGS: --disable-docs --disable-tools
448 MAKE_CHECK_ARGS: build-tcg
449 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
456 # We split the check-tcg step as test failures are expected but we still
457 # want to catch the build breaking.
459 <<: *native_test_job_definition
461 - job: build-deprecated
464 IMAGE: debian-all-test-cross
465 MAKE_CHECK_ARGS: check-tcg
469 <<: *native_build_job_definition
473 - mkdir build-oss-fuzz
474 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
475 ./scripts/oss-fuzz/build.sh
476 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
477 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
479 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
480 echo Testing ${fuzzer} ... ;
481 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
483 # Unrelated to fuzzer: run some tests with -fsanitize=address
484 - cd build-oss-fuzz && make check-qtest-i386 check-unit
487 <<: *native_build_job_definition
491 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
494 - ../configure --enable-tcg-interpreter
495 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
497 - make run-tcg-tests-x86_64-softmmu
498 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
499 - for tg in $TARGETS ; do
500 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
501 ./tests/qtest/boot-serial-test || exit 1 ;
502 ./tests/qtest/cdrom-test || exit 1 ;
504 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
505 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
507 # Alternate coroutines implementations are only really of interest to KVM users
508 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
509 build-coroutine-ucontext:
510 <<: *native_build_job_definition
513 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
514 MAKE_CHECK_ARGS: check-unit
516 build-coroutine-sigaltstack:
517 <<: *native_build_job_definition
520 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
521 MAKE_CHECK_ARGS: check-unit
523 # Most jobs test latest gcrypt or nettle builds
525 # These jobs test old gcrypt and nettle from RHEL7
526 # which had some API differences.
527 build-crypto-old-nettle:
528 <<: *native_build_job_definition
531 TARGETS: x86_64-softmmu x86_64-linux-user
532 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
533 MAKE_CHECK_ARGS: check-build
538 check-crypto-old-nettle:
539 <<: *native_test_job_definition
541 - job: build-crypto-old-nettle
545 MAKE_CHECK_ARGS: check
548 build-crypto-old-gcrypt:
549 <<: *native_build_job_definition
552 TARGETS: x86_64-softmmu x86_64-linux-user
553 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
554 MAKE_CHECK_ARGS: check-build
559 check-crypto-old-gcrypt:
560 <<: *native_test_job_definition
562 - job: build-crypto-old-gcrypt
566 MAKE_CHECK_ARGS: check
569 build-crypto-only-gnutls:
570 <<: *native_build_job_definition
573 TARGETS: x86_64-softmmu x86_64-linux-user
574 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
575 MAKE_CHECK_ARGS: check-build
580 check-crypto-only-gnutls:
581 <<: *native_test_job_definition
583 - job: build-crypto-only-gnutls
587 MAKE_CHECK_ARGS: check
589 # We don't need to exercise every backend with every front-end
590 build-trace-multi-user:
591 <<: *native_build_job_definition
594 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
596 build-trace-ftrace-system:
597 <<: *native_build_job_definition
600 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
602 build-trace-ust-system:
603 <<: *native_build_job_definition
606 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
608 # Check our reduced build configurations
609 build-without-default-devices:
610 <<: *native_build_job_definition
613 CONFIGURE_ARGS: --without-default-devices --disable-user
615 build-without-default-features:
616 <<: *native_build_job_definition
619 CONFIGURE_ARGS: --without-default-features --disable-user
620 MAKE_CHECK_ARGS: check-unit
624 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
625 script: .gitlab-ci.d/check-patch.py
628 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
635 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
636 script: .gitlab-ci.d/check-dco.py
639 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
645 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
647 - dnf install -y meson ninja-build
649 - mkdir subprojects/libvhost-user/build
650 - cd subprojects/libvhost-user/build
654 # Prepare for GitLab pages deployment. Anything copied into the
655 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
657 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
660 - job: build-tools-and-docs-debian
663 # HTML-ised source tree
665 - htags -anT --tree-view=filetree -m qemu_init
666 -t "Welcome to the QEMU sourcecode"
668 # Project documentation
669 - make -C build install DESTDIR=$(pwd)/temp-install
670 - mv temp-install/usr/local/share/doc/qemu/* public/