2022-08-11 01:27:55 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-12-17 14:07:34 +00:00
|
|
|
set -x
|
2022-08-11 01:27:55 +00:00
|
|
|
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
|
|
|
|
|
2022-12-13 11:10:08 +00:00
|
|
|
# oh no
|
|
|
|
if [ "${TOOL}" = "hls" ] ; then
|
|
|
|
ghcup -v --url-source=file:$METADATA_FILE install ghc --set 9.2.4
|
|
|
|
fi
|
|
|
|
|
2022-09-15 14:25:22 +00:00
|
|
|
ghcup -v --url-source=file:$METADATA_FILE install $TOOL --set $VERSION
|
2022-08-11 01:27:55 +00:00
|
|
|
|
2023-02-11 04:43:22 +00:00
|
|
|
mkdir -p /tmp/install-bindist-ci
|
2022-12-14 14:37:23 +00:00
|
|
|
cd /tmp/install-bindist-ci
|
|
|
|
|
2022-10-10 04:56:43 +00:00
|
|
|
cat <<EOF > main.hs
|
|
|
|
{- cabal:
|
|
|
|
build-depends: base
|
|
|
|
-}
|
|
|
|
|
|
|
|
main = print $ 1 + 1
|
|
|
|
EOF
|
|
|
|
|
2022-09-15 14:25:22 +00:00
|
|
|
case $TOOL in
|
|
|
|
hls)
|
|
|
|
haskell-language-server-wrapper --version
|
2022-10-10 04:56:43 +00:00
|
|
|
haskell-language-server-wrapper typecheck main.hs
|
2022-09-15 14:25:22 +00:00
|
|
|
;;
|
|
|
|
ghc)
|
|
|
|
ghc --version
|
2022-10-10 04:56:43 +00:00
|
|
|
ghc --info
|
|
|
|
ghc -prof main.hs
|
|
|
|
[[ $(./main +RTS -s) -eq 2 ]]
|
|
|
|
;;
|
|
|
|
cabal)
|
|
|
|
cabal --version
|
|
|
|
cabal update
|
|
|
|
[[ $(cabal --verbose=0 run --enable-profiling ./main.hs -- +RTS -s) -eq 2 ]]
|
2022-09-15 14:25:22 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
$TOOL --version
|
|
|
|
;;
|
|
|
|
esac
|