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