Skip to content

Commit

Permalink
Enable ccache for faster builds (#3660)
Browse files Browse the repository at this point in the history
* Enable ccache for faster builds.

* Print cache statistics and install with 2 jobs

* Enable bundler cache as well.

* Install ccache on OSX as well.

* Export CC and CXX manually in order to use ccache.

* Cache bundler manually since in C++ environments travis doesn't recognise the bundler directive.

* Workaround ccache bug with clang

See http://petereisentraut.blogspot.co.il/2011/05/ccache-and-clang.html

* export different ccache path for OSX.

* Fix syntax error.

* Use ruby 2.2.0.

* Another fix for ccache with clang and install ruby 2.2.0 from rvm.

* Print cache statistics for debugging.
  • Loading branch information
thedrow authored and brixen committed Jun 5, 2016
1 parent f23df63 commit 06a4629
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
language: cpp
cache:
ccache: true
directories:
- $HOME/vendor/bundle
- $HOME/.rvm/archives/
sudo: required
dist: trusty
compiler:
- clang
os:
- linux
- osx
ruby: 2.2.0
before_install:
- rvm install 2.2.0 && rvm use 2.2.0
- echo $LANG
- echo $LC_ALL
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/llvm.sh; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm; fi
- if [ $TRAVIS_OS_NAME == linux ]; then ccache -s; export CC="ccache clang -Qunused-arguments -fcolor-diagnostics"; export CXX="ccache clang++ -Qunused-arguments -fcolor-diagnostics"; ./scripts/llvm.sh; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm ccache; ccache -s; export CC="ccache clang -Qunused-arguments -fcolor-diagnostics"; export CXX="ccache clang++ -Qunused-arguments -fcolor-diagnostics"; export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
- gem update --system
- gem --version
before_script:
- travis_retry bundle
- travis_retry bundle -j 2
- if [ $TRAVIS_OS_NAME == linux ]; then travis_retry ./configure --llvm-config=llvm-config-3.6; fi
- if [ $TRAVIS_OS_NAME == osx ]; then travis_retry ./configure; fi
script: rake ci
after_success:
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/build_support.sh archive_core; fi
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi
- ccache -s
branches:
only:
- master
Expand All @@ -41,6 +47,7 @@ notifications:
on_start: always
env:
global:
- CCACHE_CPP2=yes
- LANG="en_US.UTF-8"
- secure: olbok/GN6rOYvPnHBYWGz7giCoCdLFpT/7WSBHukYO3E0uNeqAUOOgW2BFOwCVWdSEJ/iTvJXZQ4qVZHX+6jRfvILZeGv+D2P93VdD8UFQRoTOfFC7esAo525s9fuKm9ehUGWZxlzGOBHHckky1jn6pEf8mlXAVM5e76dlH0fck=
- secure: aqG9eB/PrzQ7XJQN6YX/00sNVvwSB77saxXQzguL2WFjAXB74h6168Hzq+awHtNX/vfOb6ta7fpWLHrA0D+gmZnvTR29VlP6nd0vs1tkdX1/jWbiBHjamRffp+NWVdKbJKYn5iLOGXcuUMOzY/opLKOdvxKZfkxGMxR2tTNLZUE=
Expand Down

0 comments on commit 06a4629

Please sign in to comment.