OSDN Git Service

gitlab: move docs and tools build across from Travis
[qmiga/qemu.git] / .travis.yml
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
20
21
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       - gcovr
56       # Tests dependencies
57       - genisoimage
58
59
60 # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
61 # to prevent IRC notifications from forks. This was created using:
62 # $ travis encrypt -r "qemu/qemu" "irc.oftc.net#qemu"
63 notifications:
64   irc:
65     channels:
66       - secure: "F7GDRgjuOo5IUyRLqSkmDL7kvdU4UcH3Lm/W2db2JnDHTGCqgEdaYEYKciyCLZ57vOTsTsOgesN8iUT7hNHBd1KWKjZe9KDTZWppWRYVwAwQMzVeSOsbbU4tRoJ6Pp+3qhH1Z0eGYR9ZgKYAoTumDFgSAYRp4IscKS8jkoedOqM="
67     on_success: change
68     on_failure: always
69
70
71 env:
72   global:
73     - SRC_DIR=".."
74     - BUILD_DIR="build"
75     - BASE_CONFIG="--disable-docs --disable-tools"
76     - TEST_BUILD_CMD=""
77     - TEST_CMD="make check V=1"
78     # This is broadly a list of "mainline" softmmu targets which have support across the major distros
79     - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
80     - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
81     - CCACHE_MAXSIZE=1G
82     - G_MESSAGES_DEBUG=error
83
84
85 git:
86   # we want to do this ourselves
87   submodules: false
88
89 # Common first phase for all steps
90 before_install:
91   - if command -v ccache ; then ccache --zero-stats ; fi
92   - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
93   - echo "=== Using ${JOBS} simultaneous jobs ==="
94
95 # Configure step - may be overridden
96 before_script:
97   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
98   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
99
100 # Main build & test - rarely overridden - controlled by TEST_CMD
101 script:
102   - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
103   - |
104     if [ "$BUILD_RC" -eq 0 ] && [ -n "$TEST_BUILD_CMD" ]; then
105         ${TEST_BUILD_CMD} || BUILD_RC=$?
106     else
107         $(exit $BUILD_RC);
108     fi
109   - |
110     if [ "$BUILD_RC" -eq 0 ] ; then
111         ${TEST_CMD} ;
112     else
113         $(exit $BUILD_RC);
114     fi
115 after_script:
116   - df -h
117   - if command -v ccache ; then ccache --show-stats ; fi
118
119
120 jobs:
121   include:
122     # Just build tools and run minimal unit and softfloat checks
123     - name: "GCC check-unit and check-softfloat"
124       env:
125         - BASE_CONFIG="--enable-tools"
126         - CONFIG="--disable-user --disable-system"
127         - TEST_CMD="make check-unit check-softfloat -j${JOBS}"
128         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
129
130
131     # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
132     - name: "GCC debug (main-softmmu)"
133       env:
134         - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
135         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
136
137
138     # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
139     - name: "GCC debug (user)"
140       env:
141         - CONFIG="--enable-debug-tcg --disable-system"
142         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
143
144     # Module builds are mostly of interest to major distros
145     - name: "GCC modules (main-softmmu)"
146       env:
147         - CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
148         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
149
150
151     # Test with Clang for compile portability (Travis uses clang-5.0)
152     - name: "Clang (user)"
153       env:
154         - CONFIG="--disable-system --host-cc=clang --cxx=clang++"
155         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
156       compiler: clang
157
158
159     - name: "Clang (main-softmmu)"
160       env:
161         - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS}
162                   --host-cc=clang --cxx=clang++"
163         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
164       compiler: clang
165       before_script:
166         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
167         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log meson-logs/meson-log.txt && exit 1; }
168
169
170     - name: "Clang (other-softmmu)"
171       env:
172         - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
173                   --host-cc=clang --cxx=clang++"
174         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
175       compiler: clang
176
177
178     # gprof/gcov are GCC features
179     - name: "GCC gprof/gcov"
180       dist: bionic
181       addons:
182         apt:
183           packages:
184             - ninja-build
185       env:
186         - CONFIG="--enable-gprof --enable-gcov --disable-libssh
187                   --target-list=${MAIN_SOFTMMU_TARGETS}"
188       after_success:
189         - ${SRC_DIR}/scripts/travis/coverage-summary.sh
190
191
192     # Using newer GCC with sanitizers
193     - name: "GCC9 with sanitizers (softmmu)"
194       dist: bionic
195       addons:
196         apt:
197           update: true
198           sources:
199             # PPAs for newer toolchains
200             - ubuntu-toolchain-r-test
201           packages:
202             # Extra toolchains
203             - gcc-9
204             - g++-9
205             # Build dependencies
206             - libaio-dev
207             - libattr1-dev
208             - libbrlapi-dev
209             - libcap-ng-dev
210             - libgnutls28-dev
211             - libgtk-3-dev
212             - libiscsi-dev
213             - liblttng-ust-dev
214             - libnfs-dev
215             - libncurses5-dev
216             - libnss3-dev
217             - libpixman-1-dev
218             - libpng-dev
219             - librados-dev
220             - libsdl2-dev
221             - libsdl2-image-dev
222             - libseccomp-dev
223             - libspice-protocol-dev
224             - libspice-server-dev
225             - liburcu-dev
226             - libusb-1.0-0-dev
227             - libvte-2.91-dev
228             - ninja-build
229             - sparse
230             - uuid-dev
231       language: generic
232       compiler: none
233       env:
234         - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
235         - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-linux-user"
236         - TEST_CMD=""
237       before_script:
238         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
239         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log meson-logs/meson-log.txt && exit 1; }
240
241
242     - name: "[aarch64] GCC check-tcg"
243       arch: arm64
244       dist: focal
245       addons:
246         apt_packages:
247           - libaio-dev
248           - libattr1-dev
249           - libbrlapi-dev
250           - libcap-ng-dev
251           - libgcrypt20-dev
252           - libgnutls28-dev
253           - libgtk-3-dev
254           - libiscsi-dev
255           - liblttng-ust-dev
256           - libncurses5-dev
257           - libnfs-dev
258           - libnss3-dev
259           - libpixman-1-dev
260           - libpng-dev
261           - librados-dev
262           - libsdl2-dev
263           - libseccomp-dev
264           - liburcu-dev
265           - libusb-1.0-0-dev
266           - libvdeplug-dev
267           - libvte-2.91-dev
268           - ninja-build
269           # Tests dependencies
270           - genisoimage
271       env:
272         - TEST_CMD="make check check-tcg V=1"
273         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
274         - UNRELIABLE=true
275
276     - name: "[ppc64] GCC check-tcg"
277       arch: ppc64le
278       dist: focal
279       addons:
280         apt_packages:
281           - libaio-dev
282           - libattr1-dev
283           - libbrlapi-dev
284           - libcap-ng-dev
285           - libgcrypt20-dev
286           - libgnutls28-dev
287           - libgtk-3-dev
288           - libiscsi-dev
289           - liblttng-ust-dev
290           - libncurses5-dev
291           - libnfs-dev
292           - libnss3-dev
293           - libpixman-1-dev
294           - libpng-dev
295           - librados-dev
296           - libsdl2-dev
297           - libseccomp-dev
298           - liburcu-dev
299           - libusb-1.0-0-dev
300           - libvdeplug-dev
301           - libvte-2.91-dev
302           - ninja-build
303           # Tests dependencies
304           - genisoimage
305       env:
306         - TEST_CMD="make check check-tcg V=1"
307         - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
308
309     - name: "[s390x] GCC check-tcg"
310       arch: s390x
311       dist: bionic
312       addons:
313         apt_packages:
314           - libaio-dev
315           - libattr1-dev
316           - libbrlapi-dev
317           - libcap-ng-dev
318           - libgcrypt20-dev
319           - libgnutls28-dev
320           - libgtk-3-dev
321           - libiscsi-dev
322           - liblttng-ust-dev
323           - libncurses5-dev
324           - libnfs-dev
325           - libnss3-dev
326           - libpixman-1-dev
327           - libpng-dev
328           - librados-dev
329           - libsdl2-dev
330           - libseccomp-dev
331           - liburcu-dev
332           - libusb-1.0-0-dev
333           - libvdeplug-dev
334           - libvte-2.91-dev
335           - ninja-build
336           # Tests dependencies
337           - genisoimage
338       env:
339         - TEST_CMD="make check check-tcg V=1"
340         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
341         - UNRELIABLE=true
342       script:
343         - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
344         - |
345           if [ "$BUILD_RC" -eq 0 ] ; then
346               mv pc-bios/s390-ccw/*.img pc-bios/ ;
347               ${TEST_CMD} ;
348           else
349               $(exit $BUILD_RC);
350           fi
351
352     - name: "[s390x] GCC (other-softmmu)"
353       arch: s390x
354       dist: bionic
355       addons:
356         apt_packages:
357           - libaio-dev
358           - libattr1-dev
359           - libcap-ng-dev
360           - libgnutls28-dev
361           - libiscsi-dev
362           - liblttng-ust-dev
363           - liblzo2-dev
364           - libncurses-dev
365           - libnfs-dev
366           - libnss3-dev
367           - libpixman-1-dev
368           - libsdl2-dev
369           - libsdl2-image-dev
370           - libseccomp-dev
371           - libsnappy-dev
372           - libzstd-dev
373           - nettle-dev
374           - xfslibs-dev
375           - ninja-build
376           # Tests dependencies
377           - genisoimage
378       env:
379         - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
380                   --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
381
382     - name: "[s390x] GCC (user)"
383       arch: s390x
384       dist: bionic
385       addons:
386         apt_packages:
387           - libgcrypt20-dev
388           - libgnutls28-dev
389           - ninja-build
390       env:
391         - CONFIG="--disable-containers --disable-system"
392
393     - name: "[s390x] Clang (disable-tcg)"
394       arch: s390x
395       dist: bionic
396       compiler: clang
397       addons:
398         apt_packages:
399           - libaio-dev
400           - libattr1-dev
401           - libbrlapi-dev
402           - libcap-ng-dev
403           - libgcrypt20-dev
404           - libgnutls28-dev
405           - libgtk-3-dev
406           - libiscsi-dev
407           - liblttng-ust-dev
408           - libncurses5-dev
409           - libnfs-dev
410           - libnss3-dev
411           - libpixman-1-dev
412           - libpng-dev
413           - librados-dev
414           - libsdl2-dev
415           - libseccomp-dev
416           - liburcu-dev
417           - libusb-1.0-0-dev
418           - libvdeplug-dev
419           - libvte-2.91-dev
420           - ninja-build
421       env:
422         - TEST_CMD="make check-unit"
423         - CONFIG="--disable-containers --disable-tcg --enable-kvm
424                   --disable-tools --host-cc=clang --cxx=clang++"
425         - UNRELIABLE=true
426
427     # Release builds
428     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
429     # This is the case when release candidate tags are created.
430     - name: "Release tarball"
431       if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
432       env:
433         # We want to build from the release tarball
434         - BUILD_DIR="release/build/dir" SRC_DIR="../../.."
435         - BASE_CONFIG="--prefix=$PWD/dist"
436         - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
437         - TEST_CMD="make install -j${JOBS}"
438         - QEMU_VERSION="${TRAVIS_TAG:1}"
439         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
440       script:
441         - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
442         - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
443         - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
444         - mkdir -p release-build && cd release-build
445         - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
446         - make install
447   allow_failures:
448     - env: UNRELIABLE=true