|
1 |
| -sudo: required |
| 1 | +# Travis caches can be manually removed if necessary. This is one of the very |
| 2 | +# few manual operations that is possible with Travis, and it can be done by a |
| 3 | +# gridcoin-community GitHub member via the Travis web interface [0]. |
| 4 | +# |
| 5 | +# Travis CI uploads the cache after the script phase of the build [1]. |
| 6 | +# However, the build is terminated without saving the cache if it takes over |
| 7 | +# 50 minutes [2]. Thus, if we spent too much time in early build stages, fail |
| 8 | +# with an error and save the cache. |
| 9 | +# |
| 10 | +# [0] https://travis-ci.org/gridcoin-community/Gridcoin-Research/caches |
| 11 | +# [1] https://docs.travis-ci.com/user/caching/#build-phases |
| 12 | +# [2] https://docs.travis-ci.com/user/customizing-the-build#build-timeouts |
| 13 | + |
| 14 | +version: ~> 1.0 |
| 15 | + |
2 | 16 | dist: bionic
|
3 | 17 | os: linux
|
4 |
| -language: minimal |
| 18 | +language: shell |
| 19 | +arch: amd64 |
5 | 20 | cache:
|
| 21 | + ccache: true |
6 | 22 | directories:
|
7 |
| - - depends/built |
8 |
| - - depends/sdk-sources |
9 |
| - - $HOME/.ccache |
| 23 | + - $TRAVIS_BUILD_DIR/depends/built |
| 24 | + - $TRAVIS_BUILD_DIR/depends/sdk-sources |
| 25 | + - $TRAVIS_BUILD_DIR/ci/scratch/.ccache |
| 26 | + - $TRAVIS_BUILD_DIR/releases/$HOST |
| 27 | +stages: |
| 28 | + - test |
10 | 29 | env:
|
11 | 30 | global:
|
12 |
| - - MAKEJOBS=-j3 |
13 |
| - - RUN_TESTS=true |
14 |
| - - CHECK_DOC=0 |
15 |
| - - BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID |
16 |
| - - CCACHE_SIZE=100M |
17 |
| - - CCACHE_TEMPDIR=/tmp/.ccache-temp |
18 |
| - - CCACHE_COMPRESS=1 |
19 |
| - - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out |
20 |
| - - SDK_URL=https://bitcoincore.org/depends-sources/sdks |
21 |
| - - PYTHON_DEBUG=1 |
22 |
| - - WINEDEBUG=fixme-all |
23 |
| - matrix: |
24 |
| -# ARM |
25 |
| - - HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf zlib1g-dev" GCCFLAGS="-fPIC" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" GRIDCOIN_CONFIG="--enable-glibc-back-compat --disable-tests RUN_TESTS=false" |
26 |
| -# Win32 |
27 |
| - - HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.6" RUN_TESTS=false GOAL="" GRIDCOIN_CONFIG="--enable-reduce-exports" |
28 |
| -# Qt5 & system libs |
29 |
| - - HOST=x86_64-unknown-linux-gnu PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libqt5charts5-dev libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev protobuf-compiler libqrencode-dev xvfb zlib1g-dev" NO_DEPENDS=1 NEED_XVFB=1 RUN_TESTS=true GOAL="install" GRIDCOIN_CONFIG=" --with-incompatible-bdb --enable-reduce-exports --with-gui=qt5" |
30 |
| -# 32-bit + dash |
31 |
| - - HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" DEP_OPTS="NO_QT=1" RUN_TESTS=false GOAL="install" GRIDCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash" |
32 |
| -# Win64 |
33 |
| - - HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" PACKAGES="gcc-7 python3 nsis g++-mingw-w64-x86-64 wine1.6 xvfb" DEP_OPTS="NO_QT=1" RUN_TESTS=false GOAL="" GRIDCOIN_CONFIG="--enable-reduce-exports" NEED_XVFB=1 |
34 |
| -# Cross-Mac - disabled for now, since we cannot compile QtSVG with the SDK |
35 |
| - #- HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" GRIDCOIN_CONFIG="--enable-gui --enable-reduce-exports" OSX_SDK=10.11 RUN_TESTS=false GOAL="deploy" |
36 |
| - |
| 31 | + - CI_RETRY_EXE="travis_retry" |
| 32 | + - CACHE_ERR_MSG="Error! Initial build successful, but not enough time remains to run later build stages and tests. See https://docs.travis-ci.com/user/customizing-the-build#build-timeouts . Please manually re-run this job by using the travis restart button. The next run should not time out because the build cache has been saved." |
37 | 33 | before_install:
|
38 |
| - - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g") |
39 |
| - #- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
40 |
| - - sudo apt-get update -q |
41 |
| - #- sudo apt-get install gcc-7 -y |
42 |
| - #- sudo apt-get install gcc-5-arm-linux-gnueabihf -y |
| 34 | + - set -o errexit; source ./ci/test/00_setup_env.sh |
| 35 | + - set -o errexit; source ./ci/test/03_before_install.sh |
43 | 36 | install:
|
44 |
| - - if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi |
45 |
| - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi |
46 |
| - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi |
| 37 | + - set -o errexit; source ./ci/test/04_install.sh |
47 | 38 | before_script:
|
48 |
| - - if [ "$HOST" == "i686-w64-mingw32" ]; then sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix; fi |
49 |
| - - if [ "$HOST" == "x86_64-w64-mingw32" ]; then sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; fi |
50 |
| - - unset CC; unset CXX |
51 |
| - - mkdir -p depends/SDKs depends/sdk-sources |
52 |
| - - 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 |
53 |
| - - 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 |
54 |
| - - if [ -z "$NO_DEPENDS" ]; then make $MAKEJOBS -C depends HOST=$HOST GCCFLAGS=$GCCFLAGS $DEP_OPTS; fi |
55 |
| - # Start xvfb if needed, as documented at https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI |
56 |
| - - if [ "$NEED_XVFB" = 1 ]; then export DISPLAY=:99.0; /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac; fi |
| 39 | + # Temporary workaround for https://github.com/bitcoin/bitcoin/issues/16368 |
| 40 | + - for i in {1..4}; do echo "$(sleep 500)" ; done & |
| 41 | + - set -o errexit; source ./ci/test/05_before_script.sh # &> "/dev/null" |
57 | 42 | script:
|
58 |
| - - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi |
59 |
| - - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST |
60 |
| - - GRIDCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" |
61 |
| - - if [ -z "$NO_DEPENDS" ]; then depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE; fi |
62 |
| - - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh |
63 |
| - - mkdir build && cd build |
64 |
| - - ../configure --cache-file=config.cache $GRIDCOIN_CONFIG_ALL $GRIDCOIN_CONFIG || ( cat config.log && false) |
65 |
| - - make distdir VERSION=$HOST |
66 |
| - - cd gridcoin-$HOST |
67 |
| - - ./configure --cache-file=../config.cache $GRIDCOIN_CONFIG_ALL $GRIDCOIN_CONFIG || ( cat config.log && false) |
68 |
| - - make GCCFLAGS=$GCCFLAGS $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make GCCFLAGS=$GCCFLAGS $GOAL V=1 ; false ) |
69 |
| - - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib |
70 |
| - - if [ "$HOST" = "x86_64-unknown-linux-gnu" ]; then travis_wait 30 make $MAKEJOBS check VERBOSE=1; fi |
71 |
| - - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude pruning,dbcrash"; fi |
| 43 | + - export CONTINUE=1 |
| 44 | + - if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long |
| 45 | + - if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi |
| 46 | + - 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 |
| 47 | + - if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi |
| 48 | +after_script: |
| 49 | + - echo $TRAVIS_COMMIT_RANGE |
| 50 | +jobs: |
| 51 | + fast_finish: true |
| 52 | + allow_failures: |
| 53 | + - stage: lint |
| 54 | + |
| 55 | + include: |
| 56 | + - stage: lint |
| 57 | + name: 'lint' |
| 58 | + env: |
| 59 | + cache: pip |
| 60 | + language: python |
| 61 | + python: '3.5' |
| 62 | + install: |
| 63 | + - set -o errexit; source ./ci/lint/04_install.sh |
| 64 | + before_script: |
| 65 | + - set -o errexit; source ./ci/lint/05_before_script.sh |
| 66 | + script: |
| 67 | + - set -o errexit; source ./ci/lint/06_script.sh |
| 68 | + |
| 69 | + - stage: test |
| 70 | + name: 'ARM [GOAL: install] [buster]' |
| 71 | + arch: arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu |
| 72 | + env: >- |
| 73 | + FILE_ENV="./ci/test/00_setup_env_arm.sh" |
| 74 | + QEMU_USER_CMD="" |
| 75 | +
|
| 76 | + - stage: test |
| 77 | + name: 'Win32' |
| 78 | + env: >- |
| 79 | + FILE_ENV="./ci/test/00_setup_env_win32.sh" |
| 80 | +
|
| 81 | + - stage: test |
| 82 | + name: 'Win64' |
| 83 | + env: >- |
| 84 | + FILE_ENV="./ci/test/00_setup_env_win64.sh" |
| 85 | +
|
| 86 | + - stage: test |
| 87 | + name: 'i386 Linux [GOAL: install] [focal]' |
| 88 | + env: >- |
| 89 | + FILE_ENV="./ci/test/00_setup_env_linux_i386.sh" |
| 90 | +
|
| 91 | + - stage: test |
| 92 | + name: 'x86_64 Linux [GOAL: install] [GUI] [focal] [no depends]' |
| 93 | + env: >- |
| 94 | + FILE_ENV="./ci/test/00_setup_env_native.sh" |
| 95 | +
|
| 96 | + - stage: test |
| 97 | + name: 'macOS 10.12 [no tests]' |
| 98 | + env: >- |
| 99 | + FILE_ENV="./ci/test/00_setup_env_mac.sh" |
| 100 | +
|
| 101 | + - stage: test |
| 102 | + name: 'macOS 10.15 native [GOAL: install] [GUI] [no depends]' |
| 103 | + os: osx |
| 104 | + # Use the most recent version: |
| 105 | + # Xcode 12.0, macOS 10.15, SDK 10.16 |
| 106 | + # https://docs.travis-ci.com/user/reference/osx/#macos-version |
| 107 | + osx_image: xcode12 |
| 108 | + addons: |
| 109 | + homebrew: |
| 110 | + packages: |
| 111 | + - berkeley-db4 |
| 112 | + - miniupnpc |
| 113 | + - qrencode |
| 114 | + - ccache |
| 115 | + - libzip |
| 116 | + env: >- |
| 117 | + DANGER_RUN_CI_ON_HOST=true |
| 118 | + CI_USE_APT_INSTALL=no |
| 119 | + FILE_ENV="./ci/test/00_setup_env_mac_host.sh" |
0 commit comments