Skip to content

Commit

Permalink
Make .travis.yml script more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Oct 13, 2016
1 parent cddbd7b commit 0d50428
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ matrix:
install: true
script:
- |
add_path() { eval "test -n \"\$$1\"" && eval "PATH=/opt/$2/\"\$$1\"/bin:$PATH"; true; }
cabal_env() { if test "$BUILD" = cabal; then echo $1; fi; }
pkg_test() { echo https://raw.githubusercontent.com/harendra-kumar/package-test/$1/package-test.sh; }
set_tool_path() { eval "test -n \"\$$1\"" && eval "PATH=/opt/$2/\"\$$1\"/bin:$PATH"; true; }
when_cabal() { if test "$BUILD" = cabal; then echo $1; fi; }
script_url() { echo https://raw.githubusercontent.com/harendra-kumar/package-test/$1/package-test.sh; }
CURL=$(which curl)
PATH=/bin:/usr/bin
add_path GHCVER ghc
add_path CABALVER cabal
# Add appropriate ghc and cabal versions from /opt to PATH
set_tool_path GHCVER ghc
set_tool_path CABALVER cabal
- env -i
PATH=$PATH
Expand All @@ -62,7 +63,7 @@ script:
GHCVER=$GHCVER
CABALVER=$CABALVER
GHC_OPTIONS="-O0 -Werror"
$(cabal_env CABAL_TEST_INSTALL=y)
$(cabal_env CABAL_NO_SANDBOX=y)
$(cabal_env CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com)
/bin/bash <($CURL -sL $(pkg_test 23c3e50a8d55804d60435c946192990ffb856336))
$(when_cabal CABAL_TEST_INSTALL=y)
$(when_cabal CABAL_NO_SANDBOX=y)
$(when_cabal CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com)
/bin/bash <($CURL -sL $(script_url 23c3e50a8d55804d60435c946192990ffb856336))

0 comments on commit 0d50428

Please sign in to comment.