diff options
-rw-r--r-- | .gitlab-ci.yml | 14 | ||||
-rwxr-xr-x | .gitlab/ci.sh | 12 |
2 files changed, 19 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 361be0350d..dd192172ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -587,7 +587,6 @@ validate-x86_64-darwin: IGNORE_PERF_FAILURES: "all" CABAL_CACHE: "cabal-cache-amd64" after_script: - - cp -Rf $HOME/.cabal cabal-cache-amd64 - .gitlab/ci.sh clean # I wish we could just use the nix #! logic, but we can't --run and -i bash @@ -639,6 +638,9 @@ validate-x86_64-darwin: TIME_TEST_DELTA=$(expr $TIME_TEST - $TIME_BUILD) echo "Test took $TIME_TEST_DELTA seconds" + # Important to run this in nix-shell because $HOME is different in there + runInNixShell ".gitlab/ci.sh save-cache" 2>&1 + echo "=== TIMINGS ===" echo "Setup | $TIME_SETUP_DELTA" echo "Configure | $TIME_CONFIGURE_DELTA" @@ -650,10 +652,9 @@ validate-x86_64-darwin: when: always expire_in: 2 week cache: - key: "darwin-x86_64-$GHC_VERSION" + key: "darwin-amd64-$GHC_VERSION" paths: - cabal-cache-amd64 - - cabal-cache-arm64 - toolchain validate-aarch64-darwin: @@ -681,7 +682,6 @@ validate-aarch64-darwin: TEST_ENV: "aarch64-darwin-hadrian" CABAL_CACHE: "cabal-cache-arm64" after_script: - - cp -Rf $HOME/.cabal cabal-cache-arm64 - .gitlab/ci.sh clean # I wish we could just use the nix #! logic, but we can't --run and -i bash @@ -731,6 +731,9 @@ validate-aarch64-darwin: TIME_TEST_DELTA=$(expr $TIME_TEST - $TIME_BUILD) echo "Test took $TIME_TEST_DELTA seconds" + # Important to run this in nix-shell because $HOME is different there + runInNixShell ".gitlab/ci.sh save-cache" 2>&1 + echo "=== TIMINGS ===" echo "Setup | $TIME_SETUP_DELTA" echo "Configure | $TIME_CONFIGURE_DELTA" @@ -742,9 +745,8 @@ validate-aarch64-darwin: when: always expire_in: 2 week cache: - key: "darwin-aarch64-$GHC_VERSION" + key: "darwin-arm64-$GHC_VERSION" paths: - - cabal-cache-amd64 - cabal-cache-arm64 - toolchain 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 |