Browse Source

travis: cache compilers

This currently removes around 25s from compilation time while also being
more resilient to network outages. The drawback is that when changing
the compiler we may need to clean the caches.
master
Lucas De Marchi 9 years ago committed by Andrew Tridgell
parent
commit
b8f7f2306b
  1. 33
      .travis.yml

33
.travis.yml

@ -1,6 +1,10 @@
language: cpp language: cpp
sudo: false sudo: false
cache:
directories:
- $HOME/opt
addons: addons:
apt: apt:
sources: sources:
@ -25,19 +29,30 @@ addons:
branch_pattern: coverity_scan branch_pattern: coverity_scan
before_install: before_install:
- pushd . - pushd $HOME
&& cd ~ - pushd $HOME/opt
&& wget http://firmware.diydrones.com/Tools/PX4-tools/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 # PX4 toolchain
&& tar -xf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 - compiler="gcc-arm-none-eabi-4_9-2015q3"
&& wget http://firmware.diydrones.com/Tools/Travis/NavIO/master.tar.gz - if [ ! -d "$HOME/opt/$compiler" ]; then
&& tar -xf master.tar.gz wget http://firmware.diydrones.com/Tools/PX4-tools/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
&& mkdir -p $HOME/bin && tar -xf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
;
fi
# RPi toolchain
- compiler="tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64"
- if [ ! -d "$HOME/opt/$compiler" ]; then
wget http://firmware.diydrones.com/Tools/Travis/NavIO/master.tar.gz
&& tar -xf master.tar.gz
;
fi
- popd
- mkdir -p $HOME/bin
&& ln -sf /usr/bin/gcc-4.8 $HOME/bin/gcc && ln -sf /usr/bin/gcc-4.8 $HOME/bin/gcc
&& ln -sf /usr/bin/g++-4.8 $HOME/bin/g++ && ln -sf /usr/bin/g++-4.8 $HOME/bin/g++
&& exportline="export PATH=$HOME/bin:$HOME/gcc-arm-none-eabi-4_9-2015q3/bin:$HOME/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH" && exportline="export PATH=$HOME/bin:$HOME/opt/gcc-arm-none-eabi-4_9-2015q3/bin:$HOME/opt/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH"
&& if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi && if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
&& . ~/.profile && . ~/.profile
&& popd - popd
script: script:
- Tools/scripts/build_all_travis.sh - Tools/scripts/build_all_travis.sh

Loading…
Cancel
Save