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