|
| 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 |
| 27 | + |
1 | 28 | dist: xenial |
2 | 29 | os: linux |
3 | 30 | language: minimal |
|
26 | 53 | - SDK_URL=https://bitcoincore.org/depends-sources/sdks |
27 | 54 | - WINEDEBUG=fixme-all |
28 | 55 | - DOCKER_PACKAGES="build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache" |
| 56 | + - 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 bitcoin maintainer to restart. The next run should not time out because the build cache has been saved." |
29 | 57 | before_install: |
30 | 58 | - set -o errexit; source .travis/test_03_before_install.sh |
31 | 59 | install: |
32 | 60 | - set -o errexit; source .travis/test_04_install.sh |
33 | 61 | before_script: |
34 | 62 | - set -o errexit; source .travis/test_05_before_script.sh |
35 | 63 | script: |
36 | | - - if [ $SECONDS -gt 1200 ]; then set +o errexit; echo "Travis early exit to cache current state"; false; else set -o errexit; source .travis/test_06_script_a.sh; fi |
37 | | - - if [ $SECONDS -gt 1800 ]; then set +o errexit; echo "Travis early exit to cache current state"; false; else set -o errexit; source .travis/test_06_script_b.sh; fi |
| 64 | + - export CONTINUE=1 |
| 65 | + - if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long |
| 66 | + - if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # Whitelisted repo (90 minutes build time) |
| 67 | + - if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi |
| 68 | + - 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 |
| 69 | + - if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # Whitelisted repo (90 minutes build time) |
| 70 | + - if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi |
38 | 71 | after_script: |
39 | 72 | - echo $TRAVIS_COMMIT_RANGE |
40 | 73 | - echo $TRAVIS_COMMIT_LOG |
|
0 commit comments