2015-07-05 00:52:36 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2018-03-11 12:15:30 -07:00
|
|
|
source "${CI_DIR}/common/build.sh"
|
2017-04-04 10:15:30 -07:00
|
|
|
source "${CI_DIR}/common/suite.sh"
|
|
|
|
|
2015-07-05 00:52:36 -07:00
|
|
|
# Don't cache pip's log and selfcheck.
|
|
|
|
rm -rf "${HOME}/.cache/pip/log"
|
|
|
|
rm -f "${HOME}/.cache/pip/selfcheck.json"
|
|
|
|
|
2018-03-17 17:04:53 -07:00
|
|
|
echo "before_cache.sh: cache size"
|
|
|
|
du -d 2 "${HOME}/.cache" | sort -n
|
|
|
|
|
2018-05-01 04:02:11 -07:00
|
|
|
echo "before_cache.sh: ccache stats"
|
|
|
|
ccache -s 2>/dev/null || true
|
|
|
|
|
2015-07-05 00:52:36 -07:00
|
|
|
# Update the third-party dependency cache only if the build was successful.
|
2017-04-04 10:15:30 -07:00
|
|
|
if ended_successfully; then
|
2015-09-08 03:48:04 -07:00
|
|
|
rm -rf "${HOME}/.cache/nvim-deps"
|
2016-07-04 17:51:34 -07:00
|
|
|
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
|
2018-03-15 23:29:43 -07:00
|
|
|
|
|
|
|
rm -rf "${HOME}/.cache/nvim-deps-downloads"
|
|
|
|
mv "${DEPS_DOWNLOAD_DIR}" "${HOME}/.cache/nvim-deps-downloads"
|
|
|
|
|
2015-09-08 03:48:04 -07:00
|
|
|
touch "${CACHE_MARKER}"
|
2018-03-11 12:15:30 -07:00
|
|
|
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|