|
1 |
| -sudo: required |
2 |
| -dist: trusty |
3 |
| - |
4 |
| -#workaround for https://github.com/travis-ci/travis-ci/issues/5227 |
5 |
| -addons: |
6 |
| - hostname: bitcoin-tester |
| 1 | +# The test build matrix (stage: test) is constructed to test a wide range of |
| 2 | +# configurations, rather than a single pass/fail. This helps to catch build |
| 3 | +# failures and logic errors that present on platforms other than the ones the |
| 4 | +# author has tested. |
| 5 | +# |
| 6 | +# Some builders use the dependency-generator in `./depends`, rather than using |
| 7 | +# apt-get to install build dependencies. This guarantees that the tester is |
| 8 | +# using the same versions as Gitian, so the build results are nearly identical |
| 9 | +# to what would be found in a final release. |
| 10 | +# |
| 11 | +# In order to avoid rebuilding all dependencies for each build, the binaries |
| 12 | +# are cached and re-used when possible. Changes in the dependency-generator |
| 13 | +# will trigger cache-invalidation and rebuilds as necessary. |
| 14 | +# |
| 15 | +# These caches can be manually removed if necessary. This is one of the very |
| 16 | +# few manual operations that is possible with Travis, and it can be done by a |
| 17 | +# Bitcoin Core GitHub member via the Travis web interface [0]. |
| 18 | +# |
| 19 | +# Travis CI uploads the cache after the script phase of the build [1]. |
| 20 | +# However, the build is terminated without saving the chache if it takes over |
| 21 | +# 50 minutes [2]. Thus, if we spent too much time in early build stages, fail |
| 22 | +# with an error and save the cache. |
| 23 | +# |
| 24 | +# [0] https://travis-ci.org/bitcoin/bitcoin/caches |
| 25 | +# [1] https://docs.travis-ci.com/user/caching/#build-phases |
| 26 | +# [2] https://docs.travis-ci.com/user/customizing-the-build#build-timeouts |
7 | 27 |
|
| 28 | +dist: xenial |
8 | 29 | os: linux
|
9 |
| -language: generic |
| 30 | +language: minimal |
10 | 31 | cache:
|
| 32 | + ccache: true |
11 | 33 | directories:
|
12 |
| - - depends/built |
13 |
| - - depends/sdk-sources |
14 |
| - - $HOME/.ccache |
| 34 | + - depends/built |
| 35 | + - depends/sdk-sources |
| 36 | + - $HOME/.ccache |
| 37 | +stages: |
| 38 | + - test |
15 | 39 | env:
|
16 | 40 | global:
|
17 | 41 | - MAKEJOBS=-j3
|
18 |
| - - RUN_TESTS=false |
19 |
| - - CHECK_DOC=0 |
| 42 | + - RUN_UNIT_TESTS=true |
| 43 | + - RUN_FUNCTIONAL_TESTS=true |
| 44 | + - DOCKER_NAME_TAG=ubuntu:18.04 |
20 | 45 | - BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID
|
21 | 46 | - CCACHE_SIZE=100M
|
22 | 47 | - CCACHE_TEMPDIR=/tmp/.ccache-temp
|
23 | 48 | - CCACHE_COMPRESS=1
|
| 49 | + - CCACHE_DIR=$HOME/.ccache |
24 | 50 | - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
|
25 | 51 | - SDK_URL=https://bitcoincore.org/depends-sources/sdks
|
26 |
| - - PYTHON_DEBUG=1 |
27 | 52 | - WINEDEBUG=fixme-all
|
28 |
| - matrix: |
29 |
| -# ARM |
30 |
| - - HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" |
31 |
| -# Win32 |
32 |
| -# - HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.6 bc openjdk-7-jre-headless" RUN_TESTS=false GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports" MAKE_OPTS="CXXFLAGS=\"-DCURL_STATICLIB $(pkg-config --libs --cflags --static libcurl)\"" |
33 |
| -# 32-bit + dash |
34 |
| - - HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc python3-zmq openjdk-7-jre-headless" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash" |
35 |
| -# Win64 |
36 |
| -# - HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine1.6 bc openjdk-7-jre-headless" RUN_TESTS=false GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports" MAKE_OPTS="CXXFLAGS=\"-DCURL_STATICLIB $(pkg-config --libs --cflags --static libcurl)\"" |
37 |
| -# bitcoind |
38 |
| - - HOST=x86_64-unknown-linux-gnu PACKAGES="bc python3-zmq openjdk-7-jre-headless" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" |
39 |
| -# Cross-Mac |
40 |
| - - HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.11 GOAL="deploy" |
41 |
| - |
| 53 | + - DOCKER_PACKAGES="build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache python3 autoconf" |
| 54 | + - CACHE_ERR_MSG="Error! Initial build successful, but not enough time remains to run later build stages and tests. Please manually re-run this job by using the travis restart button or asking a maintainer to restart. The next run should not time out because the build cache has been saved." |
42 | 55 | before_install:
|
43 |
| - - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g") |
| 56 | + - set -o errexit; source .travis/test_03_before_install.sh |
44 | 57 | install:
|
45 |
| - - if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi |
46 |
| - - if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi |
47 |
| - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi |
48 |
| - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi |
| 58 | + - set -o errexit; source .travis/test_04_install.sh |
49 | 59 | before_script:
|
50 |
| - - unset CC; unset CXX |
51 |
| - - if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/check-doc.py; fi |
52 |
| - - mkdir -p depends/SDKs depends/sdk-sources |
53 |
| - - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi |
54 |
| - - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi |
55 |
| - - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS |
| 60 | + - set -o errexit; source .travis/test_05_before_script.sh |
56 | 61 | script:
|
57 |
| - - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1` |
58 |
| - - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi |
59 |
| - - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST |
60 |
| - - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" |
61 |
| - - depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE |
62 |
| - - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh |
63 |
| - - mkdir build && cd build |
64 |
| - - ../configure $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) |
65 |
| - - make $MAKEJOBS $GOAL $MAKE_OPTS || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) |
66 |
| - - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib |
67 |
| - - if [ "$RUN_TESTS" = "true" ]; then make $MAKEJOBS check VERBOSE=1; fi |
68 |
| - - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.py -parallel=1 --coverage; fi |
| 62 | + - export CONTINUE=1 |
| 63 | + - if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long |
| 64 | + - if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi |
| 65 | + - if [ $SECONDS -gt 2000 ]; then export CONTINUE=0; fi # Likely the build took very long; The tests take about 1000s, so we should abort if we have less than 50*60-1000=2000s left |
| 66 | + - if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi |
69 | 67 | after_script:
|
70 |
| - - echo $TRAVIS_COMMIT_RANGE |
71 |
| - - echo $TRAVIS_COMMIT_LOG |
| 68 | + - echo $TRAVIS_COMMIT_RANGE |
| 69 | + - echo $TRAVIS_COMMIT_LOG |
| 70 | +jobs: |
| 71 | + include: |
| 72 | + |
| 73 | + - stage: test |
| 74 | + name: 'ARM [GOAL: install] [no tests]' |
| 75 | + env: >- |
| 76 | + HOST=arm-linux-gnueabihf |
| 77 | + PACKAGES="g++-arm-linux-gnueabihf" |
| 78 | + RUN_UNIT_TESTS=false |
| 79 | + RUN_FUNCTIONAL_TESTS=false |
| 80 | + GOAL="install" |
| 81 | + # -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1" |
| 82 | + # This could be removed once the ABI change warning does not show up by default |
| 83 | + NAVCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CXXFLAGS=-Wno-psabi" |
| 84 | +
|
| 85 | + - stage: test |
| 86 | + name: 'Win32 [GOAL: install] [no functional tests]' |
| 87 | + env: >- |
| 88 | + HOST=i686-w64-mingw32 |
| 89 | + DPKG_ADD_ARCH="i386" |
| 90 | + PACKAGES="nsis g++-mingw-w64-i686 wine-binfmt wine32" |
| 91 | + RUN_FUNCTIONAL_TESTS=false |
| 92 | + GOAL="install" |
| 93 | + NAVCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests" |
| 94 | +
|
| 95 | + - stage: test |
| 96 | + name: 'Win64 [GOAL: install] [no functional tests]' |
| 97 | + env: >- |
| 98 | + HOST=x86_64-w64-mingw32 |
| 99 | + PACKAGES="nsis g++-mingw-w64-x86-64 wine-binfmt wine64" |
| 100 | + RUN_FUNCTIONAL_TESTS=false |
| 101 | + GOAL="install" |
| 102 | + NAVCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests" |
| 103 | +
|
| 104 | + - stage: test |
| 105 | + name: 'i686 Linux [GOAL: install] [dash shell]' |
| 106 | + env: >- |
| 107 | + HOST=i686-pc-linux-gnu |
| 108 | + PACKAGES="g++-multilib python3-zmq" |
| 109 | + DEP_OPTS="NO_QT=1" |
| 110 | + GOAL="install" |
| 111 | + NAVCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" |
| 112 | + CONFIG_SHELL="/bin/dash" |
| 113 | +
|
| 114 | + - stage: test |
| 115 | + name: 'x86_64 Linux [GOAL: install]' |
| 116 | + env: >- |
| 117 | + HOST=x86_64-unknown-linux-gnu |
| 118 | + PACKAGES="python3-zmq" |
| 119 | + DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" |
| 120 | + GOAL="install" |
| 121 | + NAVCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" |
| 122 | +
|
| 123 | + - stage: test |
| 124 | + name: 'macOS 10.10 [GOAL: deploy] [no tests]' |
| 125 | + env: >- |
| 126 | + HOST=x86_64-apple-darwin14 |
| 127 | + PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools" |
| 128 | + OSX_SDK=10.11 |
| 129 | + RUN_UNIT_TESTS=false |
| 130 | + RUN_FUNCTIONAL_TESTS=false |
| 131 | + GOAL="deploy" |
| 132 | + NAVCOIN_CONFIG="--enable-reduce-exports --enable-werror" |
0 commit comments