ghcup-metadata/.github/workflows/install-bindist.sh
amesgen 0bdb62c58e
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.
2022-08-11 03:29:47 +02:00

19 lines
440 B
Bash
Executable File

#!/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 ]]