2020-06-06 21:52:46 -04:00
# Travis caches can be manually removed if necessary. This is one of the very
2019-03-28 20:12:50 -03:00
# few manual operations that is possible with Travis, and it can be done by a
# Bitcoin Core GitHub member via the Travis web interface [0].
#
# Travis CI uploads the cache after the script phase of the build [1].
2019-08-15 22:12:40 -04:00
# However, the build is terminated without saving the cache if it takes over
2019-03-28 20:12:50 -03:00
# 50 minutes [2]. Thus, if we spent too much time in early build stages, fail
# with an error and save the cache.
#
# [0] https://travis-ci.org/bitcoin/bitcoin/caches
# [1] https://docs.travis-ci.com/user/caching/#build-phases
# [2] https://docs.travis-ci.com/user/customizing-the-build#build-timeouts
2020-03-26 13:04:32 -03:00
version : ~> 1.0
2020-06-13 11:55:14 -04:00
dist : bionic
2014-08-20 13:00:00 -04:00
os : linux
2017-10-18 15:24:21 -03:00
language : minimal
2019-11-04 15:57:02 -03:00
arch : amd64
2016-05-17 17:54:41 -04:00
cache :
directories :
2019-06-14 10:49:00 -04:00
- $TRAVIS_BUILD_DIR/depends/built
- $TRAVIS_BUILD_DIR/depends/sdk-sources
2019-08-27 15:53:02 -04:00
- $TRAVIS_BUILD_DIR/ci/scratch/.ccache
2019-01-05 16:20:42 -03:00
- $TRAVIS_BUILD_DIR/releases/$HOST
2018-05-07 07:24:19 -03:00
stages :
2018-05-12 16:43:30 -03:00
- lint
2018-05-07 07:24:19 -03:00
- test
2014-08-20 13:00:00 -04:00
env :
global :
2019-08-10 12:56:46 -04:00
- CI_RETRY_EXE="travis_retry"
2019-11-08 14:55:34 -03:00
- 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."
2018-08-02 06:22:55 -04:00
before_install :
2019-08-10 12:56:46 -04:00
- set -o errexit; source ./ci/test/00_setup_env.sh
2019-08-10 11:32:55 -04:00
- set -o errexit; source ./ci/test/03_before_install.sh
2018-08-02 06:22:55 -04:00
install :
2019-08-10 11:32:55 -04:00
- set -o errexit; source ./ci/test/04_install.sh
2018-08-02 06:22:55 -04:00
before_script :
2020-06-14 10:23:57 -04:00
# Temporary workaround for https://github.com/bitcoin/bitcoin/issues/16368
- for i in {1..4}; do echo "$(sleep 500)" ; done &
- set -o errexit; source ./ci/test/05_before_script.sh &> "/dev/null"
2018-08-02 06:22:55 -04:00
script :
2019-03-28 20:12:50 -03:00
- export CONTINUE=1
- if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long
2020-06-14 10:23:57 -04:00
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
2019-08-10 11:32:55 -04:00
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
2020-07-13 11:18:42 -04:00
- if [[ $SECONDS -gt 50*60-$EXPECTED_TESTS_DURATION_IN_SECONDS ]]; then export CONTINUE=0; fi
2020-06-14 10:23:57 -04:00
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
2019-08-10 11:32:55 -04:00
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
2018-08-02 06:22:55 -04:00
after_script :
2018-08-03 09:39:05 -04:00
- echo $TRAVIS_COMMIT_RANGE
2018-08-02 06:22:55 -04:00
jobs :
include :
2018-12-21 15:37:46 -03:00
2018-08-03 09:39:05 -04:00
- stage : lint
2018-12-21 15:37:46 -03:00
name : 'lint'
2018-08-03 09:39:05 -04:00
env :
2020-04-09 19:59:38 -04:00
cache : pip
2018-08-03 09:39:05 -04:00
language : python
2020-07-13 00:25:47 -04:00
python : '3.6' # Oldest supported version according to doc/dependencies.md
2018-08-03 09:39:05 -04:00
install :
2019-08-10 11:32:55 -04:00
- set -o errexit; source ./ci/lint/04_install.sh
2018-08-03 09:39:05 -04:00
before_script :
2019-08-10 11:32:55 -04:00
- set -o errexit; source ./ci/lint/05_before_script.sh
2018-08-03 09:39:05 -04:00
script :
2019-08-10 11:32:55 -04:00
- set -o errexit; source ./ci/lint/06_script.sh