Consolidate and isolate bindist installation

In particular, this now ensure that we actually use the ghcup version we
installed as well as a separate installation directory, instead of any
potentially previously installed versions/files.
This commit is contained in:
amesgen
2022-08-11 03:27:55 +02:00
parent 0c0736526a
commit 0bdb62c58e
2 changed files with 30 additions and 40 deletions

18
.github/workflows/install-bindist.sh vendored Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail
export GHCUP_INSTALL_BASE_PREFIX=$RUNNER_TEMP/foobarbaz
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env || source ~/.bashrc
ghcup --version
which ghcup | grep foobarbaz
ghcup -v --url-source=file:$METADATA_FILE install ghc --set $GHC_VERSION
ghc --version
echo 'main = print $ 1 + 1' > main.hs
ghc main.hs
[[ $(./main) -eq 2 ]]