xref: /openbmc/qemu/.gitlab-ci.d/buildtest.yml (revision 646b5378)
1include:
2  - local: '/.gitlab-ci.d/buildtest-template.yml'
3
4build-system-alpine:
5  extends:
6    - .native_build_job_template
7    - .native_build_artifact_template
8  needs:
9    - job: amd64-alpine-container
10  variables:
11    IMAGE: alpine
12    TARGETS: avr-softmmu loongarch64-softmmu mips64-softmmu mipsel-softmmu
13    MAKE_CHECK_ARGS: check-build
14    CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
15
16check-system-alpine:
17  extends: .native_test_job_template
18  needs:
19    - job: build-system-alpine
20      artifacts: true
21  variables:
22    IMAGE: alpine
23    MAKE_CHECK_ARGS: check-unit check-qtest
24
25functional-system-alpine:
26  extends: .functional_test_job_template
27  needs:
28    - job: build-system-alpine
29      artifacts: true
30  variables:
31    IMAGE: alpine
32    MAKE_CHECK_ARGS: check-avocado check-functional
33    AVOCADO_TAGS: arch:avr arch:loongarch64 arch:mips64 arch:mipsel
34
35build-system-ubuntu:
36  extends:
37    - .native_build_job_template
38    - .native_build_artifact_template
39  needs:
40    job: amd64-ubuntu2204-container
41  variables:
42    IMAGE: ubuntu2204
43    CONFIGURE_ARGS: --enable-docs
44    TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu
45    MAKE_CHECK_ARGS: check-build
46
47check-system-ubuntu:
48  extends: .native_test_job_template
49  needs:
50    - job: build-system-ubuntu
51      artifacts: true
52  variables:
53    IMAGE: ubuntu2204
54    MAKE_CHECK_ARGS: check
55
56functional-system-ubuntu:
57  extends: .functional_test_job_template
58  needs:
59    - job: build-system-ubuntu
60      artifacts: true
61  variables:
62    IMAGE: ubuntu2204
63    MAKE_CHECK_ARGS: check-avocado check-functional
64    AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el
65
66build-system-debian:
67  extends:
68    - .native_build_job_template
69    - .native_build_artifact_template
70  needs:
71    job: amd64-debian-container
72  variables:
73    IMAGE: debian
74    CONFIGURE_ARGS: --with-coroutine=sigaltstack
75    TARGETS: arm-softmmu i386-softmmu riscv64-softmmu sh4eb-softmmu
76      sparc-softmmu xtensa-softmmu
77    MAKE_CHECK_ARGS: check-build
78
79check-system-debian:
80  extends: .native_test_job_template
81  needs:
82    - job: build-system-debian
83      artifacts: true
84  variables:
85    IMAGE: debian
86    MAKE_CHECK_ARGS: check
87
88functional-system-debian:
89  extends: .functional_test_job_template
90  needs:
91    - job: build-system-debian
92      artifacts: true
93  variables:
94    IMAGE: debian
95    MAKE_CHECK_ARGS: check-avocado check-functional
96    AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch:xtensa
97
98crash-test-debian:
99  extends: .native_test_job_template
100  needs:
101    - job: build-system-debian
102      artifacts: true
103  variables:
104    IMAGE: debian
105  script:
106    - cd build
107    - make NINJA=":" check-venv
108    - pyvenv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
109
110build-system-fedora:
111  extends:
112    - .native_build_job_template
113    - .native_build_artifact_template
114  needs:
115    job: amd64-fedora-container
116  variables:
117    IMAGE: fedora
118    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs --enable-crypto-afalg --enable-rust
119    TARGETS: microblaze-softmmu mips-softmmu
120      xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
121    MAKE_CHECK_ARGS: check-build
122
123build-system-fedora-rust-nightly:
124  extends:
125    - .native_build_job_template
126    - .native_build_artifact_template
127  needs:
128    job: amd64-fedora-rust-nightly-container
129  variables:
130    IMAGE: fedora-rust-nightly
131    CONFIGURE_ARGS: --disable-docs --enable-rust
132    TARGETS: aarch64-softmmu
133    MAKE_CHECK_ARGS: check-build
134  allow_failure: true
135
136check-system-fedora:
137  extends: .native_test_job_template
138  needs:
139    - job: build-system-fedora
140      artifacts: true
141  variables:
142    IMAGE: fedora
143    MAKE_CHECK_ARGS: check
144
145functional-system-fedora:
146  extends: .functional_test_job_template
147  needs:
148    - job: build-system-fedora
149      artifacts: true
150  variables:
151    IMAGE: fedora
152    MAKE_CHECK_ARGS: check-avocado check-functional
153    AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k
154      arch:riscv32 arch:ppc arch:sparc64
155
156crash-test-fedora:
157  extends: .native_test_job_template
158  needs:
159    - job: build-system-fedora
160      artifacts: true
161  variables:
162    IMAGE: fedora
163  script:
164    - cd build
165    - make NINJA=":" check-venv
166    - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
167    - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
168
169build-system-centos:
170  extends:
171    - .native_build_job_template
172    - .native_build_artifact_template
173  needs:
174    job: amd64-centos9-container
175  variables:
176    IMAGE: centos9
177    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-vfio-user-server
178      --enable-modules --enable-trace-backends=dtrace --enable-docs
179    TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
180      x86_64-softmmu rx-softmmu sh4-softmmu
181    MAKE_CHECK_ARGS: check-build
182
183# Previous QEMU release. Used for cross-version migration tests.
184build-previous-qemu:
185  extends: .native_build_job_template
186  artifacts:
187    when: on_success
188    expire_in: 2 days
189    paths:
190      - build-previous
191    exclude:
192      - build-previous/**/*.p
193      - build-previous/**/*.a.p
194      - build-previous/**/*.c.o
195      - build-previous/**/*.c.o.d
196  needs:
197    job: amd64-opensuse-leap-container
198  variables:
199    IMAGE: opensuse-leap
200    TARGETS: x86_64-softmmu aarch64-softmmu
201    # Override the default flags as we need more to grab the old version
202    GIT_FETCH_EXTRA_FLAGS: --prune --quiet
203  before_script:
204    - source scripts/ci/gitlab-ci-section
205    - export QEMU_PREV_VERSION="$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' VERSION)"
206    - git remote add upstream https://gitlab.com/qemu-project/qemu
207    - git fetch upstream refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV_VERSION
208    - git checkout $QEMU_PREV_VERSION
209  after_script:
210    - mv build build-previous
211
212.migration-compat-common:
213  extends: .common_test_job_template
214  needs:
215    - job: build-previous-qemu
216    - job: build-system-opensuse
217  # The old QEMU could have bugs unrelated to migration that are
218  # already fixed in the current development branch, so this test
219  # might fail.
220  allow_failure: true
221  variables:
222    IMAGE: opensuse-leap
223    MAKE_CHECK_ARGS: check-build
224  script:
225    # Use the migration-tests from the older QEMU tree. This avoids
226    # testing an old QEMU against new features/tests that it is not
227    # compatible with.
228    - cd build-previous
229    # Don't allow python-based tests to run. The
230    # vmstate-checker-script test has a race that causes it to fail
231    # sometimes. It cannot be fixed it because this job runs the test
232    # from the old QEMU version. The test will be removed on master,
233    # but this job will only see the change in the next release.
234    #
235    # TODO: remove this line after 9.2 release
236    - unset PYTHON
237    # old to new
238    - QTEST_QEMU_BINARY_SRC=./qemu-system-${TARGET}
239          QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
240    # new to old
241    - QTEST_QEMU_BINARY_DST=./qemu-system-${TARGET}
242          QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
243
244# This job needs to be disabled until we can have an aarch64 CPU model that
245# will both (1) support both KVM and TCG, and (2) provide a stable ABI.
246# Currently only "-cpu max" can provide (1), however it doesn't guarantee
247# (2).  Mark this test skipped until later.
248migration-compat-aarch64:
249  extends: .migration-compat-common
250  variables:
251    TARGET: aarch64
252    QEMU_JOB_SKIPPED: 1
253
254migration-compat-x86_64:
255  extends: .migration-compat-common
256  variables:
257    TARGET: x86_64
258
259check-system-centos:
260  extends: .native_test_job_template
261  needs:
262    - job: build-system-centos
263      artifacts: true
264  variables:
265    IMAGE: centos9
266    MAKE_CHECK_ARGS: check
267
268functional-system-centos:
269  extends: .functional_test_job_template
270  needs:
271    - job: build-system-centos
272      artifacts: true
273  variables:
274    IMAGE: centos9
275    MAKE_CHECK_ARGS: check-avocado check-functional
276    AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx
277      arch:sh4
278
279build-system-opensuse:
280  extends:
281    - .native_build_job_template
282    - .native_build_artifact_template
283  needs:
284    job: amd64-opensuse-leap-container
285  variables:
286    IMAGE: opensuse-leap
287    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
288    MAKE_CHECK_ARGS: check-build
289
290check-system-opensuse:
291  extends: .native_test_job_template
292  needs:
293    - job: build-system-opensuse
294      artifacts: true
295  variables:
296    IMAGE: opensuse-leap
297    MAKE_CHECK_ARGS: check
298
299functional-system-opensuse:
300  extends: .functional_test_job_template
301  needs:
302    - job: build-system-opensuse
303      artifacts: true
304  variables:
305    IMAGE: opensuse-leap
306    MAKE_CHECK_ARGS: check-avocado check-functional
307    AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64
308
309#
310# Flaky tests. We don't run these by default and they are allow fail
311# but often the CI system is the only way to trigger the failures.
312#
313
314build-system-flaky:
315  extends:
316    - .native_build_job_template
317    - .native_build_artifact_template
318  needs:
319    job: amd64-debian-container
320  variables:
321    IMAGE: debian
322    QEMU_JOB_OPTIONAL: 1
323    TARGETS: aarch64-softmmu arm-softmmu mips64el-softmmu
324      ppc64-softmmu rx-softmmu s390x-softmmu sh4-softmmu x86_64-softmmu
325    MAKE_CHECK_ARGS: check-build
326
327functional-system-flaky:
328  extends: .functional_test_job_template
329  needs:
330    - job: build-system-flaky
331      artifacts: true
332  allow_failure: true
333  variables:
334    IMAGE: debian
335    MAKE_CHECK_ARGS: check-avocado check-functional
336    QEMU_JOB_OPTIONAL: 1
337    QEMU_TEST_FLAKY_TESTS: 1
338    AVOCADO_TAGS: flaky
339
340# This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
341# the configure script. The container doesn't contain Xen headers so
342# Xen accelerator is not detected / selected. As result it build the
343# i386-softmmu and x86_64-softmmu with KVM being the single accelerator
344# available.
345# Also use a different coroutine implementation (which is only really of
346# interest to KVM users, i.e. with TCG disabled)
347build-tcg-disabled:
348  extends: .native_build_job_template
349  needs:
350    job: amd64-centos9-container
351  variables:
352    IMAGE: centos9
353  script:
354    - mkdir build
355    - cd build
356    - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
357                   --disable-docs --disable-sdl --disable-gtk --disable-vnc
358      || { cat config.log meson-logs/meson-log.txt && exit 1; }
359    - make -j"$JOBS"
360    - make check-unit
361    - make check-qapi-schema
362    - cd tests/qemu-iotests/
363    - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
364            052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
365            170 171 184 192 194 208 221 226 227 236 253 277 image-fleecing
366    - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
367            124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
368            208 209 216 218 227 234 246 247 248 250 254 255 257 258
369            260 261 262 263 264 270 272 273 277 279 image-fleecing
370    - cd ../..
371    - make distclean
372
373build-user:
374  extends: .native_build_job_template
375  needs:
376    job: amd64-debian-user-cross-container
377  variables:
378    IMAGE: debian-all-test-cross
379    CONFIGURE_ARGS: --disable-tools --disable-system
380      --target-list-exclude=alpha-linux-user,sh4-linux-user
381    MAKE_CHECK_ARGS: check-tcg
382
383build-user-static:
384  extends: .native_build_job_template
385  needs:
386    job: amd64-debian-user-cross-container
387  variables:
388    IMAGE: debian-all-test-cross
389    CONFIGURE_ARGS: --disable-tools --disable-system --static
390      --target-list-exclude=alpha-linux-user,sh4-linux-user
391    MAKE_CHECK_ARGS: check-tcg
392
393# targets stuck on older compilers
394build-legacy:
395  extends: .native_build_job_template
396  needs:
397    job: amd64-debian-legacy-cross-container
398  variables:
399    IMAGE: debian-legacy-test-cross
400    TARGETS: alpha-linux-user alpha-softmmu sh4-linux-user
401    CONFIGURE_ARGS: --disable-tools
402    MAKE_CHECK_ARGS: check-tcg
403
404build-user-hexagon:
405  extends: .native_build_job_template
406  needs:
407    job: hexagon-cross-container
408  variables:
409    IMAGE: debian-hexagon-cross
410    TARGETS: hexagon-linux-user
411    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
412    MAKE_CHECK_ARGS: check-tcg
413
414# Build the softmmu targets we have check-tcg tests and compilers in
415# our omnibus all-test-cross container. Those targets that haven't got
416# Debian cross compiler support need to use special containers.
417build-some-softmmu:
418  extends: .native_build_job_template
419  needs:
420    job: amd64-debian-user-cross-container
421  variables:
422    IMAGE: debian-all-test-cross
423    CONFIGURE_ARGS: --disable-tools --enable-debug
424    TARGETS: arm-softmmu aarch64-softmmu i386-softmmu riscv64-softmmu
425      s390x-softmmu x86_64-softmmu
426    MAKE_CHECK_ARGS: check-tcg
427
428build-loongarch64:
429  extends: .native_build_job_template
430  needs:
431    job: loongarch-debian-cross-container
432  variables:
433    IMAGE: debian-loongarch-cross
434    CONFIGURE_ARGS: --disable-tools --enable-debug
435    TARGETS: loongarch64-linux-user loongarch64-softmmu
436    MAKE_CHECK_ARGS: check-tcg
437
438# We build tricore in a very minimal tricore only container
439build-tricore-softmmu:
440  extends: .native_build_job_template
441  needs:
442    job: tricore-debian-cross-container
443  variables:
444    IMAGE: debian-tricore-cross
445    CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
446    TARGETS: tricore-softmmu
447    MAKE_CHECK_ARGS: check-tcg
448
449clang-system:
450  extends: .native_build_job_template
451  needs:
452    job: amd64-fedora-container
453  variables:
454    IMAGE: fedora
455    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-ubsan
456      --extra-cflags=-fno-sanitize-recover=undefined
457    TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
458    MAKE_CHECK_ARGS: check-qtest check-tcg
459
460clang-user:
461  extends: .native_build_job_template
462  needs:
463    job: amd64-debian-user-cross-container
464  timeout: 70m
465  variables:
466    IMAGE: debian-all-test-cross
467    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system --enable-ubsan
468      --target-list-exclude=alpha-linux-user,microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
469      --extra-cflags=-fno-sanitize-recover=undefined
470    MAKE_CHECK_ARGS: check-unit check-tcg
471
472# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
473# On gitlab runners, default value sometimes end up calling 2 lds concurrently and
474# triggers an Out-Of-Memory error
475#
476# Since slirp callbacks are used in QEMU Timers, we cannot use libslirp with
477# CFI builds, and thus have to disable it here.
478#
479# Split in three sets of build/check/avocado to limit the execution time of each
480# job
481build-cfi-aarch64:
482  extends:
483    - .native_build_job_template
484    - .native_build_artifact_template
485  needs:
486  - job: amd64-fedora-container
487  variables:
488    LD_JOBS: 1
489    AR: llvm-ar
490    IMAGE: fedora
491    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
492      --enable-safe-stack --disable-slirp
493    TARGETS: aarch64-softmmu
494    MAKE_CHECK_ARGS: check-build
495    # FIXME: This job is often failing, likely due to out-of-memory problems in
496    # the constrained containers of the shared runners. Thus this is marked as
497    # skipped until the situation has been solved.
498    QEMU_JOB_SKIPPED: 1
499  timeout: 90m
500
501check-cfi-aarch64:
502  extends: .native_test_job_template
503  needs:
504    - job: build-cfi-aarch64
505      artifacts: true
506  variables:
507    IMAGE: fedora
508    MAKE_CHECK_ARGS: check
509
510functional-cfi-aarch64:
511  extends: .functional_test_job_template
512  needs:
513    - job: build-cfi-aarch64
514      artifacts: true
515  variables:
516    IMAGE: fedora
517    MAKE_CHECK_ARGS: check-avocado check-functional
518
519build-cfi-ppc64-s390x:
520  extends:
521    - .native_build_job_template
522    - .native_build_artifact_template
523  needs:
524  - job: amd64-fedora-container
525  variables:
526    LD_JOBS: 1
527    AR: llvm-ar
528    IMAGE: fedora
529    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
530      --enable-safe-stack --disable-slirp
531    TARGETS: ppc64-softmmu s390x-softmmu
532    MAKE_CHECK_ARGS: check-build
533    # FIXME: This job is often failing, likely due to out-of-memory problems in
534    # the constrained containers of the shared runners. Thus this is marked as
535    # skipped until the situation has been solved.
536    QEMU_JOB_SKIPPED: 1
537  timeout: 80m
538
539check-cfi-ppc64-s390x:
540  extends: .native_test_job_template
541  needs:
542    - job: build-cfi-ppc64-s390x
543      artifacts: true
544  variables:
545    IMAGE: fedora
546    MAKE_CHECK_ARGS: check
547
548functional-cfi-ppc64-s390x:
549  extends: .functional_test_job_template
550  needs:
551    - job: build-cfi-ppc64-s390x
552      artifacts: true
553  variables:
554    IMAGE: fedora
555    MAKE_CHECK_ARGS: check-avocado check-functional
556
557build-cfi-x86_64:
558  extends:
559    - .native_build_job_template
560    - .native_build_artifact_template
561  needs:
562  - job: amd64-fedora-container
563  variables:
564    LD_JOBS: 1
565    AR: llvm-ar
566    IMAGE: fedora
567    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
568      --enable-safe-stack --disable-slirp
569    TARGETS: x86_64-softmmu
570    MAKE_CHECK_ARGS: check-build
571  timeout: 70m
572
573check-cfi-x86_64:
574  extends: .native_test_job_template
575  needs:
576    - job: build-cfi-x86_64
577      artifacts: true
578  variables:
579    IMAGE: fedora
580    MAKE_CHECK_ARGS: check
581
582functional-cfi-x86_64:
583  extends: .functional_test_job_template
584  needs:
585    - job: build-cfi-x86_64
586      artifacts: true
587  variables:
588    IMAGE: fedora
589    MAKE_CHECK_ARGS: check-avocado check-functional
590
591tsan-build:
592  extends: .native_build_job_template
593  needs:
594    job: amd64-ubuntu2204-container
595  variables:
596    IMAGE: ubuntu2204
597    CONFIGURE_ARGS: --enable-tsan --cc=clang --cxx=clang++
598          --enable-trace-backends=ust --disable-slirp
599    TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
600    # Remove when we switch to a distro with clang >= 18
601    # https://github.com/google/sanitizers/issues/1716
602    MAKE: setarch -R make
603
604# gcov is a GCC features
605gcov:
606  extends: .native_build_job_template
607  needs:
608    job: amd64-ubuntu2204-container
609  timeout: 80m
610  variables:
611    IMAGE: ubuntu2204
612    CONFIGURE_ARGS: --enable-gcov
613    TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
614    MAKE_CHECK_ARGS: check-unit check-softfloat
615  after_script:
616    - cd build
617    - gcovr --xml-pretty --exclude-unreachable-branches --print-summary
618        -o coverage.xml --root ${CI_PROJECT_DIR} . *.p
619  coverage: /^\s*lines:\s*\d+.\d+\%/
620  artifacts:
621    name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
622    when: always
623    expire_in: 2 days
624    paths:
625      - build/meson-logs/testlog.txt
626    reports:
627      junit: build/meson-logs/testlog.junit.xml
628      coverage_report:
629        coverage_format: cobertura
630        path: build/coverage.xml
631
632build-oss-fuzz:
633  extends: .native_build_job_template
634  needs:
635    job: amd64-fedora-container
636  variables:
637    IMAGE: fedora
638  script:
639    - mkdir build-oss-fuzz
640    - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
641    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
642      ./scripts/oss-fuzz/build.sh
643    - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
644    - failures=0
645    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
646                      | grep -v slirp); do
647        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
648        echo Testing ${fuzzer} ... ;
649        "${fuzzer}" -runs=1 -seed=1 || { echo "FAILED:"" ${fuzzer} exit code is $?"; failures=$(($failures+1)); };
650      done
651    - echo "Number of failures:"" $failures"
652    - test $failures = 0
653
654build-tci:
655  extends: .native_build_job_template
656  needs:
657    job: amd64-debian-user-cross-container
658  variables:
659    IMAGE: debian-all-test-cross
660  script:
661    - TARGETS="aarch64 arm hppa m68k microblaze ppc64 s390x x86_64"
662    - mkdir build
663    - cd build
664    - ../configure --enable-tcg-interpreter --disable-kvm --disable-docs --disable-gtk --disable-vnc
665        --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
666        || { cat config.log meson-logs/meson-log.txt && exit 1; }
667    - make -j"$JOBS"
668    - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
669    - for tg in $TARGETS ; do
670        export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
671        ./tests/qtest/boot-serial-test || exit 1 ;
672        ./tests/qtest/cdrom-test || exit 1 ;
673      done
674    - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
675    - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
676    - make check-tcg
677
678# Check our reduced build configurations
679build-without-defaults:
680  extends: .native_build_job_template
681  needs:
682    job: amd64-centos9-container
683  variables:
684    IMAGE: centos9
685    CONFIGURE_ARGS:
686      --without-default-devices
687      --without-default-features
688      --disable-fdt
689      --disable-pie
690      --disable-qom-cast-debug
691      --disable-strip
692      --target-list-exclude=aarch64-softmmu,microblaze-softmmu,mips64-softmmu,mipsel-softmmu,ppc64-softmmu,sh4el-softmmu,xtensa-softmmu,x86_64-softmmu
693    MAKE_CHECK_ARGS: check
694
695build-libvhost-user:
696  extends: .base_job_template
697  stage: build
698  image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
699  needs:
700    job: amd64-fedora-container
701  script:
702    - mkdir subprojects/libvhost-user/build
703    - cd subprojects/libvhost-user/build
704    - meson
705    - ninja
706
707# No targets are built here, just tools, docs, and unit tests. This
708# also feeds into the eventual documentation deployment steps later
709build-tools-and-docs-debian:
710  extends:
711    - .native_build_job_template
712    - .native_build_artifact_template
713  needs:
714    job: amd64-debian-container
715    # when running on 'master' we use pre-existing container
716    optional: true
717  variables:
718    IMAGE: debian
719    MAKE_CHECK_ARGS: check-unit ctags TAGS cscope
720    CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
721    QEMU_JOB_PUBLISH: 1
722
723# Prepare for GitLab pages deployment. Anything copied into the
724# "public" directory will be deployed to $USER.gitlab.io/$PROJECT
725#
726# GitLab publishes from any branch that triggers a CI pipeline
727#
728# For the main repo we don't want to publish from 'staging'
729# since that content may not be pushed, nor do we wish to
730# publish from 'stable-NNN' branches as that content is outdated.
731# Thus we restrict to just the default branch
732#
733# For contributor forks we want to publish from any repo so
734# that users can see the results of their commits, regardless
735# of what topic branch they're currently using
736pages:
737  extends: .base_job_template
738  image: $CI_REGISTRY_IMAGE/qemu/debian:$QEMU_CI_CONTAINER_TAG
739  stage: test
740  needs:
741    - job: build-tools-and-docs-debian
742  script:
743    - mkdir -p public
744    # HTML-ised source tree
745    - make gtags
746    # We unset variables to work around a bug in some htags versions
747    # which causes it to fail when the environment is large
748    - CI_COMMIT_MESSAGE= CI_COMMIT_TAG_MESSAGE= htags
749        -anT --tree-view=filetree -m qemu_init
750        -t "Welcome to the QEMU sourcecode"
751    - mv HTML public/src
752    # Project documentation
753    - make -C build install DESTDIR=$(pwd)/temp-install
754    - mv temp-install/usr/local/share/doc/qemu/* public/
755  artifacts:
756    when: on_success
757    paths:
758      - public
759  variables:
760    QEMU_JOB_PUBLISH: 1
761
762coverity:
763  image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
764  stage: build
765  allow_failure: true
766  timeout: 3h
767  needs:
768    - job: amd64-fedora-container
769      optional: true
770  before_script:
771    - dnf install -y curl wget
772  script:
773    # would be nice to cancel the job if over quota (https://gitlab.com/gitlab-org/gitlab/-/issues/256089)
774    # for example:
775    #   curl --request POST --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/cancel
776    - 'scripts/coverity-scan/run-coverity-scan --check-upload-only || { exitcode=$?; if test $exitcode = 1; then
777        exit 0;
778      else
779        exit $exitcode;
780      fi; };
781      scripts/coverity-scan/run-coverity-scan --update-tools-only > update-tools.log 2>&1 || { cat update-tools.log; exit 1; };
782      scripts/coverity-scan/run-coverity-scan --no-update-tools'
783  rules:
784    - if: '$COVERITY_TOKEN == null'
785      when: never
786    - if: '$COVERITY_EMAIL == null'
787      when: never
788    # Never included on upstream pipelines, except for schedules
789    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_PIPELINE_SOURCE == "schedule"'
790      when: on_success
791    - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM'
792      when: never
793    # Forks don't get any pipeline unless QEMU_CI=1 or QEMU_CI=2 is set
794    - if: '$QEMU_CI != "1" && $QEMU_CI != "2"'
795      when: never
796    # Always manual on forks even if $QEMU_CI == "2"
797    - when: manual
798