diff --git a/.travis.yml b/.travis.yml index a25b7dad21..7a1a835645 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ matrix: install: "./.travis/linux/deps.sh" script: "./.travis/linux/build.sh" after_success: "./.travis/linux/upload.sh" + cache: ccache - if: branch = master AND type = push os: linux env: NAME="transifex push" @@ -40,11 +41,13 @@ matrix: install: "./.travis/macos/deps.sh" script: "./.travis/macos/build.sh" after_success: "./.travis/macos/upload.sh" + cache: ccache - os: linux env: NAME="linux build (frozen versions of dependencies)" sudo: required dist: trusty services: docker + cache: ccache script: "./.travis/linux-frozen/build.sh" deploy: diff --git a/.travis/linux-frozen/build.sh b/.travis/linux-frozen/build.sh index 873b6fb539..868ca1fb85 100755 --- a/.travis/linux-frozen/build.sh +++ b/.travis/linux-frozen/build.sh @@ -1,4 +1,4 @@ #!/bin/bash -ex - +mkdir "$HOME/.ccache" || true docker pull ubuntu:18.04 -docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:18.04 /bin/bash -ex /citra/.travis/linux-frozen/docker.sh +docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache ubuntu:18.04 /bin/bash -ex /citra/.travis/linux-frozen/docker.sh diff --git a/.travis/linux-frozen/docker.sh b/.travis/linux-frozen/docker.sh index 39c2cd2f41..9314330920 100755 --- a/.travis/linux-frozen/docker.sh +++ b/.travis/linux-frozen/docker.sh @@ -3,7 +3,7 @@ cd /citra apt-get update -apt-get install -y build-essential wget git python-launchpadlib +apt-get install -y build-essential wget git python-launchpadlib ccache # Install specific versions of packages with their dependencies # The apt repositories remove older versions regularly, so we can't use @@ -20,7 +20,7 @@ echo y | sh cmake-3.10.1-Linux-x86_64.sh --prefix=cmake export PATH=/citra/cmake/cmake-3.10.1-Linux-x86_64/bin:$PATH mkdir build && cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} +CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ cmake .. -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} make -j4 ctest -VV -C Release diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh index 6031fb7acd..451d074d21 100755 --- a/.travis/linux/build.sh +++ b/.travis/linux/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -ex - -docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:18.04 /bin/bash -ex /citra/.travis/linux/docker.sh +mkdir "$HOME/.ccache" || true +docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache ubuntu:18.04 /bin/bash -ex /citra/.travis/linux/docker.sh diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh index 626510827e..d7aa414517 100755 --- a/.travis/linux/docker.sh +++ b/.travis/linux/docker.sh @@ -3,7 +3,7 @@ cd /citra apt-get update -apt-get install -y build-essential libsdl2-dev qtbase5-dev libqt5opengl5-dev qttools5-dev qttools5-dev-tools wget git +apt-get install -y build-essential libsdl2-dev qtbase5-dev libqt5opengl5-dev qttools5-dev qttools5-dev-tools wget git ccache # Get a recent version of CMake wget https://cmake.org/files/v3.10/cmake-3.10.1-Linux-x86_64.sh @@ -11,7 +11,7 @@ echo y | sh cmake-3.10.1-Linux-x86_64.sh --prefix=cmake export PATH=/citra/cmake/cmake-3.10.1-Linux-x86_64/bin:$PATH mkdir build && cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} +CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} make -j4 ctest -VV -C Release diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh index d763b20f42..ce6445fab1 100755 --- a/.travis/macos/build.sh +++ b/.travis/macos/build.sh @@ -4,6 +4,7 @@ set -o pipefail export MACOSX_DEPLOYMENT_TARGET=10.12 export Qt5_DIR=$(brew --prefix)/opt/qt5 +export PATH="/usr/local/opt/ccache/libexec:$PATH" mkdir build && cd build cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} diff --git a/.travis/macos/deps.sh b/.travis/macos/deps.sh index 30ec99b620..dbb6b984bd 100755 --- a/.travis/macos/deps.sh +++ b/.travis/macos/deps.sh @@ -1,4 +1,4 @@ #!/bin/sh -ex brew update -brew install qt5 sdl2 dylibbundler p7zip +brew install qt5 sdl2 dylibbundler p7zip ccache