From 5d0545b1989faa307216c71b834d12dde6a0c38c Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Mon, 16 Feb 2015 03:29:40 +0000 Subject: [PATCH] Test more GHC versions in travis --- .travis.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/.travis.yml b/.travis.yml index 27d2c1b..a058c93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,74 @@ +# Largely copied from https://github.com/ekmett/lens + language: haskell branches: except: - gh-pages + +env: + - GHCVER=7.4.2 + - GHCVER=7.6.3 + - GHCVER=7.8.4 + - GHCVER=7.10.1 + - GHCVER=head + +matrix: + allow_failures: + - env: GHCVER=head + +before_install: + # If $GHCVER is the one travis has, don't bother reinstalling it. + # We can also have faster builds by installing some libraries with + # `apt`. If it isn't, install the GHC we want from hvr's PPA along + # with cabal-1.18. + - | + if [ $GHCVER = `ghc --numeric-version` ]; then + # Try installing some of the build-deps with apt-get for speed. + travis/cabal-apt-install --enable-tests $MODE + export CABAL=cabal + else + # Install the GHC we want from hvr's PPA + travis_retry sudo add-apt-repository -y ppa:hvr/ghc + travis_retry sudo apt-get update + travis_retry sudo apt-get install cabal-install-1.18 ghc-$GHCVER happy + export CABAL=cabal-1.18 + export PATH=/opt/ghc/$GHCVER/bin:$PATH + fi + # Uncomment whenever hackage is down. + # - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && $CABAL update + - $CABAL update + + # Update happy when building with GHC head + - | + if [ $GHCVER = "head" ] || [ $GHCVER = "7.8.3" ]; then + $CABAL install happy alex + export PATH=$HOME/.cabal/bin:$PATH + fi + +install: + - $CABAL install --dependencies-only --enable-tests + - $CABAL configure -flib-Werror --enable-tests $MODE + +script: + - $CABAL configure --enable-tests + - $CABAL build + +# Run tests + - $CABAL test + +# Check package for common errors +# (enable after stable release) +# - $CABAL check + +# Test that a source distribution can be built and installed +# (enable after stable release) +# - $CABAL sdist +# - export SRC_TGZ=$($CABAL info . | awk '{print $2 ".tar.gz";exit}') ; +# cd dist/; +# if [ -f "$SRC_TGZ" ]; then +# $CABAL install --force-reinstalls "$SRC_TGZ"; +# else +# echo "expected '$SRC_TGZ' not found"; +# exit 1; +# fi