xref: /openbmc/qemu/.travis.yml (revision d9c58585)
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
4os: linux
5dist: focal
6language: c
7compiler:
8  - gcc
9cache:
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
22addons:
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
57
58
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"
62notifications:
63  irc:
64    channels:
65      - secure: "F7GDRgjuOo5IUyRLqSkmDL7kvdU4UcH3Lm/W2db2JnDHTGCqgEdaYEYKciyCLZ57vOTsTsOgesN8iUT7hNHBd1KWKjZe9KDTZWppWRYVwAwQMzVeSOsbbU4tRoJ6Pp+3qhH1Z0eGYR9ZgKYAoTumDFgSAYRp4IscKS8jkoedOqM="
66    on_success: change
67    on_failure: always
68
69
70env:
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
82
83
84git:
85  # we want to do this ourselves
86  submodules: false
87
88# Common first phase for all steps
89before_install:
90  - if command -v ccache ; then ccache --zero-stats ; fi
91  - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
92  - echo "=== Using ${JOBS} simultaneous jobs ==="
93
94# Configure step - may be overridden
95before_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; }
98
99# Main build & test - rarely overridden - controlled by TEST_CMD
100script:
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
114after_script:
115  - df -h
116  - if command -v ccache ; then ccache --show-stats ; fi
117
118
119jobs:
120  include:
121
122    - name: "[aarch64] GCC check-tcg"
123      arch: arm64
124      dist: focal
125      addons:
126        apt_packages:
127          - libaio-dev
128          - libattr1-dev
129          - libbrlapi-dev
130          - libcap-ng-dev
131          - libgcrypt20-dev
132          - libgnutls28-dev
133          - libgtk-3-dev
134          - libiscsi-dev
135          - liblttng-ust-dev
136          - libncurses5-dev
137          - libnfs-dev
138          - libnss3-dev
139          - libpixman-1-dev
140          - libpng-dev
141          - librados-dev
142          - libsdl2-dev
143          - libseccomp-dev
144          - liburcu-dev
145          - libusb-1.0-0-dev
146          - libvdeplug-dev
147          - libvte-2.91-dev
148          - ninja-build
149          # Tests dependencies
150          - genisoimage
151      env:
152        - TEST_CMD="make check check-tcg V=1"
153        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS} --cxx=/bin/false"
154        - UNRELIABLE=true
155
156    - name: "[ppc64] GCC check-tcg"
157      arch: ppc64le
158      dist: focal
159      addons:
160        apt_packages:
161          - libaio-dev
162          - libattr1-dev
163          - libbrlapi-dev
164          - libcap-ng-dev
165          - libgcrypt20-dev
166          - libgnutls28-dev
167          - libgtk-3-dev
168          - libiscsi-dev
169          - liblttng-ust-dev
170          - libncurses5-dev
171          - libnfs-dev
172          - libnss3-dev
173          - libpixman-1-dev
174          - libpng-dev
175          - librados-dev
176          - libsdl2-dev
177          - libseccomp-dev
178          - liburcu-dev
179          - libusb-1.0-0-dev
180          - libvdeplug-dev
181          - libvte-2.91-dev
182          - ninja-build
183          # Tests dependencies
184          - genisoimage
185      env:
186        - TEST_CMD="make check check-tcg V=1"
187        - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
188
189    - name: "[s390x] GCC check-tcg"
190      arch: s390x
191      dist: bionic
192      addons:
193        apt_packages:
194          - libaio-dev
195          - libattr1-dev
196          - libbrlapi-dev
197          - libcap-ng-dev
198          - libgcrypt20-dev
199          - libgnutls28-dev
200          - libgtk-3-dev
201          - libiscsi-dev
202          - liblttng-ust-dev
203          - libncurses5-dev
204          - libnfs-dev
205          - libnss3-dev
206          - libpixman-1-dev
207          - libpng-dev
208          - librados-dev
209          - libsdl2-dev
210          - libseccomp-dev
211          - liburcu-dev
212          - libusb-1.0-0-dev
213          - libvdeplug-dev
214          - libvte-2.91-dev
215          - ninja-build
216          # Tests dependencies
217          - genisoimage
218      env:
219        - TEST_CMD="make check check-tcg V=1"
220        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
221        - UNRELIABLE=true
222      script:
223        - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
224        - |
225          if [ "$BUILD_RC" -eq 0 ] ; then
226              mv pc-bios/s390-ccw/*.img pc-bios/ ;
227              ${TEST_CMD} ;
228          else
229              $(exit $BUILD_RC);
230          fi
231
232    - name: "[s390x] GCC (other-softmmu)"
233      arch: s390x
234      dist: bionic
235      addons:
236        apt_packages:
237          - libaio-dev
238          - libattr1-dev
239          - libcap-ng-dev
240          - libgnutls28-dev
241          - libiscsi-dev
242          - liblttng-ust-dev
243          - liblzo2-dev
244          - libncurses-dev
245          - libnfs-dev
246          - libnss3-dev
247          - libpixman-1-dev
248          - libsdl2-dev
249          - libsdl2-image-dev
250          - libseccomp-dev
251          - libsnappy-dev
252          - libzstd-dev
253          - nettle-dev
254          - xfslibs-dev
255          - ninja-build
256          # Tests dependencies
257          - genisoimage
258      env:
259        - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
260                  --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
261
262    - name: "[s390x] GCC (user)"
263      arch: s390x
264      dist: bionic
265      addons:
266        apt_packages:
267          - libgcrypt20-dev
268          - libgnutls28-dev
269          - ninja-build
270      env:
271        - CONFIG="--disable-containers --disable-system"
272
273    - name: "[s390x] Clang (disable-tcg)"
274      arch: s390x
275      dist: bionic
276      compiler: clang
277      addons:
278        apt_packages:
279          - libaio-dev
280          - libattr1-dev
281          - libbrlapi-dev
282          - libcap-ng-dev
283          - libgcrypt20-dev
284          - libgnutls28-dev
285          - libgtk-3-dev
286          - libiscsi-dev
287          - liblttng-ust-dev
288          - libncurses5-dev
289          - libnfs-dev
290          - libnss3-dev
291          - libpixman-1-dev
292          - libpng-dev
293          - librados-dev
294          - libsdl2-dev
295          - libseccomp-dev
296          - liburcu-dev
297          - libusb-1.0-0-dev
298          - libvdeplug-dev
299          - libvte-2.91-dev
300          - ninja-build
301      env:
302        - TEST_CMD="make check-unit"
303        - CONFIG="--disable-containers --disable-tcg --enable-kvm
304                  --disable-tools --host-cc=clang --cxx=clang++"
305        - UNRELIABLE=true
306
307    # Release builds
308    # The make-release script expect a QEMU version, so our tag must start with a 'v'.
309    # This is the case when release candidate tags are created.
310    - name: "Release tarball"
311      if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
312      env:
313        # We want to build from the release tarball
314        - BUILD_DIR="release/build/dir" SRC_DIR="../../.."
315        - BASE_CONFIG="--prefix=$PWD/dist"
316        - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
317        - TEST_CMD="make install -j${JOBS}"
318        - QEMU_VERSION="${TRAVIS_TAG:1}"
319        - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
320      script:
321        - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
322        - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
323        - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
324        - mkdir -p release-build && cd release-build
325        - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
326        - make install
327  allow_failures:
328    - env: UNRELIABLE=true
329