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
88 <<: *native_test_job_definition
90 - job: build-system-ubuntu
94 MAKE_CHECK_ARGS: check
96 acceptance-system-ubuntu:
97 <<: *native_test_job_definition
99 - job: build-system-ubuntu
103 MAKE_CHECK_ARGS: check-acceptance
104 <<: *acceptance_definition
107 <<: *native_build_job_definition
110 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
111 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
112 MAKE_CHECK_ARGS: check-build
119 <<: *native_test_job_definition
121 - job: build-system-debian
125 MAKE_CHECK_ARGS: check
127 # No targets are built here, just tools, docs, and unit tests. This
128 # also feeds into the eventual documentation deployment steps later
129 build-tools-and-docs-debian:
130 <<: *native_build_job_definition
133 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
134 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
140 acceptance-system-debian:
141 <<: *native_test_job_definition
143 - job: build-system-debian
147 MAKE_CHECK_ARGS: check-acceptance
148 <<: *acceptance_definition
151 <<: *native_build_job_definition
154 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
155 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
156 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
157 MAKE_CHECK_ARGS: check-build
164 <<: *native_test_job_definition
166 - job: build-system-fedora
170 MAKE_CHECK_ARGS: check
172 acceptance-system-fedora:
173 <<: *native_test_job_definition
175 - job: build-system-fedora
179 MAKE_CHECK_ARGS: check-acceptance
180 <<: *acceptance_definition
183 <<: *native_build_job_definition
186 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
187 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
188 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
189 MAKE_CHECK_ARGS: check-build
196 <<: *native_test_job_definition
198 - job: build-system-centos
202 MAKE_CHECK_ARGS: check
204 acceptance-system-centos:
205 <<: *native_test_job_definition
207 - job: build-system-centos
211 MAKE_CHECK_ARGS: check-acceptance
212 <<: *acceptance_definition
214 build-system-opensuse:
215 <<: *native_build_job_definition
218 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
219 MAKE_CHECK_ARGS: check-build
225 check-system-opensuse:
226 <<: *native_test_job_definition
228 - job: build-system-opensuse
232 MAKE_CHECK_ARGS: check
234 acceptance-system-opensuse:
235 <<: *native_test_job_definition
237 - job: build-system-opensuse
241 MAKE_CHECK_ARGS: check-acceptance
242 <<: *acceptance_definition
246 <<: *native_build_job_definition
259 --disable-coroutine-pool
268 --disable-guest-agent
279 --disable-live-block-migration
281 --disable-malloc-trim
290 --disable-qom-cast-debug
293 --disable-replication
306 --disable-vhost-crypto
311 --disable-vhost-vsock
312 --disable-virglrenderer
318 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
319 s390x-softmmu i386-linux-user
320 MAKE_CHECK_ARGS: check-qtest SPEED=slow
322 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
323 # the configure script. The container doesn't contain Xen headers so
324 # Xen accelerator is not detected / selected. As result it build the
325 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
328 <<: *native_build_job_definition
334 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
337 - make check-qapi-schema
338 - cd tests/qemu-iotests/
339 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
340 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
341 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
342 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
343 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
344 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
345 260 261 262 263 264 270 272 273 277 279
348 <<: *native_build_job_definition
350 IMAGE: debian-all-test-cross
351 CONFIGURE_ARGS: --disable-tools --disable-system
352 MAKE_CHECK_ARGS: check-tcg
355 <<: *native_build_job_definition
357 IMAGE: debian-all-test-cross
358 CONFIGURE_ARGS: --disable-tools --disable-system --static
359 MAKE_CHECK_ARGS: check-tcg
361 # Only build the softmmu targets we have check-tcg tests for
363 <<: *native_build_job_definition
365 IMAGE: debian-all-test-cross
366 CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
367 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
368 MAKE_CHECK_ARGS: check-tcg
370 # Run check-tcg against linux-user (with plugins)
371 # we skip sparc64-linux-user until it has been fixed somewhat
372 # we skip cris-linux-user as it doesn't use the common run loop
374 <<: *native_build_job_definition
376 IMAGE: debian-all-test-cross
377 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
378 MAKE_CHECK_ARGS: check-tcg
381 build-some-softmmu-plugins:
382 <<: *native_build_job_definition
384 IMAGE: debian-all-test-cross
385 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
386 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
387 MAKE_CHECK_ARGS: check-tcg
390 <<: *native_build_job_definition
393 CONFIGURE_ARGS: --cc=clang --cxx=clang++
394 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
395 ppc-softmmu s390x-softmmu arm-linux-user
396 MAKE_CHECK_ARGS: check
398 # These targets are on the way out
400 <<: *native_build_job_definition
402 IMAGE: debian-all-test-cross
403 CONFIGURE_ARGS: --disable-docs --disable-tools
404 MAKE_CHECK_ARGS: build-tcg
405 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
412 # We split the check-tcg step as test failures are expected but we still
413 # want to catch the build breaking.
415 <<: *native_test_job_definition
417 - job: build-deprecated
420 IMAGE: debian-all-test-cross
421 MAKE_CHECK_ARGS: check-tcg
425 <<: *native_build_job_definition
429 - mkdir build-oss-fuzz
430 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
431 ./scripts/oss-fuzz/build.sh
432 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
433 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
435 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
436 echo Testing ${fuzzer} ... ;
437 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
439 # Unrelated to fuzzer: run some tests with -fsanitize=address
440 - cd build-oss-fuzz && make check-qtest-i386 check-unit
443 <<: *native_build_job_definition
447 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
450 - ../configure --enable-tcg-interpreter
451 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
453 - make run-tcg-tests-x86_64-softmmu
454 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
455 - for tg in $TARGETS ; do
456 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
457 ./tests/qtest/boot-serial-test || exit 1 ;
458 ./tests/qtest/cdrom-test || exit 1 ;
460 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
461 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
463 # Alternate coroutines implementations are only really of interest to KVM users
464 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
465 build-coroutine-ucontext:
466 <<: *native_build_job_definition
469 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
470 MAKE_CHECK_ARGS: check-unit
472 build-coroutine-sigaltstack:
473 <<: *native_build_job_definition
476 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
477 MAKE_CHECK_ARGS: check-unit
479 # Most jobs test latest gcrypt or nettle builds
481 # These jobs test old gcrypt and nettle from RHEL7
482 # which had some API differences.
483 build-crypto-old-nettle:
484 <<: *native_build_job_definition
487 TARGETS: x86_64-softmmu x86_64-linux-user
488 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
489 MAKE_CHECK_ARGS: check-build
494 check-crypto-old-nettle:
495 <<: *native_test_job_definition
497 - job: build-crypto-old-nettle
501 MAKE_CHECK_ARGS: check
504 build-crypto-old-gcrypt:
505 <<: *native_build_job_definition
508 TARGETS: x86_64-softmmu x86_64-linux-user
509 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
510 MAKE_CHECK_ARGS: check-build
515 check-crypto-old-gcrypt:
516 <<: *native_test_job_definition
518 - job: build-crypto-old-gcrypt
522 MAKE_CHECK_ARGS: check
525 build-crypto-only-gnutls:
526 <<: *native_build_job_definition
529 TARGETS: x86_64-softmmu x86_64-linux-user
530 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
531 MAKE_CHECK_ARGS: check-build
536 check-crypto-only-gnutls:
537 <<: *native_test_job_definition
539 - job: build-crypto-only-gnutls
543 MAKE_CHECK_ARGS: check
545 # We don't need to exercise every backend with every front-end
546 build-trace-multi-user:
547 <<: *native_build_job_definition
550 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
552 build-trace-ftrace-system:
553 <<: *native_build_job_definition
556 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
558 build-trace-ust-system:
559 <<: *native_build_job_definition
562 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
564 # Check our reduced build configurations
565 build-without-default-devices:
566 <<: *native_build_job_definition
569 CONFIGURE_ARGS: --without-default-devices --disable-user
571 build-without-default-features:
572 <<: *native_build_job_definition
575 CONFIGURE_ARGS: --without-default-features --disable-user
576 MAKE_CHECK_ARGS: check-unit
580 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
581 script: .gitlab-ci.d/check-patch.py
584 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
591 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
592 script: .gitlab-ci.d/check-dco.py
595 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
601 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
603 - dnf install -y meson ninja-build
605 - mkdir subprojects/libvhost-user/build
606 - cd subprojects/libvhost-user/build
610 # Prepare for GitLab pages deployment. Anything copied into the
611 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
613 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
616 - job: build-tools-and-docs-debian
619 # HTML-ised source tree
621 - htags -anT --tree-view=filetree -m qemu_init
622 -t "Welcome to the QEMU sourcecode"
624 # Project documentation
625 - mv build/docs/index.html public/
626 - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done