Fix travis finally

This commit is contained in:
Julian Ospald 2018-10-03 12:10:11 +08:00
parent 35b40e2fc4
commit 644a2829e4
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -1,46 +1,51 @@
#!/bin/sh
set -e
edo()
{
printf "\\033[0;34m%s\\033[0m\\n" "$*" 1>&2
"$@" || exit 2
}
# install GHCs
./ghcup -v install 8.2.2
./ghcup -v install 8.4.3
./ghcup -v install 8.6.1
edo ./ghcup -v install 8.2.2
edo ./ghcup -v install 8.4.3
edo ./ghcup -v install 8.6.1
# set GHC
./ghcup -v set 8.6.1
./ghcup -v set 8.4.3
edo ./ghcup -v set 8.6.1
edo ./ghcup -v set 8.4.3
# rm GHC
./ghcup -v rm 8.6.1
./ghcup -v rm 8.4.3
# rm G HC
edo ./ghcup -v rm 8.6.1
edo ./ghcup -v rm 8.4.3
# set GHC
./ghcup -v set 8.2.2
edo ./ghcup -v set 8.2.2
export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"
export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$PATH"
# TODO: exceeds maximum time limit of travis
# compile GHC from source
#./ghcup -v compile 8.4.3 ghc-8.2.2
# install cabal-install
./ghcup -v install-cabal
edo ./ghcup -v install-cabal
edo cabal update
edo cabal install cabal-install
# https://github.com/haskell/cabal/issues/5516
mkdir -p ~/.cabal/store/ghc-8.2.2/package.db
cabal new-update
# this shouldn't be necessary, file bug upstream
cabal new-install --symlink-bindir="$HOME"/.ghcup/bin cabal-install
mv -f "$HOME"/.ghcup/bin/cabal "$HOME"/.cabal/bin/cabal
edo mkdir -p ~/.cabal/store/ghc-8.2.2/package.db
edo cabal new-update
# install shellcheck
cabal new-install ShellCheck
edo cabal new-install ShellCheck
# check our script for errors
shellcheck ghcup
edo shellcheck ghcup
# self update
ghcup self-update
edo mkdir -p "$HOME"/.local/bin
edo ./ghcup self-update
edo ghcup show