From b65b9dc5e1b7600a3fa89ed3bec3c043e7e54c6c Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 16 Apr 2020 08:24:21 +0200 Subject: [PATCH] Test that setting ghc versions isn't broken Wrt #7 --- .gitlab/script/ghcup_version.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab/script/ghcup_version.sh b/.gitlab/script/ghcup_version.sh index 6c67d45..f302e9f 100755 --- a/.gitlab/script/ghcup_version.sh +++ b/.gitlab/script/ghcup_version.sh @@ -49,11 +49,25 @@ eghcup list eghcup list -t ghc eghcup list -t cabal +ghc_ver=$(ghc --numeric-version) ghc --version ghci --version ghc-$(ghc --numeric-version) --version ghci-$(ghc --numeric-version) --version + +# test installing new ghc doesn't mess with currently set GHC +# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7 +eghcup install 8.4.4 +[ "$(ghc --numeric-version)" = "${ghc_ver}" ] +eghcup set 8.4.4 +eghcup set 8.4.4 +[ "$(ghc --numeric-version)" = "8.4.4" ] +eghcup set ${GHC_VERSION} +[ "$(ghc --numeric-version)" = "${ghc_ver}" ] +eghcup rm 8.4.4 +[ "$(ghc --numeric-version)" = "${ghc_ver}" ] + eghcup rm $(ghc --numeric-version) eghcup upgrade