2015-07-05 09:52:36 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-04-04 19:15:30 +02:00
|
|
|
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2018-03-11 20:15:30 +01:00
|
|
|
source "${CI_DIR}/common/build.sh"
|
2017-04-04 19:15:30 +02:00
|
|
|
source "${CI_DIR}/common/suite.sh"
|
|
|
|
|
2018-03-18 01:04:53 +01:00
|
|
|
echo "before_cache.sh: cache size"
|
2019-07-30 23:21:12 +02:00
|
|
|
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
2018-03-18 01:04:53 +01:00
|
|
|
|
2018-05-01 13:02:11 +02:00
|
|
|
echo "before_cache.sh: ccache stats"
|
|
|
|
ccache -s 2>/dev/null || true
|
2019-07-30 23:21:12 +02:00
|
|
|
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
|
|
|
|
find "${HOME}/.ccache" -name stats -delete
|
2018-05-01 13:02:11 +02:00
|
|
|
|
2015-07-05 09:52:36 +02:00
|
|
|
# Update the third-party dependency cache only if the build was successful.
|
2017-04-04 19:15:30 +02:00
|
|
|
if ended_successfully; then
|
2019-07-30 23:21:12 +02:00
|
|
|
# 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}"
|
2018-03-16 07:29:43 +01:00
|
|
|
|
2015-09-08 12:48:04 +02:00
|
|
|
touch "${CACHE_MARKER}"
|
2018-03-11 20:15:30 +01:00
|
|
|
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
|
2015-07-05 09:52:36 +02:00
|
|
|
fi
|