Skip to content

Commit fa6cbdc

Browse files
author
MarcoFalke
committed
ci: Use ./ci/ on non-travis host
1 parent fa31bc3 commit fa6cbdc

File tree

3 files changed

+42
-10
lines changed

3 files changed

+42
-10
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

ci/test/03_before_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
export LC_ALL=C.UTF-8
88

9-
PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
109
# Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers.
1110
PATH=$PATH:/usr/lib/llvm-6.0/bin/
1211
export PATH

ci/test/04_install.sh

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66

77
export LC_ALL=C.UTF-8
88

9-
free -m -h
10-
echo "Number of CPUs (nproc): $(nproc)"
11-
129
ccache echo "Creating ccache dir if it didn't already exist"
1310

14-
${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG"
15-
1611
if [ ! -d ${DIR_QA_ASSETS} ]; then
1712
git clone https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS}
1813
fi
@@ -29,11 +24,25 @@ if [[ $HOST = *-mingw32 ]]; then
2924
elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
3025
DOCKER_ADMIN="--cap-add SYS_PTRACE"
3126
fi
32-
DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$BASE_BUILD_DIR,dst=$BASE_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $BASE_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG)
3327

34-
DOCKER_EXEC () {
35-
docker exec $DOCKER_ID bash -c "cd $PWD && $*"
36-
}
28+
if [ -z "$RUN_CI_ON_HOST" ]; then
29+
echo "Creating $DOCKER_NAME_TAG container to run in"
30+
${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG"
31+
32+
DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$BASE_BUILD_DIR,dst=$BASE_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $BASE_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG)
33+
34+
DOCKER_EXEC () {
35+
docker exec $DOCKER_ID bash -c "cd $PWD && $*"
36+
}
37+
else
38+
echo "Running on host system without docker wrapper"
39+
DOCKER_EXEC () {
40+
bash -c "cd $PWD && $*"
41+
}
42+
fi
43+
44+
DOCKER_EXEC free -m -h
45+
DOCKER_EXEC echo "Number of CPUs \(nproc\): $(nproc)"
3746

3847
${CI_RETRY_EXE} DOCKER_EXEC apt-get update
3948
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES $DOCKER_PACKAGES

0 commit comments

Comments
 (0)