diff options
author | James McCoy <jamessan@jamessan.com> | 2018-05-04 19:43:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 19:43:43 -0400 |
commit | bcc9a74e480c91fbfa99caf04b1bc9d92c5651b0 (patch) | |
tree | 61df59cb1b9cebf5fa295a64e69e70bf6e66b420 | |
parent | 500931752565e0b535f4ce6013729df3febf1a56 (diff) | |
parent | d5da357925dffb84c9c6c49fd6c1fbdf6508cb7f (diff) | |
download | rneovim-bcc9a74e480c91fbfa99caf04b1bc9d92c5651b0.tar.gz rneovim-bcc9a74e480c91fbfa99caf04b1bc9d92c5651b0.tar.bz2 rneovim-bcc9a74e480c91fbfa99caf04b1bc9d92c5651b0.zip |
Merge pull request #8333 from jamessan/ccache
travis: Enable ccache
-rw-r--r-- | .travis.yml | 5 | ||||
-rwxr-xr-x | ci/before_cache.sh | 3 | ||||
-rwxr-xr-x | ci/before_script.sh | 3 | ||||
-rw-r--r-- | ci/common/build.sh | 4 | ||||
-rwxr-xr-x | ci/install.sh | 2 |
5 files changed, 16 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml index 3cd21170b7..ab32b38f3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,10 @@ env: # default target name for functional tests - FUNCTIONALTEST=functionaltest - CI_TARGET=tests + # Environment variables for ccache + - CCACHE_COMPRESS=1 + - CCACHE_SLOPPINESS=time_macros,file_macro + - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR" jobs: include: @@ -118,6 +122,7 @@ branches: cache: apt: true + ccache: true directories: - "$HOME/.cache/pip" - "$HOME/.cache/nvim-deps" diff --git a/ci/before_cache.sh b/ci/before_cache.sh index d99b8e68c6..c8a1fd5b71 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -14,6 +14,9 @@ rm -f "${HOME}/.cache/pip/selfcheck.json" echo "before_cache.sh: cache size" du -d 2 "${HOME}/.cache" | sort -n +echo "before_cache.sh: ccache stats" +ccache -s 2>/dev/null || true + # Update the third-party dependency cache only if the build was successful. if ended_successfully; then rm -rf "${HOME}/.cache/nvim-deps" diff --git a/ci/before_script.sh b/ci/before_script.sh index 445996a8df..49b4e068b5 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -20,6 +20,9 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the exit 1 fi +# Show ccache stats so we can compare in before_cache +ccache -s 2>/dev/null || true + if [[ "${TRAVIS_OS_NAME}" == osx ]]; then # Adds user to a dummy group. # That allows to test changing the group of the file by `os_fchown`. diff --git a/ci/common/build.sh b/ci/common/build.sh index 53d20ebf9b..a3cf64d47a 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -30,7 +30,9 @@ build_deps() { mkdir -p "${DEPS_DOWNLOAD_DIR}" # Use cached dependencies if $CACHE_MARKER exists. - if test -f "${CACHE_MARKER}" && ! test "${CACHE_ENABLE}" = "false" ; then + if test "${CACHE_ENABLE}" = "false" ; then + export CCACHE_RECACHE=1 + elif test -f "${CACHE_MARKER}" ; then echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))." cp -r "${HOME}/.cache/nvim-deps"/. "${DEPS_BUILD_DIR}" cp -r "${HOME}/.cache/nvim-deps-downloads" "${DEPS_DOWNLOAD_DIR}" diff --git a/ci/install.sh b/ci/install.sh index 053549d6db..50f3490b63 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -11,6 +11,8 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew install ninja brew install gettext brew reinstall -s libtool + brew install ccache + export PATH="/usr/local/opt/ccache/libexec:$PATH" fi echo "Install neovim module for Python 3." |