language: haskell
ghc:
  - 7.6

# Based on https://github.com/hvr/multi-ghc-travis and https://github.com/ekmett/lens/blob/master/.travis.yml

# NB: don't set `language: haskell` here

# The following enables several GHC versions to be tested; often it's enough to test only against the last release in a major GHC version. Feel free to omit lines listings versions you don't need/want testing for.
env:
 - GHCVER=7.6.3
 - GHCVER=7.8.2

# Note: the distinction between `before_install` and `install` is not important.
before_install:
 - 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 alex # see note about happy/alex
 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.18/bin:$PATH
 - cabal update
  # Update happy when building with GHC 7.8 or head
 - |
   if [ $GHCVER = "head" ] || [ $GHCVER = "7.8.2" ]; then
     cabal install happy alex
     export PATH=$HOME/.cabal/bin:$PATH
   fi 

install:
 - cabal install --only-dependencies --enable-tests --enable-benchmarks

# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
script:
 - cabal configure --enable-tests
 - cabal build
 - cabal test

Add GHC 7.8 testing to Travis config
Add GHC 7.8 testing to Travis config

See https://github.com/hvr/multi-ghc-travis and
http://ro-che.info/articles/2014-03-08-happy-alex-ghc-7.8.html for gory
details.
