Skip to content
Snippets Groups Projects

Draft: Remove files after test finishes

Open Bryan R requested to merge wip/disk-cleanup into master
1 file
+ 11
6
Compare changes
  • Side-by-side
  • Inline
+ 14
6
@@ -2,7 +2,15 @@
set -x
set -eo pipefail
runner_temp=$(mktemp -d)
runner_temp=$(mktemp -d ghcup-ci.XXXXXXXX)
# shellcheck disable=SC2064
trap "rm -r '$runner_temp'" EXIT
# Keep all other temp directories relative to the toplevel temp directory.
nestedtemp () {
mktemp -p "$runner_temp" "$@"
}
if [ -z "$BINDIST_URL" ]; then
cat build.env
@@ -10,7 +18,7 @@ if [ -z "$BINDIST_URL" ]; then
fi
# See GHC #24951 for a user with a misconfigured CDPATH variable
cdpath_temp=$(mktemp -d)
cdpath_temp=$(nestedtemp -d cdpath.XXXX)
mkdir -p $cdpath_temp/lib
mkdir -p $cdpath_temp/wrappers
mkdir -p $cdpath_temp/doc
@@ -33,8 +41,8 @@ which ghcup | grep foobarbaz
# Testing a manual installation
if [ -n "$BINDIST_ONLY" ]; then
install_dir="$runner_temp/ghc"
install_temp=$(mktemp -d)
download_temp=$(mktemp -d)
install_temp=$(nestedtemp -d)
download_temp=$(nestedtemp -d)
pushd $download_temp
if [ -n "$BINDIST_URL" ]; then
wget "$BINDIST_URL"
@@ -103,8 +111,8 @@ fi
[[ $(./main +RTS -s) -eq 2 ]]
cabal install --lib --package-env=$(mktemp) clock
cabal install --lib --package-env=$(mktemp) hashable
cabal install --lib --package-env=$(nestedtemp clock.XXXX) clock
cabal install --lib --package-env=$(nestedtemp hashable.XXXX) hashable
case "$(uname)" in
Loading