Skip to content

Commit 5d1f301

Browse files
committed
Enable ccache on Travis, plus travis.yml restructuring
All jobs now have ccache enabled, which means that subsequent compilation should be able to reuse the compiled files, and thus the job running time should be faster. As part of the above, travis.yml needed to be restructured, in particular: * instead of running the compilation and tests as one command, they are split * cegis etc. compilation takes place before the tests are run.
1 parent 11773eb commit 5d1f301

File tree

1 file changed

+42
-17
lines changed

1 file changed

+42
-17
lines changed

.travis.yml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,44 @@ matrix:
77
- os: linux
88
sudo: required
99
compiler: gcc
10+
cache: ccache
1011
services:
1112
- docker
1213
before_install:
1314
- docker pull diffblue/cbmc-builder:alpine
1415
env:
15-
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc diffblue/cbmc-builder:alpine"
16-
- COMPILER=g++
16+
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc -v ${HOME}/.ccache:/root/.ccache diffblue/cbmc-builder:alpine"
17+
- COMPILER="ccache g++"
1718

1819
# OS X using g++
1920
- os: osx
2021
sudo: false
2122
compiler: gcc
23+
cache: ccache
24+
before_install:
25+
#we create symlink to non-ccache gcc, to be used in tests
26+
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
27+
- brew install ccache
28+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
2229
env: COMPILER=g++
2330

2431
# OS X using clang++
2532
- os: osx
2633
sudo: false
2734
compiler: clang
28-
env: COMPILER=clang++
35+
cache: ccache
36+
before_install:
37+
- brew install ccache
38+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
39+
env:
40+
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
41+
- CCACHE_CPP2=yes
2942

3043
# Ubuntu Linux with glibc using g++-5
3144
- os: linux
3245
sudo: false
3346
compiler: gcc
47+
cache: ccache
3448
addons:
3549
apt:
3650
sources:
@@ -42,12 +56,13 @@ matrix:
4256
before_install:
4357
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
4458
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
45-
env: COMPILER=g++-5
59+
env: COMPILER="g++-5"
4660

4761
# Ubuntu Linux with glibc using clang++-3.7
4862
- os: linux
4963
sudo: false
5064
compiler: clang
65+
cache: ccache
5166
addons:
5267
apt:
5368
sources:
@@ -60,23 +75,33 @@ matrix:
6075
- libubsan0
6176
before_install:
6277
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
78+
- export CCACHE_CPP2=yes
6379
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
64-
env: COMPILER=clang++-3.7
80+
env:
81+
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
82+
- CCACHE_CPP2=yes
6583

6684
- env: NAME="CPP-LINT"
67-
script: scripts/travis_lint.sh || true
85+
install:
86+
script: scripts/travis_lint.sh
87+
before_cache:
88+
89+
install:
90+
- COMMAND="make -C src minisat2-download" &&
91+
eval ${PRE_COMMAND} ${COMMAND}
92+
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare\" -j2" &&
93+
eval ${PRE_COMMAND} ${COMMAND}
94+
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
95+
eval ${PRE_COMMAND} ${COMMAND}
96+
- COMMAND="make -C src clean" &&
97+
eval ${PRE_COMMAND} ${COMMAND}
98+
- COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O0 -ggdb3 -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare -DDEBUG\" -j2" &&
99+
eval ${PRE_COMMAND} ${COMMAND}
68100

69101
script:
70-
- if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
71-
COMMAND="make -C src minisat2-download" &&
72-
eval ${PRE_COMMAND} ${COMMAND} &&
73-
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare\" -j2" &&
74-
eval ${PRE_COMMAND} ${COMMAND} &&
102+
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
75103
COMMAND="env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test" &&
76-
eval ${PRE_COMMAND} ${COMMAND} &&
77-
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
78-
eval ${PRE_COMMAND} ${COMMAND} &&
79-
COMMAND="make -C src clean" &&
80-
eval ${PRE_COMMAND} ${COMMAND} &&
81-
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O0 -ggdb3 -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare -DDEBUG\" -j2" &&
82104
eval ${PRE_COMMAND} ${COMMAND}
105+
106+
before_cache:
107+
- ccache -s

0 commit comments

Comments
 (0)