xref: /openbmc/qemu/.gitlab-ci.d/buildtest.yml (revision 63dd7bcb)
1include:
2  - local: '/.gitlab-ci.d/buildtest-template.yml'
3
4build-system-alpine:
5  extends: .native_build_job_template
6  needs:
7    - job: amd64-alpine-container
8  variables:
9    IMAGE: alpine
10    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
11      microblazeel-softmmu mips64el-softmmu
12    MAKE_CHECK_ARGS: check-build
13    CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
14  artifacts:
15    expire_in: 2 days
16    paths:
17      - .git-submodule-status
18      - build
19
20check-system-alpine:
21  extends: .native_test_job_template
22  needs:
23    - job: build-system-alpine
24      artifacts: true
25  variables:
26    IMAGE: alpine
27    MAKE_CHECK_ARGS: check-unit check-qtest
28
29avocado-system-alpine:
30  extends: .avocado_test_job_template
31  needs:
32    - job: build-system-alpine
33      artifacts: true
34  variables:
35    IMAGE: alpine
36    MAKE_CHECK_ARGS: check-avocado
37
38build-system-ubuntu:
39  extends: .native_build_job_template
40  needs:
41    job: amd64-ubuntu2004-container
42  variables:
43    IMAGE: ubuntu2004
44    CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
45        --enable-capstone
46    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
47      microblazeel-softmmu mips64el-softmmu
48    MAKE_CHECK_ARGS: check-build
49  artifacts:
50    expire_in: 2 days
51    paths:
52      - build
53
54check-system-ubuntu:
55  extends: .native_test_job_template
56  needs:
57    - job: build-system-ubuntu
58      artifacts: true
59  variables:
60    IMAGE: ubuntu2004
61    MAKE_CHECK_ARGS: check
62
63avocado-system-ubuntu:
64  extends: .avocado_test_job_template
65  needs:
66    - job: build-system-ubuntu
67      artifacts: true
68  variables:
69    IMAGE: ubuntu2004
70    MAKE_CHECK_ARGS: check-avocado
71
72build-system-debian:
73  extends: .native_build_job_template
74  needs:
75    job: amd64-debian-container
76  variables:
77    IMAGE: debian-amd64
78    TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
79      riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
80    MAKE_CHECK_ARGS: check-build
81  artifacts:
82    expire_in: 2 days
83    paths:
84      - build
85
86check-system-debian:
87  extends: .native_test_job_template
88  needs:
89    - job: build-system-debian
90      artifacts: true
91  variables:
92    IMAGE: debian-amd64
93    MAKE_CHECK_ARGS: check
94
95avocado-system-debian:
96  extends: .avocado_test_job_template
97  needs:
98    - job: build-system-debian
99      artifacts: true
100  variables:
101    IMAGE: debian-amd64
102    MAKE_CHECK_ARGS: check-avocado
103
104crash-test-debian:
105  extends: .native_test_job_template
106  needs:
107    - job: build-system-debian
108      artifacts: true
109  variables:
110    IMAGE: debian-amd64
111  script:
112    - cd build
113    - make check-venv
114    - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-i386
115
116build-system-fedora:
117  extends: .native_build_job_template
118  needs:
119    job: amd64-fedora-container
120  variables:
121    IMAGE: fedora
122    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
123             --enable-fdt=system --enable-slirp=system --enable-capstone
124    TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
125      xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
126    MAKE_CHECK_ARGS: check-build
127  artifacts:
128    expire_in: 2 days
129    paths:
130      - build
131
132check-system-fedora:
133  extends: .native_test_job_template
134  needs:
135    - job: build-system-fedora
136      artifacts: true
137  variables:
138    IMAGE: fedora
139    MAKE_CHECK_ARGS: check
140
141avocado-system-fedora:
142  extends: .avocado_test_job_template
143  needs:
144    - job: build-system-fedora
145      artifacts: true
146  variables:
147    IMAGE: fedora
148    MAKE_CHECK_ARGS: check-avocado
149
150crash-test-fedora:
151  extends: .native_test_job_template
152  needs:
153    - job: build-system-fedora
154      artifacts: true
155  variables:
156    IMAGE: fedora
157  script:
158    - cd build
159    - make check-venv
160    - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
161    - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
162
163build-system-centos:
164  extends: .native_build_job_template
165  needs:
166    job: amd64-centos8-container
167  variables:
168    IMAGE: centos8
169    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
170      --enable-modules --enable-trace-backends=dtrace --enable-docs
171      --enable-vfio-user-server
172    TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
173      x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
174    MAKE_CHECK_ARGS: check-build
175  artifacts:
176    expire_in: 2 days
177    paths:
178      - build
179
180check-system-centos:
181  extends: .native_test_job_template
182  needs:
183    - job: build-system-centos
184      artifacts: true
185  variables:
186    IMAGE: centos8
187    MAKE_CHECK_ARGS: check
188
189avocado-system-centos:
190  extends: .avocado_test_job_template
191  needs:
192    - job: build-system-centos
193      artifacts: true
194  variables:
195    IMAGE: centos8
196    MAKE_CHECK_ARGS: check-avocado
197
198build-system-opensuse:
199  extends: .native_build_job_template
200  needs:
201    job: amd64-opensuse-leap-container
202  variables:
203    IMAGE: opensuse-leap
204    CONFIGURE_ARGS: --enable-fdt=system
205    TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
206    MAKE_CHECK_ARGS: check-build
207  artifacts:
208    expire_in: 2 days
209    paths:
210      - build
211
212check-system-opensuse:
213  extends: .native_test_job_template
214  needs:
215    - job: build-system-opensuse
216      artifacts: true
217  variables:
218    IMAGE: opensuse-leap
219    MAKE_CHECK_ARGS: check
220
221avocado-system-opensuse:
222  extends: .avocado_test_job_template
223  needs:
224    - job: build-system-opensuse
225      artifacts: true
226  variables:
227    IMAGE: opensuse-leap
228    MAKE_CHECK_ARGS: check-avocado
229
230
231# This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
232# the configure script. The container doesn't contain Xen headers so
233# Xen accelerator is not detected / selected. As result it build the
234# i386-softmmu and x86_64-softmmu with KVM being the single accelerator
235# available.
236# Also use a different coroutine implementation (which is only really of
237# interest to KVM users, i.e. with TCG disabled)
238build-tcg-disabled:
239  extends: .native_build_job_template
240  needs:
241    job: amd64-centos8-container
242  variables:
243    IMAGE: centos8
244  script:
245    - mkdir build
246    - cd build
247    - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
248      || { cat config.log meson-logs/meson-log.txt && exit 1; }
249    - make -j"$JOBS"
250    - make check-unit
251    - make check-qapi-schema
252    - cd tests/qemu-iotests/
253    - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
254            052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
255            170 171 183 184 192 194 208 221 226 227 236 253 277 image-fleecing
256    - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
257            124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
258            208 209 216 218 227 234 246 247 248 250 254 255 257 258
259            260 261 262 263 264 270 272 273 277 279 image-fleecing
260
261build-user:
262  extends: .native_build_job_template
263  needs:
264    job: amd64-debian-user-cross-container
265  variables:
266    IMAGE: debian-all-test-cross
267    CONFIGURE_ARGS: --disable-tools --disable-system
268    MAKE_CHECK_ARGS: check-tcg
269
270build-user-static:
271  extends: .native_build_job_template
272  needs:
273    job: amd64-debian-user-cross-container
274  variables:
275    IMAGE: debian-all-test-cross
276    CONFIGURE_ARGS: --disable-tools --disable-system --static
277    MAKE_CHECK_ARGS: check-tcg
278
279# Because the hexagon cross-compiler takes so long to build we don't rely
280# on the CI system to build it and hence this job has an optional dependency
281# declared. The image is manually uploaded.
282build-user-hexagon:
283  extends: .native_build_job_template
284  needs:
285    job: hexagon-cross-container
286    optional: true
287  variables:
288    IMAGE: debian-hexagon-cross
289    TARGETS: hexagon-linux-user
290    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
291    MAKE_CHECK_ARGS: check-tcg
292
293# Only build the softmmu targets we have check-tcg tests for
294build-some-softmmu:
295  extends: .native_build_job_template
296  needs:
297    job: amd64-debian-user-cross-container
298  variables:
299    IMAGE: debian-all-test-cross
300    CONFIGURE_ARGS: --disable-tools --enable-debug
301    TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
302    MAKE_CHECK_ARGS: check-tcg
303
304# We build tricore in a very minimal tricore only container
305build-tricore-softmmu:
306  extends: .native_build_job_template
307  needs:
308    job: tricore-debian-cross-container
309  variables:
310    IMAGE: debian-tricore-cross
311    CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
312    TARGETS: tricore-softmmu
313    MAKE_CHECK_ARGS: check-tcg
314
315clang-system:
316  extends: .native_build_job_template
317  needs:
318    job: amd64-fedora-container
319  variables:
320    IMAGE: fedora
321    CONFIGURE_ARGS: --cc=clang --cxx=clang++
322      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
323    TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
324      ppc-softmmu s390x-softmmu
325    MAKE_CHECK_ARGS: check-qtest check-tcg
326
327clang-user:
328  extends: .native_build_job_template
329  needs:
330    job: amd64-debian-user-cross-container
331  variables:
332    IMAGE: debian-all-test-cross
333    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
334      --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
335      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
336    MAKE_CHECK_ARGS: check-unit check-tcg
337
338# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
339# On gitlab runners, default value sometimes end up calling 2 lds concurrently and
340# triggers an Out-Of-Memory error
341#
342# Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
343# with QEMU and linked as a static library to avoid false positives in CFI checks.
344# This can be accomplished by using -enable-slirp=git, which avoids the use of
345# a system-wide version of the library
346#
347# Split in three sets of build/check/avocado to limit the execution time of each
348# job
349build-cfi-aarch64:
350  extends: .native_build_job_template
351  needs:
352  - job: amd64-fedora-container
353  variables:
354    LD_JOBS: 1
355    AR: llvm-ar
356    IMAGE: fedora
357    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
358      --enable-safe-stack --enable-slirp=git
359    TARGETS: aarch64-softmmu
360    MAKE_CHECK_ARGS: check-build
361    # FIXME: This job is often failing, likely due to out-of-memory problems in
362    # the constrained containers of the shared runners. Thus this is marked as
363    # skipped until the situation has been solved.
364    QEMU_JOB_SKIPPED: 1
365  timeout: 90m
366  artifacts:
367    expire_in: 2 days
368    paths:
369      - build
370
371check-cfi-aarch64:
372  extends: .native_test_job_template
373  needs:
374    - job: build-cfi-aarch64
375      artifacts: true
376  variables:
377    IMAGE: fedora
378    MAKE_CHECK_ARGS: check
379
380avocado-cfi-aarch64:
381  extends: .avocado_test_job_template
382  needs:
383    - job: build-cfi-aarch64
384      artifacts: true
385  variables:
386    IMAGE: fedora
387    MAKE_CHECK_ARGS: check-avocado
388
389build-cfi-ppc64-s390x:
390  extends: .native_build_job_template
391  needs:
392  - job: amd64-fedora-container
393  variables:
394    LD_JOBS: 1
395    AR: llvm-ar
396    IMAGE: fedora
397    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
398      --enable-safe-stack --enable-slirp=git
399    TARGETS: ppc64-softmmu s390x-softmmu
400    MAKE_CHECK_ARGS: check-build
401    # FIXME: This job is often failing, likely due to out-of-memory problems in
402    # the constrained containers of the shared runners. Thus this is marked as
403    # skipped until the situation has been solved.
404    QEMU_JOB_SKIPPED: 1
405  timeout: 80m
406  artifacts:
407    expire_in: 2 days
408    paths:
409      - build
410
411check-cfi-ppc64-s390x:
412  extends: .native_test_job_template
413  needs:
414    - job: build-cfi-ppc64-s390x
415      artifacts: true
416  variables:
417    IMAGE: fedora
418    MAKE_CHECK_ARGS: check
419
420avocado-cfi-ppc64-s390x:
421  extends: .avocado_test_job_template
422  needs:
423    - job: build-cfi-ppc64-s390x
424      artifacts: true
425  variables:
426    IMAGE: fedora
427    MAKE_CHECK_ARGS: check-avocado
428
429build-cfi-x86_64:
430  extends: .native_build_job_template
431  needs:
432  - job: amd64-fedora-container
433  variables:
434    LD_JOBS: 1
435    AR: llvm-ar
436    IMAGE: fedora
437    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
438      --enable-safe-stack --enable-slirp=git
439    TARGETS: x86_64-softmmu
440    MAKE_CHECK_ARGS: check-build
441  timeout: 70m
442  artifacts:
443    expire_in: 2 days
444    paths:
445      - build
446
447check-cfi-x86_64:
448  extends: .native_test_job_template
449  needs:
450    - job: build-cfi-x86_64
451      artifacts: true
452  variables:
453    IMAGE: fedora
454    MAKE_CHECK_ARGS: check
455
456avocado-cfi-x86_64:
457  extends: .avocado_test_job_template
458  needs:
459    - job: build-cfi-x86_64
460      artifacts: true
461  variables:
462    IMAGE: fedora
463    MAKE_CHECK_ARGS: check-avocado
464
465tsan-build:
466  extends: .native_build_job_template
467  needs:
468    job: amd64-ubuntu2004-container
469  variables:
470    IMAGE: ubuntu2004
471    CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
472          --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
473    TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
474    MAKE_CHECK_ARGS: bench V=1
475
476# gprof/gcov are GCC features
477build-gprof-gcov:
478  extends: .native_build_job_template
479  needs:
480    job: amd64-ubuntu2004-container
481  variables:
482    IMAGE: ubuntu2004
483    CONFIGURE_ARGS: --enable-gprof --enable-gcov
484    TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
485  artifacts:
486    expire_in: 1 days
487    paths:
488      - build
489
490check-gprof-gcov:
491  extends: .native_test_job_template
492  needs:
493    - job: build-gprof-gcov
494      artifacts: true
495  variables:
496    IMAGE: ubuntu2004
497    MAKE_CHECK_ARGS: check
498  after_script:
499    - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
500
501build-oss-fuzz:
502  extends: .native_build_job_template
503  needs:
504    job: amd64-fedora-container
505  variables:
506    IMAGE: fedora
507  script:
508    - mkdir build-oss-fuzz
509    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
510      ./scripts/oss-fuzz/build.sh
511    - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
512    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
513                      | grep -v slirp); do
514        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
515        echo Testing ${fuzzer} ... ;
516        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
517      done
518
519build-tci:
520  extends: .native_build_job_template
521  needs:
522    job: amd64-debian-user-cross-container
523  variables:
524    IMAGE: debian-all-test-cross
525  script:
526    - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
527    - mkdir build
528    - cd build
529    - ../configure --enable-tcg-interpreter
530        --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
531    - make -j"$JOBS"
532    - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
533    - for tg in $TARGETS ; do
534        export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
535        ./tests/qtest/boot-serial-test || exit 1 ;
536        ./tests/qtest/cdrom-test || exit 1 ;
537      done
538    - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
539    - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
540    - make check-tcg
541
542# Alternate coroutines implementations are only really of interest to KVM users
543# However we can't test against KVM on Gitlab-CI so we can only run unit tests
544build-coroutine-sigaltstack:
545  extends: .native_build_job_template
546  needs:
547    job: amd64-ubuntu2004-container
548  variables:
549    IMAGE: ubuntu2004
550    CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
551                    --enable-trace-backends=ftrace
552    MAKE_CHECK_ARGS: check-unit
553
554# Check our reduced build configurations
555build-without-default-devices:
556  extends: .native_build_job_template
557  needs:
558    job: amd64-centos8-container
559  variables:
560    IMAGE: centos8
561    CONFIGURE_ARGS: --without-default-devices --disable-user
562
563build-without-default-features:
564  extends: .native_build_job_template
565  needs:
566    job: amd64-fedora-container
567  variables:
568    IMAGE: fedora
569    CONFIGURE_ARGS:
570      --without-default-features
571      --disable-capstone
572      --disable-pie
573      --disable-qom-cast-debug
574      --disable-slirp
575      --disable-strip
576    TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
577      sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
578    MAKE_CHECK_ARGS: check-unit check-qtest SPEED=slow
579
580build-libvhost-user:
581  extends: .base_job_template
582  stage: build
583  image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
584  needs:
585    job: amd64-fedora-container
586  script:
587    - mkdir subprojects/libvhost-user/build
588    - cd subprojects/libvhost-user/build
589    - meson
590    - ninja
591
592# No targets are built here, just tools, docs, and unit tests. This
593# also feeds into the eventual documentation deployment steps later
594build-tools-and-docs-debian:
595  extends: .native_build_job_template
596  needs:
597    job: amd64-debian-container
598    # when running on 'master' we use pre-existing container
599    optional: true
600  variables:
601    IMAGE: debian-amd64
602    MAKE_CHECK_ARGS: check-unit ctags TAGS cscope
603    CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
604    QEMU_JOB_PUBLISH: 1
605  artifacts:
606    expire_in: 2 days
607    paths:
608      - build
609
610# Prepare for GitLab pages deployment. Anything copied into the
611# "public" directory will be deployed to $USER.gitlab.io/$PROJECT
612#
613# GitLab publishes from any branch that triggers a CI pipeline
614#
615# For the main repo we don't want to publish from 'staging'
616# since that content may not be pushed, nor do we wish to
617# publish from 'stable-NNN' branches as that content is outdated.
618# Thus we restrict to just the default branch
619#
620# For contributor forks we want to publish from any repo so
621# that users can see the results of their commits, regardless
622# of what topic branch they're currently using
623pages:
624  extends: .base_job_template
625  image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
626  stage: test
627  needs:
628    - job: build-tools-and-docs-debian
629  script:
630    - mkdir -p public
631    # HTML-ised source tree
632    - make gtags
633    - htags -anT --tree-view=filetree -m qemu_init
634        -t "Welcome to the QEMU sourcecode"
635    - mv HTML public/src
636    # Project documentation
637    - make -C build install DESTDIR=$(pwd)/temp-install
638    - mv temp-install/usr/local/share/doc/qemu/* public/
639  artifacts:
640    paths:
641      - public
642  variables:
643    QEMU_JOB_PUBLISH: 1
644