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
89 <<: *native_test_job_definition
91 - job: build-system-ubuntu
95 MAKE_CHECK_ARGS: check
97 acceptance-system-ubuntu:
98 <<: *native_test_job_definition
100 - job: build-system-ubuntu
104 MAKE_CHECK_ARGS: check-acceptance
105 <<: *acceptance_definition
108 <<: *native_build_job_definition
111 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
112 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
113 MAKE_CHECK_ARGS: check-build
114 CONFIGURE_ARGS: --enable-docs
121 <<: *native_test_job_definition
123 - job: build-system-debian
127 MAKE_CHECK_ARGS: check
129 acceptance-system-debian:
130 <<: *native_test_job_definition
132 - job: build-system-debian
136 MAKE_CHECK_ARGS: check-acceptance
137 <<: *acceptance_definition
140 <<: *native_build_job_definition
143 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
144 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
145 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
146 MAKE_CHECK_ARGS: check-build
153 <<: *native_test_job_definition
155 - job: build-system-fedora
159 MAKE_CHECK_ARGS: check
161 acceptance-system-fedora:
162 <<: *native_test_job_definition
164 - job: build-system-fedora
168 MAKE_CHECK_ARGS: check-acceptance
169 <<: *acceptance_definition
172 <<: *native_build_job_definition
175 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
176 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
177 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
178 MAKE_CHECK_ARGS: check-build
185 <<: *native_test_job_definition
187 - job: build-system-centos
191 MAKE_CHECK_ARGS: check
193 acceptance-system-centos:
194 <<: *native_test_job_definition
196 - job: build-system-centos
200 MAKE_CHECK_ARGS: check-acceptance
201 <<: *acceptance_definition
204 <<: *native_build_job_definition
217 --disable-coroutine-pool
226 --disable-guest-agent
237 --disable-live-block-migration
239 --disable-malloc-trim
248 --disable-qom-cast-debug
251 --disable-replication
264 --disable-vhost-crypto
269 --disable-vhost-vsock
270 --disable-virglrenderer
276 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
277 s390x-softmmu i386-linux-user
278 MAKE_CHECK_ARGS: check-qtest SPEED=slow
280 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
281 # the configure script. The container doesn't contain Xen headers so
282 # Xen accelerator is not detected / selected. As result it build the
283 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
286 <<: *native_build_job_definition
292 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
295 - make check-qapi-schema
296 - cd tests/qemu-iotests/
297 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
298 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
299 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
300 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
301 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
302 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
303 260 261 262 263 264 270 272 273 277 279
306 <<: *native_build_job_definition
308 IMAGE: debian-all-test-cross
309 CONFIGURE_ARGS: --disable-tools --disable-system
310 MAKE_CHECK_ARGS: check-tcg
313 <<: *native_build_job_definition
315 IMAGE: debian-all-test-cross
316 CONFIGURE_ARGS: --disable-tools --disable-system --static
317 MAKE_CHECK_ARGS: check-tcg
319 # Only build the softmmu targets we have check-tcg tests for
321 <<: *native_build_job_definition
323 IMAGE: debian-all-test-cross
324 CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
325 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
326 MAKE_CHECK_ARGS: check-tcg
328 # Run check-tcg against linux-user (with plugins)
329 # we skip sparc64-linux-user until it has been fixed somewhat
330 # we skip cris-linux-user as it doesn't use the common run loop
332 <<: *native_build_job_definition
334 IMAGE: debian-all-test-cross
335 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
336 MAKE_CHECK_ARGS: check-tcg
339 build-some-softmmu-plugins:
340 <<: *native_build_job_definition
342 IMAGE: debian-all-test-cross
343 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
344 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
345 MAKE_CHECK_ARGS: check-tcg
348 <<: *native_build_job_definition
351 CONFIGURE_ARGS: --cc=clang --cxx=clang++
352 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
353 ppc-softmmu s390x-softmmu arm-linux-user
354 MAKE_CHECK_ARGS: check
356 # These targets are on the way out
358 <<: *native_build_job_definition
360 IMAGE: debian-all-test-cross
361 CONFIGURE_ARGS: --disable-docs --disable-tools
362 MAKE_CHECK_ARGS: build-tcg
363 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
370 # We split the check-tcg step as test failures are expected but we still
371 # want to catch the build breaking.
373 <<: *native_test_job_definition
375 - job: build-deprecated
378 IMAGE: debian-all-test-cross
379 MAKE_CHECK_ARGS: check-tcg
383 <<: *native_build_job_definition
387 - mkdir build-oss-fuzz
388 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
389 ./scripts/oss-fuzz/build.sh
390 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
391 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
393 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
394 echo Testing ${fuzzer} ... ;
395 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
397 # Unrelated to fuzzer: run some tests with -fsanitize=address
398 - cd build-oss-fuzz && make check-qtest-i386 check-unit
401 <<: *native_build_job_definition
405 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
408 - ../configure --enable-tcg-interpreter
409 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
411 - make run-tcg-tests-x86_64-softmmu
412 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
413 - for tg in $TARGETS ; do
414 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
415 ./tests/qtest/boot-serial-test || exit 1 ;
416 ./tests/qtest/cdrom-test || exit 1 ;
418 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
419 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
421 # Alternate coroutines implementations are only really of interest to KVM users
422 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
423 build-coroutine-ucontext:
424 <<: *native_build_job_definition
427 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
428 MAKE_CHECK_ARGS: check-unit
430 build-coroutine-sigaltstack:
431 <<: *native_build_job_definition
434 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
435 MAKE_CHECK_ARGS: check-unit
437 # Most jobs test latest gcrypt or nettle builds
439 # These jobs test old gcrypt and nettle from RHEL7
440 # which had some API differences.
441 build-crypto-old-nettle:
442 <<: *native_build_job_definition
445 TARGETS: x86_64-softmmu x86_64-linux-user
446 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
447 MAKE_CHECK_ARGS: check-build
452 check-crypto-old-nettle:
453 <<: *native_test_job_definition
455 - job: build-crypto-old-nettle
459 MAKE_CHECK_ARGS: check
462 build-crypto-old-gcrypt:
463 <<: *native_build_job_definition
466 TARGETS: x86_64-softmmu x86_64-linux-user
467 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
468 MAKE_CHECK_ARGS: check-build
473 check-crypto-old-gcrypt:
474 <<: *native_test_job_definition
476 - job: build-crypto-old-gcrypt
480 MAKE_CHECK_ARGS: check
483 build-crypto-only-gnutls:
484 <<: *native_build_job_definition
487 TARGETS: x86_64-softmmu x86_64-linux-user
488 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
489 MAKE_CHECK_ARGS: check-build
494 check-crypto-only-gnutls:
495 <<: *native_test_job_definition
497 - job: build-crypto-only-gnutls
501 MAKE_CHECK_ARGS: check
503 # We don't need to exercise every backend with every front-end
504 build-trace-multi-user:
505 <<: *native_build_job_definition
508 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
510 build-trace-ftrace-system:
511 <<: *native_build_job_definition
514 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
516 build-trace-ust-system:
517 <<: *native_build_job_definition
520 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
522 # Check our reduced build configurations
523 build-without-default-devices:
524 <<: *native_build_job_definition
527 CONFIGURE_ARGS: --without-default-devices --disable-user
529 build-without-default-features:
530 <<: *native_build_job_definition
533 CONFIGURE_ARGS: --without-default-features --disable-user
534 MAKE_CHECK_ARGS: check-unit
538 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
539 script: .gitlab-ci.d/check-patch.py
542 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
549 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
550 script: .gitlab-ci.d/check-dco.py
553 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
559 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
561 - dnf install -y meson ninja-build
563 - mkdir subprojects/libvhost-user/build
564 - cd subprojects/libvhost-user/build
569 image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest
572 - job: build-system-ubuntu
576 - mv build/docs/index.html public/
577 - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done