travis.yml: Move the -fsanitize=undefined test to the gitlab-CI
[qemu/ar7.git] / .travis.yml
blob533a60c13088d9ae7e909dcb42d9b2427c2b5edc
1 # The current Travis default is a VM based 16.04 Xenial on GCE
2 # Additional builds with specific requirements for a full VM need to
3 # be added as additional matrix: entries later on
4 os: linux
5 dist: focal
6 language: c
7 compiler:
8   - gcc
9 cache:
10   # There is one cache per branch and compiler version.
11   # characteristics of each job are used to identify the cache:
12   # - OS name (currently only linux)
13   # - OS distribution (for Linux, bionic or focal)
14   # - Names and values of visible environment variables set in .travis.yml or Settings panel
15   timeout: 1200
16   ccache: true
17   pip: true
18   directories:
19   - $HOME/avocado/data/cache
22 addons:
23   apt:
24     packages:
25       # Build dependencies
26       - libaio-dev
27       - libattr1-dev
28       - libbrlapi-dev
29       - libcap-ng-dev
30       - libgcc-7-dev
31       - libgnutls28-dev
32       - libgtk-3-dev
33       - libiscsi-dev
34       - liblttng-ust-dev
35       - libncurses5-dev
36       - libnfs-dev
37       - libnss3-dev
38       - libpixman-1-dev
39       - libpng-dev
40       - librados-dev
41       - libsdl2-dev
42       - libsdl2-image-dev
43       - libseccomp-dev
44       - libspice-protocol-dev
45       - libspice-server-dev
46       - libssh-dev
47       - liburcu-dev
48       - libusb-1.0-0-dev
49       - libvdeplug-dev
50       - libvte-2.91-dev
51       - libzstd-dev
52       - ninja-build
53       - sparse
54       - uuid-dev
55       # Tests dependencies
56       - genisoimage
59 # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
60 # to prevent IRC notifications from forks. This was created using:
61 # $ travis encrypt -r "qemu/qemu" "irc.oftc.net#qemu"
62 notifications:
63   irc:
64     channels:
65       - secure: "F7GDRgjuOo5IUyRLqSkmDL7kvdU4UcH3Lm/W2db2JnDHTGCqgEdaYEYKciyCLZ57vOTsTsOgesN8iUT7hNHBd1KWKjZe9KDTZWppWRYVwAwQMzVeSOsbbU4tRoJ6Pp+3qhH1Z0eGYR9ZgKYAoTumDFgSAYRp4IscKS8jkoedOqM="
66     on_success: change
67     on_failure: always
70 env:
71   global:
72     - SRC_DIR=".."
73     - BUILD_DIR="build"
74     - BASE_CONFIG="--disable-docs --disable-tools"
75     - TEST_BUILD_CMD=""
76     - TEST_CMD="make check V=1"
77     # This is broadly a list of "mainline" softmmu targets which have support across the major distros
78     - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
79     - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
80     - CCACHE_MAXSIZE=1G
81     - G_MESSAGES_DEBUG=error
84 git:
85   # we want to do this ourselves
86   submodules: false
88 # Common first phase for all steps
89 before_install:
90   - if command -v ccache ; then ccache --zero-stats ; fi
91   - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
92   - echo "=== Using ${JOBS} simultaneous jobs ==="
94 # Configure step - may be overridden
95 before_script:
96   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
97   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
99 # Main build & test - rarely overridden - controlled by TEST_CMD
100 script:
101   - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
102   - |
103     if [ "$BUILD_RC" -eq 0 ] && [ -n "$TEST_BUILD_CMD" ]; then
104         ${TEST_BUILD_CMD} || BUILD_RC=$?
105     else
106         $(exit $BUILD_RC);
107     fi
108   - |
109     if [ "$BUILD_RC" -eq 0 ] ; then
110         ${TEST_CMD} ;
111     else
112         $(exit $BUILD_RC);
113     fi
114 after_script:
115   - df -h
116   - if command -v ccache ; then ccache --show-stats ; fi
119 jobs:
120   include:
121     # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
122     - name: "GCC debug (main-softmmu)"
123       env:
124         - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
125         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
128     # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
129     - name: "GCC debug (user)"
130       env:
131         - CONFIG="--enable-debug-tcg --disable-system"
132         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
134     # Module builds are mostly of interest to major distros
135     - name: "GCC modules (main-softmmu)"
136       env:
137         - CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
138         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
141     # Using newer GCC with sanitizers
142     - name: "GCC9 with sanitizers (softmmu)"
143       dist: bionic
144       addons:
145         apt:
146           update: true
147           sources:
148             # PPAs for newer toolchains
149             - ubuntu-toolchain-r-test
150           packages:
151             # Extra toolchains
152             - gcc-9
153             - g++-9
154             # Build dependencies
155             - libaio-dev
156             - libattr1-dev
157             - libbrlapi-dev
158             - libcap-ng-dev
159             - libgnutls28-dev
160             - libgtk-3-dev
161             - libiscsi-dev
162             - liblttng-ust-dev
163             - libnfs-dev
164             - libncurses5-dev
165             - libnss3-dev
166             - libpixman-1-dev
167             - libpng-dev
168             - librados-dev
169             - libsdl2-dev
170             - libsdl2-image-dev
171             - libseccomp-dev
172             - libspice-protocol-dev
173             - libspice-server-dev
174             - liburcu-dev
175             - libusb-1.0-0-dev
176             - libvte-2.91-dev
177             - ninja-build
178             - sparse
179             - uuid-dev
180       language: generic
181       compiler: none
182       env:
183         - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
184         - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-linux-user"
185         - TEST_CMD=""
186       before_script:
187         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
188         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log meson-logs/meson-log.txt && exit 1; }
191     - name: "[aarch64] GCC check-tcg"
192       arch: arm64
193       dist: focal
194       addons:
195         apt_packages:
196           - libaio-dev
197           - libattr1-dev
198           - libbrlapi-dev
199           - libcap-ng-dev
200           - libgcrypt20-dev
201           - libgnutls28-dev
202           - libgtk-3-dev
203           - libiscsi-dev
204           - liblttng-ust-dev
205           - libncurses5-dev
206           - libnfs-dev
207           - libnss3-dev
208           - libpixman-1-dev
209           - libpng-dev
210           - librados-dev
211           - libsdl2-dev
212           - libseccomp-dev
213           - liburcu-dev
214           - libusb-1.0-0-dev
215           - libvdeplug-dev
216           - libvte-2.91-dev
217           - ninja-build
218           # Tests dependencies
219           - genisoimage
220       env:
221         - TEST_CMD="make check check-tcg V=1"
222         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
223         - UNRELIABLE=true
225     - name: "[ppc64] GCC check-tcg"
226       arch: ppc64le
227       dist: focal
228       addons:
229         apt_packages:
230           - libaio-dev
231           - libattr1-dev
232           - libbrlapi-dev
233           - libcap-ng-dev
234           - libgcrypt20-dev
235           - libgnutls28-dev
236           - libgtk-3-dev
237           - libiscsi-dev
238           - liblttng-ust-dev
239           - libncurses5-dev
240           - libnfs-dev
241           - libnss3-dev
242           - libpixman-1-dev
243           - libpng-dev
244           - librados-dev
245           - libsdl2-dev
246           - libseccomp-dev
247           - liburcu-dev
248           - libusb-1.0-0-dev
249           - libvdeplug-dev
250           - libvte-2.91-dev
251           - ninja-build
252           # Tests dependencies
253           - genisoimage
254       env:
255         - TEST_CMD="make check check-tcg V=1"
256         - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
258     - name: "[s390x] GCC check-tcg"
259       arch: s390x
260       dist: bionic
261       addons:
262         apt_packages:
263           - libaio-dev
264           - libattr1-dev
265           - libbrlapi-dev
266           - libcap-ng-dev
267           - libgcrypt20-dev
268           - libgnutls28-dev
269           - libgtk-3-dev
270           - libiscsi-dev
271           - liblttng-ust-dev
272           - libncurses5-dev
273           - libnfs-dev
274           - libnss3-dev
275           - libpixman-1-dev
276           - libpng-dev
277           - librados-dev
278           - libsdl2-dev
279           - libseccomp-dev
280           - liburcu-dev
281           - libusb-1.0-0-dev
282           - libvdeplug-dev
283           - libvte-2.91-dev
284           - ninja-build
285           # Tests dependencies
286           - genisoimage
287       env:
288         - TEST_CMD="make check check-tcg V=1"
289         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
290         - UNRELIABLE=true
291       script:
292         - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
293         - |
294           if [ "$BUILD_RC" -eq 0 ] ; then
295               mv pc-bios/s390-ccw/*.img pc-bios/ ;
296               ${TEST_CMD} ;
297           else
298               $(exit $BUILD_RC);
299           fi
301     - name: "[s390x] GCC (other-softmmu)"
302       arch: s390x
303       dist: bionic
304       addons:
305         apt_packages:
306           - libaio-dev
307           - libattr1-dev
308           - libcap-ng-dev
309           - libgnutls28-dev
310           - libiscsi-dev
311           - liblttng-ust-dev
312           - liblzo2-dev
313           - libncurses-dev
314           - libnfs-dev
315           - libnss3-dev
316           - libpixman-1-dev
317           - libsdl2-dev
318           - libsdl2-image-dev
319           - libseccomp-dev
320           - libsnappy-dev
321           - libzstd-dev
322           - nettle-dev
323           - xfslibs-dev
324           - ninja-build
325           # Tests dependencies
326           - genisoimage
327       env:
328         - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
329                   --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
331     - name: "[s390x] GCC (user)"
332       arch: s390x
333       dist: bionic
334       addons:
335         apt_packages:
336           - libgcrypt20-dev
337           - libgnutls28-dev
338           - ninja-build
339       env:
340         - CONFIG="--disable-containers --disable-system"
342     - name: "[s390x] Clang (disable-tcg)"
343       arch: s390x
344       dist: bionic
345       compiler: clang
346       addons:
347         apt_packages:
348           - libaio-dev
349           - libattr1-dev
350           - libbrlapi-dev
351           - libcap-ng-dev
352           - libgcrypt20-dev
353           - libgnutls28-dev
354           - libgtk-3-dev
355           - libiscsi-dev
356           - liblttng-ust-dev
357           - libncurses5-dev
358           - libnfs-dev
359           - libnss3-dev
360           - libpixman-1-dev
361           - libpng-dev
362           - librados-dev
363           - libsdl2-dev
364           - libseccomp-dev
365           - liburcu-dev
366           - libusb-1.0-0-dev
367           - libvdeplug-dev
368           - libvte-2.91-dev
369           - ninja-build
370       env:
371         - TEST_CMD="make check-unit"
372         - CONFIG="--disable-containers --disable-tcg --enable-kvm
373                   --disable-tools --host-cc=clang --cxx=clang++"
374         - UNRELIABLE=true
376     # Release builds
377     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
378     # This is the case when release candidate tags are created.
379     - name: "Release tarball"
380       if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
381       env:
382         # We want to build from the release tarball
383         - BUILD_DIR="release/build/dir" SRC_DIR="../../.."
384         - BASE_CONFIG="--prefix=$PWD/dist"
385         - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
386         - TEST_CMD="make install -j${JOBS}"
387         - QEMU_VERSION="${TRAVIS_TAG:1}"
388         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
389       script:
390         - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
391         - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
392         - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
393         - mkdir -p release-build && cd release-build
394         - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
395         - make install
396   allow_failures:
397     - env: UNRELIABLE=true