summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-03-09 11:02:47 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-03-09 11:07:23 +0000
commit18b9ba5602121c75f184f29e5b3e70bd7d4779c4 (patch)
treeec495791f94273c82d53ab1d161c0ff6e9cda411
parent3cf75ede057148cc8e38692ff32013f7d3e4078f (diff)
downloadhaskell-wip/linters-stage1.tar.gz
ci: Fix save_cache functionwip/linters-stage1
Each interation of saving the cache would copy the whole `cabal` store into a subfolder in the CACHE_DIR rather than copying the contents of the cabal store into the cache dir. This resulted in a cache which looked like: ``` /builds/ghc/ghc/cabal-cache/cabal/cabal/cabal/cabal/cabal/cabal/cabal/cabal/cabal/cabal/ ``` So it would get one layer deeper every CI run and take longer and longer to compress.
-rw-r--r--.gitlab-ci.yml2
-rwxr-xr-x.gitlab/ci.sh1
2 files changed, 2 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 11d336ed91..b9b4f1f44e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,7 +6,7 @@ variables:
# Sequential version number of all cached things.
# Bump to invalidate GitLab CI cache.
- CACHE_REV: 4
+ CACHE_REV: 5
# Disable shallow clones; they break our linting rules
GIT_DEPTH: 0
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 7cd667fe0d..2ba27cba8d 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -608,6 +608,7 @@ function run_perf_test() {
function save_cache () {
info "Storing cabal cache from $CABAL_DIR to $CABAL_CACHE..."
+ rm -Rf "$CABAL_CACHE"
cp -Rf "$CABAL_DIR" "$CABAL_CACHE"
}