xref: /qemu/.gitlab-ci.yml (revision 07df3dfa)
1include:
2  - local: '/.gitlab-ci.d/stages.yml'
3  - local: '/.gitlab-ci.d/edk2.yml'
4  - local: '/.gitlab-ci.d/opensbi.yml'
5  - local: '/.gitlab-ci.d/containers.yml'
6  - local: '/.gitlab-ci.d/crossbuilds.yml'
7  - local: '/.gitlab-ci.d/static_checks.yml'
8
9.native_build_job_template:
10  stage: build
11  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
12  before_script:
13    - JOBS=$(expr $(nproc) + 1)
14  script:
15    - if test -n "$LD_JOBS";
16      then
17        scripts/git-submodule.sh update meson ;
18      fi
19    - mkdir build
20    - cd build
21    - if test -n "$TARGETS";
22      then
23        ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=git} $CONFIGURE_ARGS --target-list="$TARGETS" ;
24      else
25        ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=git} $CONFIGURE_ARGS ;
26      fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
27    - if test -n "$LD_JOBS";
28      then
29        ../meson/meson.py configure . -Dbackend_max_links="$LD_JOBS" ;
30      fi || exit 1;
31    - make -j"$JOBS"
32    - if test -n "$MAKE_CHECK_ARGS";
33      then
34        make -j"$JOBS" $MAKE_CHECK_ARGS ;
35      fi
36
37.native_test_job_template:
38  stage: test
39  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
40  script:
41    - scripts/git-submodule.sh update
42        $(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
43    - cd build
44    - find . -type f -exec touch {} +
45    # Avoid recompiling by hiding ninja with NINJA=":"
46    - make NINJA=":" $MAKE_CHECK_ARGS
47
48.acceptance_test_job_template:
49  extends: .native_test_job_template
50  cache:
51    key: "${CI_JOB_NAME}-cache"
52    paths:
53      - ${CI_PROJECT_DIR}/avocado-cache
54    policy: pull-push
55  artifacts:
56    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
57    when: always
58    expire_in: 2 days
59    paths:
60      - build/tests/results/latest/results.xml
61      - build/tests/results/latest/test-results
62    reports:
63      junit: build/tests/results/latest/results.xml
64  before_script:
65    - mkdir -p ~/.config/avocado
66    - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
67    - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
68           >> ~/.config/avocado/avocado.conf
69    - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
70           >> ~/.config/avocado/avocado.conf
71    - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
72        du -chs ${CI_PROJECT_DIR}/avocado-cache ;
73      fi
74    - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
75  after_script:
76    - cd build
77    - du -chs ${CI_PROJECT_DIR}/avocado-cache
78
79build-system-alpine:
80  extends: .native_build_job_template
81  needs:
82    - job: amd64-alpine-container
83  variables:
84    IMAGE: alpine
85    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
86      microblazeel-softmmu mips64el-softmmu
87    MAKE_CHECK_ARGS: check-build
88    CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
89  artifacts:
90    expire_in: 2 days
91    paths:
92      - .git-submodule-status
93      - build
94
95check-system-alpine:
96  extends: .native_test_job_template
97  needs:
98    - job: build-system-alpine
99      artifacts: true
100  variables:
101    IMAGE: alpine
102    MAKE_CHECK_ARGS: check
103
104acceptance-system-alpine:
105  extends: .acceptance_test_job_template
106  needs:
107    - job: build-system-alpine
108      artifacts: true
109  variables:
110    IMAGE: alpine
111    MAKE_CHECK_ARGS: check-acceptance
112
113build-system-ubuntu:
114  extends: .native_build_job_template
115  needs:
116    job: amd64-ubuntu2004-container
117  variables:
118    IMAGE: ubuntu2004
119    CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
120    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
121      microblazeel-softmmu mips64el-softmmu
122    MAKE_CHECK_ARGS: check-build
123  artifacts:
124    expire_in: 2 days
125    paths:
126      - build
127
128check-system-ubuntu:
129  extends: .native_test_job_template
130  needs:
131    - job: build-system-ubuntu
132      artifacts: true
133  variables:
134    IMAGE: ubuntu2004
135    MAKE_CHECK_ARGS: check
136
137acceptance-system-ubuntu:
138  extends: .acceptance_test_job_template
139  needs:
140    - job: build-system-ubuntu
141      artifacts: true
142  variables:
143    IMAGE: ubuntu2004
144    MAKE_CHECK_ARGS: check-acceptance
145
146build-system-debian:
147  extends: .native_build_job_template
148  needs:
149    job: amd64-debian-container
150  variables:
151    IMAGE: debian-amd64
152    CONFIGURE_ARGS: --enable-fdt=system
153    TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
154      riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
155    MAKE_CHECK_ARGS: check-build
156  artifacts:
157    expire_in: 2 days
158    paths:
159      - build
160
161check-system-debian:
162  extends: .native_test_job_template
163  needs:
164    - job: build-system-debian
165      artifacts: true
166  variables:
167    IMAGE: debian-amd64
168    MAKE_CHECK_ARGS: check
169
170acceptance-system-debian:
171  extends: .acceptance_test_job_template
172  needs:
173    - job: build-system-debian
174      artifacts: true
175  variables:
176    IMAGE: debian-amd64
177    MAKE_CHECK_ARGS: check-acceptance
178
179build-system-fedora:
180  extends: .native_build_job_template
181  needs:
182    job: amd64-fedora-container
183  variables:
184    IMAGE: fedora
185    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
186             --enable-fdt=system --enable-slirp=system --enable-capstone=system
187    TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
188      xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
189    MAKE_CHECK_ARGS: check-build
190  artifacts:
191    expire_in: 2 days
192    paths:
193      - build
194
195check-system-fedora:
196  extends: .native_test_job_template
197  needs:
198    - job: build-system-fedora
199      artifacts: true
200  variables:
201    IMAGE: fedora
202    MAKE_CHECK_ARGS: check
203
204acceptance-system-fedora:
205  extends: .acceptance_test_job_template
206  needs:
207    - job: build-system-fedora
208      artifacts: true
209  variables:
210    IMAGE: fedora
211    MAKE_CHECK_ARGS: check-acceptance
212
213build-system-centos:
214  extends: .native_build_job_template
215  needs:
216    job: amd64-centos8-container
217  variables:
218    IMAGE: centos8
219    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
220                    --enable-modules --enable-trace-backends=dtrace
221    TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
222      x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
223    MAKE_CHECK_ARGS: check-build
224  artifacts:
225    expire_in: 2 days
226    paths:
227      - build
228
229check-system-centos:
230  extends: .native_test_job_template
231  needs:
232    - job: build-system-centos
233      artifacts: true
234  variables:
235    IMAGE: centos8
236    MAKE_CHECK_ARGS: check
237
238acceptance-system-centos:
239  extends: .acceptance_test_job_template
240  needs:
241    - job: build-system-centos
242      artifacts: true
243  variables:
244    IMAGE: centos8
245    MAKE_CHECK_ARGS: check-acceptance
246
247build-system-opensuse:
248  extends: .native_build_job_template
249  needs:
250    job: amd64-opensuse-leap-container
251  variables:
252    IMAGE: opensuse-leap
253    CONFIGURE_ARGS: --enable-fdt=system
254    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
255    MAKE_CHECK_ARGS: check-build
256  artifacts:
257    expire_in: 2 days
258    paths:
259      - build
260
261check-system-opensuse:
262  extends: .native_test_job_template
263  needs:
264    - job: build-system-opensuse
265      artifacts: true
266  variables:
267    IMAGE: opensuse-leap
268    MAKE_CHECK_ARGS: check
269
270acceptance-system-opensuse:
271  extends: .acceptance_test_job_template
272  needs:
273    - job: build-system-opensuse
274      artifacts: true
275  variables:
276    IMAGE: opensuse-leap
277    MAKE_CHECK_ARGS: check-acceptance
278
279
280build-disabled:
281  extends: .native_build_job_template
282  needs:
283    job: amd64-fedora-container
284  variables:
285    IMAGE: fedora
286    CONFIGURE_ARGS:
287      --disable-attr
288      --disable-auth-pam
289      --disable-avx2
290      --disable-bochs
291      --disable-brlapi
292      --disable-bzip2
293      --disable-cap-ng
294      --disable-capstone
295      --disable-cloop
296      --disable-coroutine-pool
297      --disable-curl
298      --disable-curses
299      --disable-dmg
300      --disable-docs
301      --disable-gcrypt
302      --disable-glusterfs
303      --disable-gnutls
304      --disable-gtk
305      --disable-guest-agent
306      --disable-iconv
307      --disable-keyring
308      --disable-kvm
309      --disable-libiscsi
310      --disable-libpmem
311      --disable-libssh
312      --disable-libudev
313      --disable-libusb
314      --disable-libxml2
315      --disable-linux-aio
316      --disable-live-block-migration
317      --disable-lzo
318      --disable-malloc-trim
319      --disable-mpath
320      --disable-nettle
321      --disable-numa
322      --disable-opengl
323      --disable-parallels
324      --disable-pie
325      --disable-qcow1
326      --disable-qed
327      --disable-qom-cast-debug
328      --disable-rbd
329      --disable-rdma
330      --disable-replication
331      --disable-sdl
332      --disable-seccomp
333      --disable-slirp
334      --disable-smartcard
335      --disable-snappy
336      --disable-sparse
337      --disable-spice
338      --disable-strip
339      --disable-tpm
340      --disable-usb-redir
341      --disable-vdi
342      --disable-vhost-crypto
343      --disable-vhost-net
344      --disable-vhost-scsi
345      --disable-vhost-kernel
346      --disable-vhost-user
347      --disable-vhost-vdpa
348      --disable-vhost-vsock
349      --disable-virglrenderer
350      --disable-vnc
351      --disable-vte
352      --disable-vvfat
353      --disable-xen
354      --disable-zstd
355    TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
356      s390x-softmmu i386-linux-user
357    MAKE_CHECK_ARGS: check-qtest SPEED=slow
358
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
363# available.
364# Also use a different coroutine implementation (which is only really of
365# interest to KVM users, i.e. with TCG disabled)
366build-tcg-disabled:
367  extends: .native_build_job_template
368  needs:
369    job: amd64-centos8-container
370  variables:
371    IMAGE: centos8
372  script:
373    - mkdir build
374    - cd build
375    - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
376      || { cat config.log meson-logs/meson-log.txt && exit 1; }
377    - make -j"$JOBS"
378    - make check-unit
379    - make check-qapi-schema
380    - cd tests/qemu-iotests/
381    - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
382            052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
383            170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
384    - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
385            124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
386            208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
387            260 261 262 263 264 270 272 273 277 279
388
389build-user:
390  extends: .native_build_job_template
391  needs:
392    job: amd64-debian-user-cross-container
393  variables:
394    IMAGE: debian-all-test-cross
395    CONFIGURE_ARGS: --disable-tools --disable-system
396    MAKE_CHECK_ARGS: check-tcg
397
398build-user-static:
399  extends: .native_build_job_template
400  needs:
401    job: amd64-debian-user-cross-container
402  variables:
403    IMAGE: debian-all-test-cross
404    CONFIGURE_ARGS: --disable-tools --disable-system --static
405    MAKE_CHECK_ARGS: check-tcg
406
407# Because the hexagon cross-compiler takes so long to build we don't rely
408# on the CI system to build it and hence this job has an optional dependency
409# declared. The image is manually uploaded.
410build-user-hexagon:
411  extends: .native_build_job_template
412  needs:
413    job: hexagon-cross-container
414    optional: true
415  variables:
416    IMAGE: debian-hexagon-cross
417    TARGETS: hexagon-linux-user
418    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
419    MAKE_CHECK_ARGS: check-tcg
420
421# Only build the softmmu targets we have check-tcg tests for
422build-some-softmmu:
423  extends: .native_build_job_template
424  needs:
425    job: amd64-debian-user-cross-container
426  variables:
427    IMAGE: debian-all-test-cross
428    CONFIGURE_ARGS: --disable-tools --enable-debug
429    TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
430    MAKE_CHECK_ARGS: check-tcg
431
432# Run check-tcg against linux-user (with plugins)
433# we skip sparc64-linux-user until it has been fixed somewhat
434# we skip cris-linux-user as it doesn't use the common run loop
435build-user-plugins:
436  extends: .native_build_job_template
437  needs:
438    job: amd64-debian-user-cross-container
439  variables:
440    IMAGE: debian-all-test-cross
441    CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
442    MAKE_CHECK_ARGS: check-tcg
443  timeout: 1h 30m
444
445build-user-centos7:
446  extends: .native_build_job_template
447  needs:
448    job: amd64-centos7-container
449  variables:
450    IMAGE: centos7
451    CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
452    MAKE_CHECK_ARGS: check-tcg
453
454build-some-softmmu-plugins:
455  extends: .native_build_job_template
456  needs:
457    job: amd64-debian-user-cross-container
458  variables:
459    IMAGE: debian-all-test-cross
460    CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
461    TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
462    MAKE_CHECK_ARGS: check-tcg
463
464clang-system:
465  extends: .native_build_job_template
466  needs:
467    job: amd64-fedora-container
468  variables:
469    IMAGE: fedora
470    CONFIGURE_ARGS: --cc=clang --cxx=clang++
471      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
472    TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
473      ppc-softmmu s390x-softmmu
474    MAKE_CHECK_ARGS: check-qtest check-tcg
475
476clang-user:
477  extends: .native_build_job_template
478  needs:
479    job: amd64-debian-user-cross-container
480  variables:
481    IMAGE: debian-all-test-cross
482    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
483      --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
484      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
485    MAKE_CHECK_ARGS: check-unit check-tcg
486
487# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
488# On gitlab runners, default value sometimes end up calling 2 lds concurrently and
489# triggers an Out-Of-Memory error
490#
491# Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
492# with QEMU and linked as a static library to avoid false positives in CFI checks.
493# This can be accomplished by using -enable-slirp=git, which avoids the use of
494# a system-wide version of the library
495#
496# Split in three sets of build/check/acceptance to limit the execution time of each
497# job
498build-cfi-aarch64:
499  extends: .native_build_job_template
500  needs:
501  - job: amd64-fedora-container
502  variables:
503    LD_JOBS: 1
504    AR: llvm-ar
505    IMAGE: fedora
506    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
507      --enable-safe-stack --enable-slirp=git
508    TARGETS: aarch64-softmmu
509    MAKE_CHECK_ARGS: check-build
510  timeout: 70m
511  artifacts:
512    expire_in: 2 days
513    paths:
514      - build
515
516check-cfi-aarch64:
517  extends: .native_test_job_template
518  needs:
519    - job: build-cfi-aarch64
520      artifacts: true
521  variables:
522    IMAGE: fedora
523    MAKE_CHECK_ARGS: check
524
525acceptance-cfi-aarch64:
526  extends: .acceptance_test_job_template
527  needs:
528    - job: build-cfi-aarch64
529      artifacts: true
530  variables:
531    IMAGE: fedora
532    MAKE_CHECK_ARGS: check-acceptance
533
534build-cfi-ppc64-s390x:
535  extends: .native_build_job_template
536  needs:
537  - job: amd64-fedora-container
538  variables:
539    LD_JOBS: 1
540    AR: llvm-ar
541    IMAGE: fedora
542    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
543      --enable-safe-stack --enable-slirp=git
544    TARGETS: ppc64-softmmu s390x-softmmu
545    MAKE_CHECK_ARGS: check-build
546  timeout: 70m
547  artifacts:
548    expire_in: 2 days
549    paths:
550      - build
551
552check-cfi-ppc64-s390x:
553  extends: .native_test_job_template
554  needs:
555    - job: build-cfi-ppc64-s390x
556      artifacts: true
557  variables:
558    IMAGE: fedora
559    MAKE_CHECK_ARGS: check
560
561acceptance-cfi-ppc64-s390x:
562  extends: .acceptance_test_job_template
563  needs:
564    - job: build-cfi-ppc64-s390x
565      artifacts: true
566  variables:
567    IMAGE: fedora
568    MAKE_CHECK_ARGS: check-acceptance
569
570build-cfi-x86_64:
571  extends: .native_build_job_template
572  needs:
573  - job: amd64-fedora-container
574  variables:
575    LD_JOBS: 1
576    AR: llvm-ar
577    IMAGE: fedora
578    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
579      --enable-safe-stack --enable-slirp=git
580    TARGETS: x86_64-softmmu
581    MAKE_CHECK_ARGS: check-build
582  timeout: 70m
583  artifacts:
584    expire_in: 2 days
585    paths:
586      - build
587
588check-cfi-x86_64:
589  extends: .native_test_job_template
590  needs:
591    - job: build-cfi-x86_64
592      artifacts: true
593  variables:
594    IMAGE: fedora
595    MAKE_CHECK_ARGS: check
596
597acceptance-cfi-x86_64:
598  extends: .acceptance_test_job_template
599  needs:
600    - job: build-cfi-x86_64
601      artifacts: true
602  variables:
603    IMAGE: fedora
604    MAKE_CHECK_ARGS: check-acceptance
605
606tsan-build:
607  extends: .native_build_job_template
608  needs:
609    job: amd64-ubuntu2004-container
610  variables:
611    IMAGE: ubuntu2004
612    CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
613          --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
614    TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
615    MAKE_CHECK_ARGS: bench V=1
616
617# These targets are on the way out
618build-deprecated:
619  extends: .native_build_job_template
620  needs:
621    job: amd64-debian-user-cross-container
622  variables:
623    IMAGE: debian-all-test-cross
624    CONFIGURE_ARGS: --disable-tools
625    MAKE_CHECK_ARGS: build-tcg
626    TARGETS: ppc64abi32-linux-user
627  artifacts:
628    expire_in: 2 days
629    paths:
630      - build
631
632# We split the check-tcg step as test failures are expected but we still
633# want to catch the build breaking.
634check-deprecated:
635  extends: .native_test_job_template
636  needs:
637    - job: build-deprecated
638      artifacts: true
639  variables:
640    IMAGE: debian-all-test-cross
641    MAKE_CHECK_ARGS: check-tcg
642  allow_failure: true
643
644# gprof/gcov are GCC features
645gprof-gcov:
646  extends: .native_build_job_template
647  needs:
648    job: amd64-ubuntu2004-container
649  variables:
650    IMAGE: ubuntu2004
651    CONFIGURE_ARGS: --enable-gprof --enable-gcov
652    MAKE_CHECK_ARGS: check
653    TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
654  timeout: 70m
655  after_script:
656    - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
657
658build-oss-fuzz:
659  extends: .native_build_job_template
660  needs:
661    job: amd64-fedora-container
662  variables:
663    IMAGE: fedora
664  script:
665    - mkdir build-oss-fuzz
666    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
667      ./scripts/oss-fuzz/build.sh
668    - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
669    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
670                      | grep -v slirp); do
671        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
672        echo Testing ${fuzzer} ... ;
673        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
674      done
675    # Unrelated to fuzzer: run some tests with -fsanitize=address
676    - cd build-oss-fuzz && make check-qtest-i386 check-unit
677
678build-tci:
679  extends: .native_build_job_template
680  needs:
681    job: amd64-debian-user-cross-container
682  variables:
683    IMAGE: debian-all-test-cross
684  script:
685    - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
686    - mkdir build
687    - cd build
688    - ../configure --enable-tcg-interpreter
689        --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
690    - make -j"$JOBS"
691    - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
692    - for tg in $TARGETS ; do
693        export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
694        ./tests/qtest/boot-serial-test || exit 1 ;
695        ./tests/qtest/cdrom-test || exit 1 ;
696      done
697    - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
698    - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
699    - make check-tcg
700
701# Alternate coroutines implementations are only really of interest to KVM users
702# However we can't test against KVM on Gitlab-CI so we can only run unit tests
703build-coroutine-sigaltstack:
704  extends: .native_build_job_template
705  needs:
706    job: amd64-ubuntu2004-container
707  variables:
708    IMAGE: ubuntu2004
709    CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
710                    --enable-trace-backends=ftrace
711    MAKE_CHECK_ARGS: check-unit
712
713# Most jobs test latest gcrypt or nettle builds
714#
715# These jobs test old gcrypt and nettle from RHEL7
716# which had some API differences.
717crypto-old-nettle:
718  extends: .native_build_job_template
719  needs:
720    job: amd64-centos7-container
721  variables:
722    IMAGE: centos7
723    TARGETS: x86_64-softmmu x86_64-linux-user
724    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
725    MAKE_CHECK_ARGS: check
726
727crypto-old-gcrypt:
728  extends: .native_build_job_template
729  needs:
730    job: amd64-centos7-container
731  variables:
732    IMAGE: centos7
733    TARGETS: x86_64-softmmu x86_64-linux-user
734    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
735    MAKE_CHECK_ARGS: check
736
737crypto-only-gnutls:
738  extends: .native_build_job_template
739  needs:
740    job: amd64-centos7-container
741  variables:
742    IMAGE: centos7
743    TARGETS: x86_64-softmmu x86_64-linux-user
744    CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
745    MAKE_CHECK_ARGS: check
746
747
748# Check our reduced build configurations
749build-without-default-devices:
750  extends: .native_build_job_template
751  needs:
752    job: amd64-centos8-container
753  variables:
754    IMAGE: centos8
755    CONFIGURE_ARGS: --without-default-devices --disable-user
756
757build-without-default-features:
758  extends: .native_build_job_template
759  needs:
760    job: amd64-debian-container
761  variables:
762    IMAGE: debian-amd64
763    CONFIGURE_ARGS: --without-default-features --disable-user
764        --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
765    MAKE_CHECK_ARGS: check-unit
766
767build-libvhost-user:
768  stage: build
769  image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
770  needs:
771    job: amd64-fedora-container
772  before_script:
773    - dnf install -y meson ninja-build
774  script:
775    - mkdir subprojects/libvhost-user/build
776    - cd subprojects/libvhost-user/build
777    - meson
778    - ninja
779
780# No targets are built here, just tools, docs, and unit tests. This
781# also feeds into the eventual documentation deployment steps later
782build-tools-and-docs-debian:
783  extends: .native_build_job_template
784  needs:
785    job: amd64-debian-container
786  variables:
787    IMAGE: debian-amd64
788    MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
789    CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
790  artifacts:
791    expire_in: 2 days
792    paths:
793      - build
794
795# Prepare for GitLab pages deployment. Anything copied into the
796# "public" directory will be deployed to $USER.gitlab.io/$PROJECT
797pages:
798  image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
799  stage: test
800  needs:
801    - job: build-tools-and-docs-debian
802  script:
803    - mkdir -p public
804    # HTML-ised source tree
805    - make gtags
806    - htags -anT --tree-view=filetree -m qemu_init
807        -t "Welcome to the QEMU sourcecode"
808    - mv HTML public/src
809    # Project documentation
810    - make -C build install DESTDIR=$(pwd)/temp-install
811    - mv temp-install/usr/local/share/doc/qemu/* public/
812  artifacts:
813    paths:
814      - public
815