summaryrefslogtreecommitdiff
path: root/.gitlab
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-07-06 14:31:21 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-10 19:59:34 -0400
commitc38bce737f532cec1d863d3e15bed4a8addbffd1 (patch)
tree2d2593d42a859a712b0532e3e72545b1fc3c3fd4 /.gitlab
parent901f0e1b38730401a3e74d25a0b041ce551797c9 (diff)
downloadhaskell-c38bce737f532cec1d863d3e15bed4a8addbffd1.tar.gz
ci: Copy the cache from inside the nix-shell where $HOME is different on darwin
Hopefully fixes the flaky CI failures we have seen recently. Co-authored-by: Moritz Angerman <moritz.angermann@gmail.com>
Diffstat (limited to '.gitlab')
-rwxr-xr-x.gitlab/ci.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 5d898f31da..6a8ac0f602 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -199,7 +199,7 @@ function set_toolchain_paths() {
# Extract GHC toolchain
function setup() {
if [ -d "${CABAL_CACHE}" ]; then
- info "Extracting cabal cache..."
+ info "Extracting cabal cache from ${CABAL_CACHE} to $cabal_dir..."
mkdir -p "$cabal_dir"
cp -Rf "${CABAL_CACHE}"/* "$cabal_dir"
fi
@@ -483,6 +483,11 @@ function run_perf_test() {
OUT=out/Cabal-O2 cabal_test -O2
}
+function save_cache () {
+ info "Storing cabal cache from $cabal_dir to ${CABAL_CACHE}..."
+ cp -Rf "$cabal_dir" "${CABAL_CACHE}"
+}
+
function clean() {
rm -R tmp
run "$MAKE" --quiet clean || true
@@ -522,6 +527,10 @@ case "$(uname)" in
*) cabal_dir="$HOME/.cabal"; exe="" ;;
esac
+echo "Cabal_dir is $cabal_dir"
+echo "$(uname -m)"
+echo "${CABAL_CACHE}"
+
# Platform-specific environment initialization
MAKE="make"
TAR="tar"
@@ -590,6 +599,7 @@ case $1 in
perf_test) run_perf_test ;;
cabal_test) cabal_test ;;
clean) clean ;;
+ save-cache) save_cache ;;
shell) shell "$@" ;;
*) fail "unknown mode $1" ;;
esac