Skip to content

Commit 49163a4

Browse files
author
Daniel Kroening
authored
Merge pull request #745 from forejtv/feature/travis-ccache
Improve Travis performance
2 parents c16d75b + 279b3ca commit 49163a4

File tree

1 file changed

+48
-17
lines changed

1 file changed

+48
-17
lines changed

.travis.yml

Lines changed: 48 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,39 @@ 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+
allow_failures:
90+
- env: NAME="CPP-LINT"
91+
install:
92+
script: scripts/travis_lint.sh
93+
before_cache:
94+
95+
install:
96+
- COMMAND="make -C src minisat2-download" &&
97+
eval ${PRE_COMMAND} ${COMMAND}
98+
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare\" -j2" &&
99+
eval ${PRE_COMMAND} ${COMMAND}
100+
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
101+
eval ${PRE_COMMAND} ${COMMAND}
102+
- COMMAND="make -C src clean" &&
103+
eval ${PRE_COMMAND} ${COMMAND}
104+
- COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O0 -ggdb3 -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare -DDEBUG\" -j2" &&
105+
eval ${PRE_COMMAND} ${COMMAND}
68106

69107
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} &&
108+
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
75109
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" &&
82110
eval ${PRE_COMMAND} ${COMMAND}
111+
112+
before_cache:
113+
- ccache -s

0 commit comments

Comments
 (0)