Skip to content

Commit 367b023

Browse files
author
MarcoFalke
committed
Merge #16582: test: Rework ci (Use travis only as fallback env)
faeacf3 ci: Add note that this assumes a fresh git clone (MarcoFalke) fa6cbdc ci: Use ./ci/ on non-travis host (MarcoFalke) fa31bc3 ci: Remove dependence on travis, use it as fallback env (MarcoFalke) fa0aac0 ci: Add retry (MarcoFalke) fafe78f ci: Rename .travis/ to ./ci/ (MarcoFalke) Pull request description: This moves the `.travis` folder to `ci` and removes dependence on travis, so that the test script can be run anywhere. Top commit has no ACKs. Tree-SHA512: 4d8c82f3eb4e9e047444b0e0f700485e929a3c4d27fc8777a95b8847f23ed507d2701cc92730198b14d1e753cbb558ffac883da558fc2ec72b8a12c4eaec9000
2 parents 85883a9 + faeacf3 commit 367b023

19 files changed

+452
-82
lines changed

.cirrus.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,27 @@ task:
2727
- gmake check ${MAKEJOBS} VERBOSE=1
2828
functional_test_script:
2929
- ./test/functional/test_runner.py --jobs 9 --ci --extended --exclude feature_dbcrash --combinedlogslen=1000 --quiet --failfast
30+
task:
31+
name: "x86_64 Linux [GOAL: install] [bionic] [Using ./ci/ system]"
32+
container:
33+
image: ubuntu:18.04
34+
cpu: 8
35+
memory: 8G
36+
timeout_in: 60m
37+
env:
38+
MAKEJOBS: "-j9"
39+
RUN_CI_ON_HOST: "1"
40+
CCACHE_SIZE: "200M"
41+
CCACHE_DIR: "/tmp/ccache_dir"
42+
ccache_cache:
43+
folder: "/tmp/ccache_dir"
44+
depends_built_cache:
45+
folder: "/tmp/cirrus-ci-build/depends/built"
46+
depends_sdk_cache:
47+
folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
48+
install_script:
49+
- apt-get update
50+
- apt-get -y install git bash ccache
51+
- ccache --max-size=${CCACHE_SIZE}
52+
ci_script:
53+
- ./ci/test_run_all.sh

.travis.yml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,25 @@ stages:
4040
- extended-lint
4141
env:
4242
global:
43-
- MAKEJOBS=-j3
44-
- RUN_UNIT_TESTS=true
45-
- RUN_FUNCTIONAL_TESTS=true
46-
- RUN_FUZZ_TESTS=false
47-
- DOCKER_NAME_TAG=ubuntu:18.04
48-
- BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID
49-
- CCACHE_SIZE=100M
50-
- CCACHE_TEMPDIR=/tmp/.ccache-temp
51-
- CCACHE_COMPRESS=1
52-
- CCACHE_DIR=$HOME/.ccache
53-
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
54-
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
55-
- WINEDEBUG=fixme-all
56-
- DOCKER_PACKAGES="build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache"
43+
- CI_RETRY_EXE="travis_retry"
5744
- 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."
5845
before_install:
59-
- set -o errexit; source .travis/test_03_before_install.sh
46+
- set -o errexit; source ./ci/test/00_setup_env.sh
47+
- set -o errexit; source ./ci/test/03_before_install.sh
6048
install:
61-
- set -o errexit; source .travis/test_04_install.sh
49+
- set -o errexit; source ./ci/test/04_install.sh
6250
before_script:
63-
- set -o errexit; source .travis/test_05_before_script.sh
51+
- set -o errexit; source ./ci/test/05_before_script.sh
6452
script:
6553
- export CONTINUE=1
6654
- if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long
6755
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # Whitelisted repo (90 minutes build time)
68-
- if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
56+
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
6957
- 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
7058
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # Whitelisted repo (90 minutes build time)
71-
- if [ $CONTINUE = "1" ]; then set -o errexit; source .travis/test_06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
59+
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
7260
after_script:
7361
- echo $TRAVIS_COMMIT_RANGE
74-
- echo $TRAVIS_COMMIT_LOG
7562
jobs:
7663
include:
7764

@@ -82,11 +69,11 @@ jobs:
8269
language: python
8370
python: '3.5' # Oldest supported version according to doc/dependencies.md
8471
install:
85-
- set -o errexit; source .travis/lint_04_install.sh
72+
- set -o errexit; source ./ci/lint/04_install.sh
8673
before_script:
87-
- set -o errexit; source .travis/lint_05_before_script.sh
74+
- set -o errexit; source ./ci/lint/05_before_script.sh
8875
script:
89-
- set -o errexit; source .travis/lint_06_script.sh
76+
- set -o errexit; source ./ci/lint/06_script.sh
9077

9178
- stage: extended-lint
9279
name: 'extended lint [runtime >= 60 seconds]'
@@ -95,11 +82,11 @@ jobs:
9582
language: python
9683
python: '3.5'
9784
install:
98-
- set -o errexit; source .travis/extended_lint_04_install.sh
85+
- set -o errexit; source ./ci/extended_lint/04_install.sh
9986
before_script:
100-
- set -o errexit; source .travis/lint_05_before_script.sh
87+
- set -o errexit; source ./ci/lint/05_before_script.sh
10188
script:
102-
- set -o errexit; source .travis/extended_lint_06_script.sh
89+
- set -o errexit; source ./ci/extended_lint/06_script.sh
10390

10491
- stage: test
10592
name: 'ARM [GOAL: install] [no unit or functional tests]'

.travis/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.travis/test_04_install.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

ci/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## ci scripts
2+
3+
This directory contains scripts for each build step in each build stage.
4+
5+
Currently three stages `lint`, `extended_lint` and `test` are defined. Each stage has its own lifecycle, similar to the
6+
[Travis CI lifecycle](https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle). Every script in here is named
7+
and numbered according to which stage and lifecycle step it belongs to.
8+
9+
### Running a stage locally
10+
11+
To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage
12+
requires `docker` to be installed. To install all requirements on Ubuntu, run
13+
14+
```
15+
sudo apt install docker.io ccache bash git
16+
```
17+
18+
To run the test stage,
19+
20+
```
21+
./ci/test_run_all.sh
22+
```
23+
24+
Be aware that the tests will be build and run in-place, so please run at your own risk.
25+
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)