2019-03-28 20:12:50 -03:00
# The test build matrix (stage: test) is constructed to test a wide range of
# configurations, rather than a single pass/fail. This helps to catch build
# failures and logic errors that present on platforms other than the ones the
# author has tested.
#
# Some builders use the dependency-generator in `./depends`, rather than using
# apt-get to install build dependencies. This guarantees that the tester is
# using the same versions as Gitian, so the build results are nearly identical
# to what would be found in a final release.
#
# In order to avoid rebuilding all dependencies for each build, the binaries
# are cached and re-used when possible. Changes in the dependency-generator
# will trigger cache-invalidation and rebuilds as necessary.
#
# These caches can be manually removed if necessary. This is one of the very
# 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
2018-12-28 11:26:14 -03:00
dist : xenial
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 :
2018-03-05 19:23:35 -03:00
ccache : true
2016-05-17 17:54:41 -04:00
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-10-14 18:00:49 -03:00
# macOS
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
before_cache :
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
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-04 15:54:05 -03:00
- CI_WAIT="while sleep 500; do echo .; done"
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 :
2019-08-10 11:32:55 -04:00
- set -o errexit; source ./ci/test/05_before_script.sh
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
2019-08-13 10:03:21 -04:00
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # Whitelisted repo (90 minutes build time)
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
2019-04-11 13:52:02 -04:00
- 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
2019-08-13 10:03:21 -04:00
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # Whitelisted repo (90 minutes build time)
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 :
cache : false
language : python
2019-02-20 20:13:43 -03:00
python : '3.5' # 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
2018-12-21 15:37:46 -03:00
2018-08-02 06:22:55 -04:00
- stage : test
2019-11-25 17:08:37 -03:00
name: 'ARM [GOAL : install] [bionic] [unit tests, functional tests]'
2019-10-10 20:04:49 -03:00
arch : arm64
2018-08-02 06:22:55 -04:00
env : >-
2019-08-15 16:51:31 -04:00
FILE_ENV="./ci/test/00_setup_env_arm.sh"
2019-10-10 20:04:49 -03:00
QEMU_USER_CMD="" # Can run the tests natively without qemu
2018-12-21 15:37:46 -03:00
2019-11-25 09:13:11 -03:00
- stage : test
2019-11-25 17:08:37 -03:00
name: 'S390x [GOAL : install] [bionic] [unit tests, functional tests]'
2019-11-25 09:13:11 -03:00
arch : s390x
env : >-
FILE_ENV="./ci/test/00_setup_env_s390x.sh"
2018-08-02 06:22:55 -04:00
- stage : test
2019-10-02 18:10:57 -03:00
name: 'Win64 [GOAL : deploy] [unit tests, no gui, no functional tests]'
2018-08-02 06:22:55 -04:00
env : >-
2019-08-15 16:51:31 -04:00
FILE_ENV="./ci/test/00_setup_env_win64.sh"
2018-12-21 15:37:46 -03:00
2018-08-02 06:22:55 -04:00
- stage : test
2019-10-12 12:48:17 -03:00
name: '32-bit + dash [GOAL : install] [gui]'
2018-08-02 06:22:55 -04:00
env : >-
2019-08-15 16:51:31 -04:00
FILE_ENV="./ci/test/00_setup_env_i686.sh"
2018-12-21 15:37:46 -03:00
2018-08-02 06:22:55 -04:00
- stage : test
2019-11-29 16:46:49 -03:00
name: 'x86_64 Linux [GOAL : install] [CentOS 7] [no depends, only system libs]'
2018-08-02 06:22:55 -04:00
env : >-
2019-11-29 16:46:49 -03:00
FILE_ENV="./ci/test/00_setup_env_native_centos.sh"
2018-12-21 15:37:46 -03:00
2019-01-28 13:42:59 -03:00
- stage : test
2019-03-13 09:40:45 -03:00
name: 'x86_64 Linux [GOAL : install] [bionic] [uses qt5 dev package instead of depends Qt to speed up build and avoid timeout] [unsigned char]'
2019-01-28 13:42:59 -03:00
env : >-
2019-11-04 15:57:02 -03:00
FILE_ENV="./ci/test/00_setup_env_native_qt5.sh"
2019-01-28 13:42:59 -03:00
2018-10-20 07:31:56 -03:00
- stage : test
2018-12-21 15:37:46 -03:00
name: 'x86_64 Linux [GOAL: install] [xenial] [no depends, only system libs, sanitizers : thread (TSan), no wallet]'
2018-10-20 07:31:56 -03:00
env : >-
2019-11-04 15:57:02 -03:00
FILE_ENV="./ci/test/00_setup_env_native_tsan.sh"
2019-09-23 12:36:04 -03:00
TEST_RUNNER_EXTRA="--exclude feature_block" # Not enough memory on travis machines
2018-12-21 15:37:46 -03:00
2018-08-24 20:20:25 -03:00
- stage : test
2018-12-21 15:37:46 -03:00
name: 'x86_64 Linux [GOAL: install] [bionic] [no depends, only system libs, sanitizers : address/leak (ASan + LSan) + undefined (UBSan) + integer]'
2018-08-24 20:20:25 -03:00
env : >-
2019-11-04 15:57:02 -03:00
FILE_ENV="./ci/test/00_setup_env_native_asan.sh"
2018-12-21 15:37:46 -03:00
2019-01-16 13:49:01 -03:00
- stage : test
2019-09-30 15:03:12 -03:00
name: 'x86_64 Linux [GOAL: install] [bionic] [no depends, only system libs, sanitizers : fuzzer,address,undefined]'
2019-01-16 13:49:01 -03:00
env : >-
2019-11-04 15:57:02 -03:00
FILE_ENV="./ci/test/00_setup_env_native_fuzz.sh"
2019-01-16 13:49:01 -03:00
2018-08-02 06:22:55 -04:00
- stage : test
2018-12-21 15:37:46 -03:00
name: 'x86_64 Linux [GOAL : install] [bionic] [no wallet]'
2018-08-02 06:22:55 -04:00
env : >-
2019-11-04 15:57:02 -03:00
FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh"
2018-12-21 15:37:46 -03:00
2018-08-02 06:22:55 -04:00
- stage : test
2019-11-21 13:08:47 -03:00
name: 'macOS 10.12 [GOAL : deploy] [no functional tests]'
2018-08-02 06:22:55 -04:00
env : >-
2019-08-15 16:51:31 -04:00
FILE_ENV="./ci/test/00_setup_env_mac.sh"
2019-10-14 18:00:49 -03:00
- stage : test
2019-10-12 13:49:29 -03:00
name: 'macOS 10.14 native [GOAL : install] [GUI] [no depends]'
2019-10-14 18:00:49 -03:00
os : osx
# Use the most recent version:
2019-11-21 13:08:47 -03:00
# Xcode 11.2.1, macOS 10.14, JDK 13.0.1, SDK 10.15
2019-10-14 18:00:49 -03:00
# https://docs.travis-ci.com/user/reference/osx/#macos-version
2019-11-21 13:08:47 -03:00
osx_image : xcode11.2
2019-10-14 18:00:49 -03:00
env : >-
2019-10-24 13:45:43 -03:00
FILE_ENV="./ci/test/00_setup_env_mac_host.sh"