diff options
| author | Daniel Hahler <git@thequod.de> | 2019-07-30 23:21:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-30 23:21:12 +0200 |
| commit | 208f56d3b928c473122ce47c8c7a17e0729a26ea (patch) | |
| tree | dbcd6b5b0e0c6180744b3c70b1132e0da7969e65 /ci | |
| parent | 6e01ed6a4c859ff915b42422622f1ba3cc80efd5 (diff) | |
| download | rneovim-208f56d3b928c473122ce47c8c7a17e0729a26ea.tar.gz rneovim-208f56d3b928c473122ce47c8c7a17e0729a26ea.tar.bz2 rneovim-208f56d3b928c473122ce47c8c7a17e0729a26ea.zip | |
ci: Travis: improve/revisit caching (#10358)
- use CACHE_NVIM_DEPS_DIR
- do not cache pip
This is handled through http caches in general/better, and it is not
used much anyway.
- do not cache DEPS_DOWNLOAD_DIR
Built deps are cached, downloads are not needed then.
- display ccache stats before clearing
- do not cache ccache stats
- improve output of `du` (do not list pages of output for "/home/travis/.cache/go-build")
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci/before_cache.sh | 17 | ||||
| -rwxr-xr-x | ci/before_script.sh | 2 | ||||
| -rw-r--r-- | ci/common/build.sh | 4 |
3 files changed, 10 insertions, 13 deletions
diff --git a/ci/before_cache.sh b/ci/before_cache.sh index c8a1fd5b71..c86109168e 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -7,23 +7,20 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/suite.sh" -# Don't cache pip's log and selfcheck. -rm -rf "${HOME}/.cache/pip/log" -rm -f "${HOME}/.cache/pip/selfcheck.json" - echo "before_cache.sh: cache size" -du -d 2 "${HOME}/.cache" | sort -n +du -chd 1 "${HOME}/.cache" | sort -rh | head -20 echo "before_cache.sh: ccache stats" ccache -s 2>/dev/null || true +# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway). +find "${HOME}/.ccache" -name stats -delete # Update the third-party dependency cache only if the build was successful. if ended_successfully; then - rm -rf "${HOME}/.cache/nvim-deps" - mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps" - - rm -rf "${HOME}/.cache/nvim-deps-downloads" - mv "${DEPS_DOWNLOAD_DIR}" "${HOME}/.cache/nvim-deps-downloads" + # Do not cache downloads. They should not be needed with up-to-date deps. + rm -rf "${DEPS_BUILD_DIR}/build/downloads" + rm -rf "${CACHE_NVIM_DEPS_DIR}" + mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}" touch "${CACHE_MARKER}" echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))." diff --git a/ci/before_script.sh b/ci/before_script.sh index ae20eef1fc..605ecdbf66 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -20,6 +20,8 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the exit 1 fi +echo "before_script.sh: ccache stats (will be cleared)" +ccache -s # Reset ccache stats for real results in before_cache. ccache --zero-stats diff --git a/ci/common/build.sh b/ci/common/build.sh index 85b141de86..bdbe012ca6 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -27,15 +27,13 @@ build_deps() { fi mkdir -p "${DEPS_BUILD_DIR}" - mkdir -p "${DEPS_DOWNLOAD_DIR}" # Use cached dependencies if $CACHE_MARKER exists. 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 -a "${HOME}/.cache/nvim-deps"/. "${DEPS_BUILD_DIR}" - cp -a "${HOME}/.cache/nvim-deps-downloads"/. "${DEPS_DOWNLOAD_DIR}" + cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}" fi # Even if we're using cached dependencies, run CMake and make to |