Skip to content

Commit fa2056a

Browse files
author
MarcoFalke
committed
travis: Properly cache and error on timeout
1 parent fa36a33 commit fa2056a

File tree

3 files changed

+33
-45
lines changed

3 files changed

+33
-45
lines changed

Diff for: .travis.yml

+33-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
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+
128
dist: xenial
229
os: linux
330
language: minimal
@@ -26,15 +53,19 @@ env:
2653
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
2754
- WINEDEBUG=fixme-all
2855
- 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."
2957
before_install:
3058
- set -o errexit; source .travis/test_03_before_install.sh
3159
install:
3260
- set -o errexit; source .travis/test_04_install.sh
3361
before_script:
3462
- set -o errexit; source .travis/test_05_before_script.sh
3563
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 [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
67+
- if [ $SECONDS -gt 1800 ]; then export CONTINUE=0; fi # Likely the build took very long
68+
- if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
3869
after_script:
3970
- echo $TRAVIS_COMMIT_RANGE
4071
- echo $TRAVIS_COMMIT_LOG

Diff for: doc/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ The Bitcoin repo's [root README](/README.md) contains relevant information on th
5757
- [Source Code Documentation (External Link)](https://dev.visucore.com/bitcoin/doxygen/)
5858
- [Translation Process](translation_process.md)
5959
- [Translation Strings Policy](translation_strings_policy.md)
60-
- [Travis CI](travis-ci.md)
6160
- [JSON-RPC Interface](JSON-RPC-interface.md)
6261
- [Unauthenticated REST Interface](REST-interface.md)
6362
- [Shared Libraries](shared-libraries.md)

Diff for: doc/travis-ci.md

-42
This file was deleted.

0 commit comments

Comments
 (0)