From 16981d6be45a67a72b2a2ba631e45d68084d6913 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Tue, 10 Apr 2018 21:09:35 -0600 Subject: [PATCH] travis: use cache --- .travis.yml | 3 +++ .travis/linux-frozen/build.sh | 4 ++-- .travis/linux-frozen/docker.sh | 4 ++-- .travis/linux/build.sh | 4 ++-- .travis/linux/docker.sh | 4 ++-- .travis/macos/build.sh | 1 + .travis/macos/deps.sh | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index a25b7dad2..7a1a83564 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 873b6fb53..868ca1fb8 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 39c2cd2f4..931433092 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 6031fb7ac..451d074d2 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 626510827..d7aa41451 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 d763b20f4..ce6445fab 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 30ec99b62..dbb6b984b 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