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