gitlab-ci: Document 'build-tcg-disabled' is a KVM X86 job
[qemu/ar7.git] / .gitlab-ci.yml
blobee31b1020fef8b5bcffd31f9449daf2dd6c29108
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)
4 stages:
5   - containers
6   - containers-layer2
7   - build
8   - test
10 include:
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'
16 .native_build_job_template: &native_build_job_definition
17   stage: build
18   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
19   before_script:
20     - JOBS=$(expr $(nproc) + 1)
21     - sed -i s,git.qemu.org/git,gitlab.com/qemu-project, .gitmodules
22   script:
23     - mkdir build
24     - cd build
25     - if test -n "$TARGETS";
26       then
27         ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
28       else
29         ../configure --enable-werror $CONFIGURE_ARGS ;
30       fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
31     - make -j"$JOBS"
32     - if test -n "$MAKE_CHECK_ARGS";
33       then
34         make -j"$JOBS" $MAKE_CHECK_ARGS ;
35       fi
37 .native_test_job_template: &native_test_job_definition
38   stage: test
39   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
40   script:
41     - cd build
42     - find . -type f -exec touch {} +
43     - make $MAKE_CHECK_ARGS
45 .acceptance_template: &acceptance_definition
46   cache:
47     key: "${CI_JOB_NAME}-cache"
48     paths:
49       - ${CI_PROJECT_DIR}/avocado-cache
50     policy: pull-push
51   artifacts:
52     paths:
53       - build/tests/results/latest/results.xml
54     reports:
55       junit: build/tests/results/latest/results.xml
56   before_script:
57     - mkdir -p ~/.config/avocado
58     - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
59     - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
60            >> ~/.config/avocado/avocado.conf
61     - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
62         du -chs ${CI_PROJECT_DIR}/avocado-cache ;
63       fi
64     - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
65   after_script:
66     - cd build
67     - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP", "CANCEL")]' | xargs cat
68     - du -chs ${CI_PROJECT_DIR}/avocado-cache
70 build-system-ubuntu:
71   <<: *native_build_job_definition
72   variables:
73     IMAGE: ubuntu2004
74     TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
75       moxie-softmmu microblazeel-softmmu mips64el-softmmu
76     MAKE_CHECK_ARGS: check-build
77     CONFIGURE_ARGS: --enable-docs
78   artifacts:
79     expire_in: 2 days
80     paths:
81       - build
83 check-system-ubuntu:
84   <<: *native_test_job_definition
85   needs:
86     - job: build-system-ubuntu
87       artifacts: true
88   variables:
89     IMAGE: ubuntu2004
90     MAKE_CHECK_ARGS: check
92 acceptance-system-ubuntu:
93   <<: *native_test_job_definition
94   needs:
95     - job: build-system-ubuntu
96       artifacts: true
97   variables:
98     IMAGE: ubuntu2004
99     MAKE_CHECK_ARGS: check-acceptance
100   <<: *acceptance_definition
102 build-system-debian:
103   <<: *native_build_job_definition
104   variables:
105     IMAGE: debian-amd64
106     TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
107       riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
108     MAKE_CHECK_ARGS: check-build
109     CONFIGURE_ARGS: --enable-docs
110   artifacts:
111     expire_in: 2 days
112     paths:
113       - build
115 check-system-debian:
116   <<: *native_test_job_definition
117   needs:
118     - job: build-system-debian
119       artifacts: true
120   variables:
121     IMAGE: debian-amd64
122     MAKE_CHECK_ARGS: check
124 acceptance-system-debian:
125   <<: *native_test_job_definition
126   needs:
127     - job: build-system-debian
128       artifacts: true
129   variables:
130     IMAGE: debian-amd64
131     MAKE_CHECK_ARGS: check-acceptance
132   <<: *acceptance_definition
134 build-system-fedora:
135   <<: *native_build_job_definition
136   variables:
137     IMAGE: fedora
138     CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
139     TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
140       xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
141     MAKE_CHECK_ARGS: check-build
142   artifacts:
143     expire_in: 2 days
144     paths:
145       - build
147 check-system-fedora:
148   <<: *native_test_job_definition
149   needs:
150     - job: build-system-fedora
151       artifacts: true
152   variables:
153     IMAGE: fedora
154     MAKE_CHECK_ARGS: check
156 acceptance-system-fedora:
157   <<: *native_test_job_definition
158   needs:
159     - job: build-system-fedora
160       artifacts: true
161   variables:
162     IMAGE: fedora
163     MAKE_CHECK_ARGS: check-acceptance
164   <<: *acceptance_definition
166 build-system-centos:
167   <<: *native_build_job_definition
168   variables:
169     IMAGE: centos8
170     CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
171     TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
172       x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
173     MAKE_CHECK_ARGS: check-build
174   artifacts:
175     expire_in: 2 days
176     paths:
177       - build
179 check-system-centos:
180   <<: *native_test_job_definition
181   needs:
182     - job: build-system-centos
183       artifacts: true
184   variables:
185     IMAGE: centos8
186     MAKE_CHECK_ARGS: check
188 acceptance-system-centos:
189   <<: *native_test_job_definition
190   needs:
191     - job: build-system-centos
192       artifacts: true
193   variables:
194     IMAGE: centos8
195     MAKE_CHECK_ARGS: check-acceptance
196   <<: *acceptance_definition
198 build-disabled:
199   <<: *native_build_job_definition
200   variables:
201     IMAGE: fedora
202     CONFIGURE_ARGS: --disable-attr --disable-avx2 --disable-bochs
203       --disable-brlapi --disable-bzip2 --disable-cap-ng --disable-capstone
204       --disable-cloop --disable-coroutine-pool --disable-curl --disable-curses
205       --disable-dmg --disable-docs --disable-glusterfs --disable-gnutls
206       --disable-gtk --disable-guest-agent --disable-iconv --disable-kvm
207       --disable-libiscsi --disable-libpmem --disable-libssh --disable-libusb
208       --disable-libxml2 --disable-linux-aio --disable-live-block-migration
209       --disable-lzo --disable-malloc-trim --disable-mpath --disable-nettle
210       --disable-numa --disable-parallels --disable-pie --disable-qcow1
211       --disable-qed --disable-qom-cast-debug --disable-rbd --disable-rdma
212       --disable-replication --disable-sdl --disable-seccomp --disable-sheepdog
213       --disable-slirp --disable-smartcard --disable-snappy --disable-spice
214       --disable-strip --disable-tpm --disable-usb-redir --disable-vdi
215       --disable-vhost-crypto --disable-vhost-net --disable-vhost-scsi
216       --disable-vhost-user --disable-vhost-vdpa --disable-vhost-vsock
217       --disable-virglrenderer --disable-vnc --disable-vte --disable-vvfat
218       --disable-xen --disable-zstd
219     TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
220       s390x-softmmu i386-linux-user
221     MAKE_CHECK_ARGS: check-qtest SPEED=slow
223 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
224 # the configure script. The container doesn't contain Xen headers so
225 # Xen accelerator is not detected / selected. As result it build the
226 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
227 # available.
228 build-tcg-disabled:
229   <<: *native_build_job_definition
230   variables:
231     IMAGE: centos8
232   script:
233     - mkdir build
234     - cd build
235     - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
236     - make -j"$JOBS"
237     - make check-unit
238     - make check-qapi-schema
239     - cd tests/qemu-iotests/
240     - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
241             052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
242             170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
243     - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
244             124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
245             208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
246             260 261 262 263 264 270 272 273 277 279
248 build-user:
249   <<: *native_build_job_definition
250   variables:
251     IMAGE: debian-all-test-cross
252     CONFIGURE_ARGS: --disable-tools --disable-system
253     MAKE_CHECK_ARGS: check-tcg
255 # Only build the softmmu targets we have check-tcg tests for
256 build-some-softmmu:
257   <<: *native_build_job_definition
258   variables:
259     IMAGE: debian-all-test-cross
260     CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
261     TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
262     MAKE_CHECK_ARGS: check-tcg
264 # Run check-tcg against linux-user (with plugins)
265 # we skip sparc64-linux-user until it has been fixed somewhat
266 # we skip cris-linux-user as it doesn't use the common run loop
267 build-user-plugins:
268   <<: *native_build_job_definition
269   variables:
270     IMAGE: debian-all-test-cross
271     CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
272     MAKE_CHECK_ARGS: check-tcg
273   timeout: 1h 30m
275 build-some-softmmu-plugins:
276   <<: *native_build_job_definition
277   variables:
278     IMAGE: debian-all-test-cross
279     CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
280     TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
281     MAKE_CHECK_ARGS: check-tcg
283 build-clang:
284   <<: *native_build_job_definition
285   variables:
286     IMAGE: fedora
287     CONFIGURE_ARGS: --cc=clang --cxx=clang++
288     TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
289       ppc-softmmu s390x-softmmu arm-linux-user
290     MAKE_CHECK_ARGS: check
292 # These targets are on the way out
293 build-deprecated:
294   <<: *native_build_job_definition
295   variables:
296     IMAGE: debian-all-test-cross
297     CONFIGURE_ARGS: --disable-docs --disable-tools
298     MAKE_CHECK_ARGS: build-tcg
299     TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
300       unicore32-softmmu
301   artifacts:
302     expire_in: 2 days
303     paths:
304       - build
306 # We split the check-tcg step as test failures are expected but we still
307 # want to catch the build breaking.
308 check-deprecated:
309   <<: *native_test_job_definition
310   needs:
311     - job: build-deprecated
312       artifacts: true
313   variables:
314     IMAGE: debian-all-test-cross
315     MAKE_CHECK_ARGS: check-tcg
316   allow_failure: true
318 build-oss-fuzz:
319   <<: *native_build_job_definition
320   variables:
321     IMAGE: fedora
322   script:
323     - mkdir build-oss-fuzz
324     - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
325       ./scripts/oss-fuzz/build.sh
326     - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
327     - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
328                       | grep -v slirp); do
329         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
330         echo Testing ${fuzzer} ... ;
331         "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
332       done
333     # Unrelated to fuzzer: run some tests with -fsanitize=address
334     - cd build-oss-fuzz && make check-qtest-i386 check-unit
336 build-tci:
337   <<: *native_build_job_definition
338   variables:
339     IMAGE: fedora
340   script:
341     - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
342     - mkdir build
343     - cd build
344     - ../configure --enable-tcg-interpreter
345         --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
346     - make -j"$JOBS"
347     - make run-tcg-tests-x86_64-softmmu
348     - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
349     - for tg in $TARGETS ; do
350         export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
351         ./tests/qtest/boot-serial-test || exit 1 ;
352         ./tests/qtest/cdrom-test || exit 1 ;
353       done
354     - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
355     - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
357 # Most jobs test latest gcrypt or nettle builds
359 # These jobs test old gcrypt and nettle from RHEL7
360 # which had some API differences.
361 build-crypto-old-nettle:
362   <<: *native_build_job_definition
363   variables:
364     IMAGE: centos7
365     TARGETS: x86_64-softmmu x86_64-linux-user
366     CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
367     MAKE_CHECK_ARGS: check-build
368   artifacts:
369     paths:
370       - build
372 check-crypto-old-nettle:
373   <<: *native_test_job_definition
374   needs:
375     - job: build-crypto-old-nettle
376       artifacts: true
377   variables:
378     IMAGE: centos7
379     MAKE_CHECK_ARGS: check
382 build-crypto-old-gcrypt:
383   <<: *native_build_job_definition
384   variables:
385     IMAGE: centos7
386     TARGETS: x86_64-softmmu x86_64-linux-user
387     CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
388     MAKE_CHECK_ARGS: check-build
389   artifacts:
390     paths:
391       - build
393 check-crypto-old-gcrypt:
394   <<: *native_test_job_definition
395   needs:
396     - job: build-crypto-old-gcrypt
397       artifacts: true
398   variables:
399     IMAGE: centos7
400     MAKE_CHECK_ARGS: check
403 build-crypto-only-gnutls:
404   <<: *native_build_job_definition
405   variables:
406     IMAGE: centos7
407     TARGETS: x86_64-softmmu x86_64-linux-user
408     CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
409     MAKE_CHECK_ARGS: check-build
410   artifacts:
411     paths:
412       - build
414 check-crypto-only-gnutls:
415   <<: *native_test_job_definition
416   needs:
417     - job: build-crypto-only-gnutls
418       artifacts: true
419   variables:
420     IMAGE: centos7
421     MAKE_CHECK_ARGS: check
423 # We don't need to exercise every backend with every front-end
424 build-trace-multi-user:
425   <<: *native_build_job_definition
426   variables:
427     IMAGE: ubuntu2004
428     CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
430 build-trace-ftrace-system:
431   <<: *native_build_job_definition
432   variables:
433     IMAGE: ubuntu2004
434     CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
436 build-trace-ust-system:
437   <<: *native_build_job_definition
438   variables:
439     IMAGE: ubuntu2004
440     CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
442 check-patch:
443   stage: build
444   image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
445   script: .gitlab-ci.d/check-patch.py
446   except:
447     variables:
448       - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
449   variables:
450     GIT_DEPTH: 1000
451   allow_failure: true
453 check-dco:
454   stage: build
455   image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
456   script: .gitlab-ci.d/check-dco.py
457   except:
458     variables:
459       - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
460   variables:
461     GIT_DEPTH: 1000
463 pages:
464   image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest
465   stage: test
466   needs:
467     - job: build-system-ubuntu
468       artifacts: true
469   script:
470     - mkdir public
471     - mv build/docs/index.html public/
472     - for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done
473   artifacts:
474     paths:
475       - public