Skip to content

Commit facaae4

Browse files
author
MarcoFalke
committed
travis: Save cache when compilation took very long
1 parent faee6c9 commit facaae4

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ install:
3232
before_script:
3333
- set -o errexit; source .travis/test_05_before_script.sh
3434
script:
35-
- 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
35+
- 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_a.sh; fi
36+
- if [ $SECONDS -gt 1500 ]; then set +o errexit; echo "Travis early exit to cache current state"; false; else set -o errexit; source .travis/test_06_script_b.sh; fi
3637
after_script:
3738
- echo $TRAVIS_COMMIT_RANGE
3839
- echo $TRAVIS_COMMIT_LOG

.travis/test_06_script.sh renamed to .travis/test_06_script_a.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,4 @@ BEGIN_FOLD build
4747
DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false )
4848
END_FOLD
4949

50-
if [ "$RUN_UNIT_TESTS" = "true" ]; then
51-
BEGIN_FOLD unit-tests
52-
DOCKER_EXEC LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib make $MAKEJOBS check VERBOSE=1
53-
END_FOLD
54-
fi
55-
56-
if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then
57-
extended="--extended --exclude feature_pruning"
58-
fi
59-
60-
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
61-
BEGIN_FOLD functional-tests
62-
DOCKER_EXEC test/functional/test_runner.py --ci --combinedlogslen=4000 --coverage --quiet --failfast ${extended}
63-
END_FOLD
64-
fi
50+
cd ${TRAVIS_BUILD_DIR} || (echo "could not enter travis build dir $TRAVIS_BUILD_DIR"; exit 1)

.travis/test_06_script_b.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2018 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
cd "build/bitcoin-$HOST" || (echo "could not enter distdir build/bitcoin-$HOST"; exit 1)
10+
11+
if [ "$RUN_UNIT_TESTS" = "true" ]; then
12+
BEGIN_FOLD unit-tests
13+
DOCKER_EXEC LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib make $MAKEJOBS check VERBOSE=1
14+
END_FOLD
15+
fi
16+
17+
if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then
18+
extended="--extended --exclude feature_pruning"
19+
fi
20+
21+
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
22+
BEGIN_FOLD functional-tests
23+
DOCKER_EXEC test/functional/test_runner.py --ci --combinedlogslen=4000 --coverage --quiet --failfast ${extended}
24+
END_FOLD
25+
fi

0 commit comments

Comments
 (0)