2021-12-19 09:33:39 +01:00
# errata:
# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback]
# IPv6 support
2019-04-09 17:17:25 +02: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.
#
2020-03-26 19:04:38 +01:00
version : ~> 1.0
2021-12-19 09:33:39 +01:00
dist : xenial
os : linux
language : minimal
2022-06-22 19:17:47 +02:00
arch : amd64
2021-12-19 09:33:39 +01:00
services :
- docker
cache :
ccache : true
directories :
2020-02-12 15:19:50 +01:00
- $BASE_BUILD_DIR/releases/$HOST
2019-10-14 23:00:49 +02:00
before_cache :
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
2021-12-19 09:33:39 +01:00
env :
global :
# DOCKER_HUB_USER
- secure : "J0T+zrRBBzBnxoioCD378cRSJUF8Vms32QMmrENVVfuJl03oBQv0QxSatLEiD4PtRPrN00mJ8/k/HdqFQ0SN1yg6a00duOZ6C9jk6t/fExBO1LNhp3Z7lcaMUrNEyRN6sgfVeznDVTGj9jBQU2HNlwHk0UD9BNp/k+Bjhrtw7Njp9JTLZKBgxrXk0WZmfk0d75Q+9DajA1j2tSfWVpwzv6HMGfqIH1wsVEakBY+tnaE6EO3IdzdWHhf/iV+Tx0tL0Qz/6mejgSuoGLTJLmeTrceTTmsDlN3B95y+XfcYDs6EP7gpzN8Ffg/mLV8xJ2Myj7+b1o+smMJZE5tLuPIeAu0YsfkPNa/tNLotOlDxF72per0kXyNYbRf+JrpxiOu9pLCtdtd40V2SsiNhpQqHVy+b+wkkqo2syTHT+9UNkqEi3WFm6TqFuOeQNtDm6R0hRl/Talw/ZEeKs68z1Cf6VyBrZG5LqtOurtWlKwXCe/Tr1i2g4BEAcbywphtCCcfgMK9YSGQnjKkGk6k9gVEa2bneYLZz1RSh2OpXnIsIJOX7X0hNd5xtQDLgbpSUlKwVcEriWeGe12GCszKNX9gdEo2bHeq4xAJ6BE+ot745z9dc+nC2BJ6Su+I5L6zBg4m2FWn0TWhPvz/6JR26t6ls/E7m+hkwJTCHnIUiFmmzpEw="
# DOCKER_HUB_PASSWORD
- secure : "RLzlMhfLqwSBrZqJOVOd61suXBn+HtUR3vOZfuFYF/Qmjjj5TE41+rObZmzc54hP/ZL+OH6blnibpvfDXlX+eN38ivFQfuxkJIGL68SJsEwNBRwW39Yw6Hl5RdI41MLCH7ByN15wifLp1JKBilHJ7XGMOUjI7P0yl7JjX8GBXUCtJbVLRugo80/yn+XQ1NdnlpbpYHNjMEQFWSODPa3pSK5McWvyQjDZDgS+IkdrZmIYJPMa7bmKH5I/edUPSmXQT905FgEwq9u8XR0SyBopli21EK9l6GkXIIvmDTYz5vT26Apvi2B4Aoazlklg+KNRUJuLGerpt6kbnU0gMSUChVkFfFhOk6GRSN3a/AUfD2FOudvMhet2QvlPHx+GYdEUr5XVo5HW42pHsqfD6eDtHd8VLTsHP0q4C8V85fNMv21lkkehy2ry8fx/RRy6x4O2wg2mua+79UkGKXp75gMKzWEcth34PCFCOu37l2F8R/ANnrQ52K/8vIQ88TtU2OpYX89fHjLojBxu+WKEBGZH2LRPsZBOUHeeO5C/xKDrhZU24ORnMW8wg66Qg5GIX1KI4a8yp73Mpues5hzpJ6wkMuRrQt40ymKndLCjv8KSd+5BfP6Or/KIrzDNYdZaasjk7JNi6rcZmm9d3fTAo+Ja/mjpUCIOo3SX14luzVCJIig="
- DOCKER_BUILD=false
stages :
- build depends
- build src
- run tests
- build docker
builddepends : &builddepends
stage : build depends
script :
2021-12-13 08:01:14 +01:00
- $DOCKER_RUN_IN_BUILDER ./ci/dash/build_depends.sh
2021-12-19 09:33:39 +01:00
buildsrc : &buildsrc
stage : build src
script :
2021-12-13 08:01:14 +01:00
- $DOCKER_RUN_IN_BUILDER ./ci/dash/build_depends.sh
- $DOCKER_RUN_IN_BUILDER ./ci/dash/build_src.sh
2021-12-19 09:33:39 +01:00
runtests : &runtests
stage : run tests
script :
2021-12-13 08:01:14 +01:00
- $DOCKER_RUN_IN_BUILDER ./ci/dash/build_depends.sh
- $DOCKER_RUN_IN_BUILDER ./ci/dash/build_src.sh
- $DOCKER_RUN_IN_BUILDER ./ci/dash/test_unittests.sh
2021-12-19 09:33:39 +01:00
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude feature_pruning,feature_dbcrash"; fi
- $DOCKER_RUN_IN_BUILDER ./ci/test_integrationtests.sh --quiet --jobs=3 ${extended}
builddocker : &builddocker
stage : build docker
script :
# no need to run tests again here
2021-12-21 08:10:24 +01:00
- if [ "$DOCKER_BUILD" = "true" ]; then $DOCKER_RUN_IN_BUILDER ./ci/dash/build_depends.sh && $DOCKER_RUN_IN_BUILDER ./ci/dash/build_src.sh && BUILD_DIR=build-ci/dashcore-$BUILD_TARGET ./ci/dash/build-docker.sh; fi
2021-12-13 07:54:31 +01:00
- CI_RETRY_EXE="travis_retry"
2019-11-20 18:47:25 +01:00
- CI_WAIT="while sleep 500; do echo .; done"
- 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."
2021-12-19 09:33:39 +01:00
before_install :
2021-12-13 07:54:31 +01:00
- set -o errexit; source ./ci/test/00_setup_env.sh
- set -o errexit; source ./ci/test/03_before_install.sh
2021-12-19 09:33:39 +01:00
install :
2021-12-13 07:54:31 +01:00
- set -o errexit; source ./ci/test/04_install.sh
2021-12-19 09:33:39 +01:00
before_script :
2021-12-13 07:54:31 +01:00
- set -o errexit; source ./ci/test/05_before_script.sh
2021-12-19 09:33:39 +01:00
script :
- 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.sh; fi
after_script :
- echo $TRAVIS_COMMIT_RANGE
jobs :
include :
# build depends
- << : *builddepends
name : depends-arm-linux
env : BUILD_TARGET=arm-linux
- << : *builddepends
name : depends-win64
env : BUILD_TARGET=win64
- << : *builddepends
name : depends-linux64
env : BUILD_TARGET=linux64
- << : *builddepends
name : depends-linux64_nowallet
env : BUILD_TARGET=linux64_nowallet
- << : *builddepends
name : depends-linux64_release
env :
- BUILD_TARGET=linux64_release
- DOCKER_BUILD=true
- << : *builddepends
name : depends-mac
env : BUILD_TARGET=mac
# build source
- << : *buildsrc
name : src-arm-linux
env : BUILD_TARGET=arm-linux
- << : *buildsrc
name : src-win64
env : BUILD_TARGET=win64
- << : *buildsrc
name : src-linux64
env : BUILD_TARGET=linux64
- << : *buildsrc
name : src-linux64_nowallet
env : BUILD_TARGET=linux64_nowallet
- << : *buildsrc
name : src-linux64_release
env :
- BUILD_TARGET=linux64_release
- DOCKER_BUILD=true
- << : *buildsrc
name : src-mac
env : BUILD_TARGET=mac
# run tests (no tests for arm-linux and mac)
- << : *runtests
name : tests-win64
env : BUILD_TARGET=win64
- << : *runtests
name : tests-linux64
env : BUILD_TARGET=linux64
- << : *runtests
name : tests-linux64_nowallet
env : BUILD_TARGET=linux64_nowallet
- << : *runtests
name : tests-linux64_release
env :
- BUILD_TARGET=linux64_release
- DOCKER_BUILD=true
# build docker
- << : *builddocker
name : docker-linux64_release
env :
- BUILD_TARGET=linux64_release
- DOCKER_BUILD=true
before_cache :
# Save builder image
- docker save dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/dash-builder-$BUILD_TARGET.tar.gz
install :
# Fix annoying Travis bug: a branch with a single commit has an empty TRAVIS_COMMIT_RANGE sometimes
- if [ -z "$TRAVIS_COMMIT_RANGE" ]; then export TRAVIS_COMMIT_RANGE="HEAD~..HEAD"; fi
# Our scripts try to be Travis agnostic
- export PULL_REQUEST="$TRAVIS_PULL_REQUEST"
- export COMMIT_RANGE="$TRAVIS_COMMIT_RANGE"
- export JOB_NUMBER="$TRAVIS_JOB_NUMBER"
2022-03-25 08:09:24 +01:00
- export HOST_SRC_DIR=$BASE_BUILD_DIR
2021-12-19 09:33:39 +01:00
- export HOST_CACHE_DIR=$HOME/cache
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
- source ./ci/matrix.sh
- mkdir -p $HOST_CACHE_DIR/docker && mkdir -p $HOST_CACHE_DIR/ccache && mkdir -p $HOST_CACHE_DIR/depends && mkdir -p $HOST_CACHE_DIR/sdk-sources
# Keep this as it makes caching related debugging easier
- ls -lah $HOST_CACHE_DIR && ls -lah $HOST_CACHE_DIR/depends && ls -lah $HOST_CACHE_DIR/ccache && ls -lah $HOST_CACHE_DIR/docker
# Load cached builder image
- if [ -f $HOST_CACHE_DIR/docker/dash-builder-$BUILD_TARGET.tar.gz ]; then zcat $HOST_CACHE_DIR/docker/dash-builder-$BUILD_TARGET.tar.gz | docker load || true; fi
2023-05-10 11:52:49 +02:00
- travis_retry docker pull ubuntu:focal
2021-12-13 06:49:03 +01:00
- travis_retry docker build -t $BUILDER_IMAGE_NAME --build-arg=USER_ID=$UID --build-arg=GROUP_ID=$UID --build-arg=BUILD_TARGET=$BUILD_TARGET -f contrib/containers/ci/Dockerfile ci
2021-12-19 09:33:39 +01:00
before_script :
# Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout
# See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed.
- python3 -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
# Build docker image only for develop branch of the main repo
- if [ "$TRAVIS_REPO_SLUG" != "dashpay/dash" -o "$TRAVIS_BRANCH" != "develop" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then export DOCKER_BUILD="false"; echo DOCKER_BUILD=$DOCKER_BUILD; fi
2023-04-09 07:11:22 +02:00
# TODO(ignore if don't use travis): Check keys and signed commits
2019-04-09 17:17:25 +02:00
#- if [ "$TRAVIS_REPO_SLUG" = "dashpay/dash" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then travis_retry gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $(<contrib/verify-commits/trusted-keys); fi
2021-12-19 09:33:39 +01:00
#- if [ "$TRAVIS_REPO_SLUG" = "dashpay/dash" -a "$TRAVIS_EVENT_TYPE" = "cron" ]; then travis_wait 30 contrib/verify-commits/verify-commits.py; fi
after_script :
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG
after_success :
2021-12-21 08:10:24 +01:00
- if [ "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./ci/dash/push-docker.sh; fi
2021-12-19 09:33:39 +01:00
- stage : lint
name : 'lint'
env :
2020-04-13 17:44:59 +02:00
cache : pip
2021-12-19 09:33:39 +01:00
language : python
2023-05-10 10:29:23 +02:00
python : '3.8' # Oldest supported version according to doc/dependencies.md
2021-12-19 09:33:39 +01:00
install :
2021-12-13 07:54:31 +01:00
- set -o errexit; source ./ci/lint/04_install.sh
2021-12-19 09:33:39 +01:00
before_script :
2021-12-13 07:54:31 +01:00
- set -o errexit; source ./ci/lint/05_before_script.sh
2021-12-19 09:33:39 +01:00
script :
2021-12-13 07:54:31 +01:00
- set -o errexit; source ./ci/lint/06_script.sh
2021-12-19 09:33:39 +01:00
- stage : test
2023-05-10 11:52:49 +02:00
name: 'ARM [GOAL : install] [focal] [unit tests, functional tests]'
2020-03-26 19:04:38 +01:00
arch : arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu
2021-12-19 09:33:39 +01:00
env : >-
2019-08-15 22:51:31 +02:00
FILE_ENV="./ci/test/00_setup_env_arm.sh"
2020-03-26 19:04:38 +01:00
QEMU_USER_CMD=""
2019-08-15 22:51:31 +02:00
2020-04-09 16:17:20 +02:00
- stage : test
name: 's390x native BE [GOAL : install] [bionic] [no depends, no GUI]'
arch : s390x
dist : bionic
addons :
apt :
packages :
- bsdmainutils
- libboost-filesystem-dev
- libboost-system-dev
- libboost-test-dev
- libboost-thread-dev
- libdb++-dev
- libdb-dev
- libevent-dev
env : >-
DANGER_RUN_CI_ON_HOST=true
CI_USE_APT_INSTALL=no
FILE_ENV="./ci/test/00_setup_env_s390x_host.sh"
2020-02-10 13:49:36 +01:00
# s390 build was disabled temporarily because of disk space issues on the Travis VM
#
# - stage: test
# name: 'S390x [GOAL: install] [focal] [unit tests, functional tests]'
2020-03-26 19:04:38 +01:00
# arch: s390x # Can disable QEMU_USER_CMD and run the tests natively without qemu
2020-02-10 13:49:36 +01:00
# env: >-
# FILE_ENV="./ci/test/00_setup_env_s390x.sh"
2020-03-26 19:04:38 +01:00
# QEMU_USER_CMD=""
2019-11-25 20:57:37 +01:00
2021-12-19 09:33:39 +01:00
- stage : test
2019-10-02 23:10:57 +02:00
name: 'Win64 [GOAL : deploy] [unit tests, no gui, no functional tests]'
2021-12-19 09:33:39 +01:00
env : >-
2019-08-15 22:51:31 +02:00
FILE_ENV="./ci/test/00_setup_env_win64.sh"
2021-12-19 09:33:39 +01:00
- stage : test
2020-02-12 15:19:50 +01:00
name: 'x86_64 Linux [GOAL : install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]'
2021-12-19 09:33:39 +01:00
env : >-
2022-06-22 19:17:47 +02:00
FILE_ENV="./ci/test/00_setup_env_native_qt5.sh"
2018-11-27 22:30:32 +01:00
# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSan))
2021-12-19 09:33:39 +01:00
- stage : test
name: 'x86_64 Linux [GOAL: install] [xenial] [no depends, only system libs, sanitizers : thread (TSan), no wallet]'
env : >-
2022-06-22 19:17:47 +02:00
FILE_ENV="./ci/test/00_setup_env_native_tsan.sh"
2019-09-24 10:58:58 +02:00
TEST_RUNNER_EXTRA="--exclude feature_block" # Not enough memory on travis machines
2018-11-27 22:30:32 +01:00
# x86_64 Linux (no depends, only system libs, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer)
2021-12-19 09:33:39 +01:00
- stage : test
2023-05-10 11:52:49 +02:00
name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers : address/leak (ASan + LSan) + undefined (UBSan) + integer]'
2021-12-19 09:33:39 +01:00
env : >-
2022-06-22 19:17:47 +02:00
FILE_ENV="./ci/test/00_setup_env_native_asan.sh"
2021-12-19 09:33:39 +01:00
- stage : test
2023-05-10 11:52:49 +02:00
name: 'x86_64 Linux [GOAL : install] [focal] [no wallet]'
2021-12-19 09:33:39 +01:00
env : >-
2022-06-22 19:17:47 +02:00
FILE_ENV="./ci/test/00_setup_env_native_fuzz.sh"
2020-02-19 17:20:27 +01:00
2020-06-25 14:58:08 +02:00
- stage : test
name: 'x86_64 Linux [GOAL : install] [focal] [no depends, only system libs, fuzzers under valgrind]'
env : >-
FILE_ENV="./ci/test/00_setup_env_native_fuzz_with_valgrind.sh"
2020-02-19 17:20:27 +01:00
- stage : test
2020-05-06 22:12:33 +02:00
name: 'x86_64 Linux [GOAL : install] [focal] [no wallet]'
2021-12-19 09:33:39 +01:00
env : >-
2022-06-22 19:17:47 +02:00
FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh"
2021-12-19 09:33:39 +01:00
- stage : test
2019-02-01 19:05:18 +01:00
name: 'macOS 10.12 [GOAL : deploy] [no functional tests]'
2021-12-19 09:33:39 +01:00
env : >-
2019-08-15 22:51:31 +02:00
FILE_ENV="./ci/test/00_setup_env_mac.sh"
2019-10-14 23:00:49 +02:00
- stage : test
2019-09-13 15:15:15 +02:00
name: 'macOS 10.14 native [GOAL : install] [GUI] [no depends]'
2019-10-14 23:00:49 +02:00
os : osx
# Use the most recent version:
2020-03-26 14:10:00 +01:00
# Xcode 11.3.1, macOS 10.14, SDK 10.15
2019-10-14 23:00:49 +02:00
# https://docs.travis-ci.com/user/reference/osx/#macos-version
2020-03-26 14:10:00 +01:00
osx_image : xcode11.3
2020-04-09 16:17:20 +02:00
cache :
directories :
- $TRAVIS_BUILD_DIR/ci/scratch/.ccache
- $TRAVIS_BUILD_DIR/releases/$HOST
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
2020-03-26 14:10:00 +01:00
addons :
homebrew :
packages :
- libtool
- berkeley-db4
- boost
- miniupnpc
- qt
- qrencode
- python3
- ccache
- zeromq
2019-10-14 23:00:49 +02:00
env : >-
2020-04-09 16:17:20 +02:00
DANGER_RUN_CI_ON_HOST=true
CI_USE_APT_INSTALL=no
2019-10-24 18:45:43 +02:00
FILE_ENV="./ci/test/00_setup_env_mac_host.sh"