# from https://github.com/hvr/multi-ghc-travis
env:
- CABALVER=1.22 GHCVER=7.6.3
- CABALVER=1.22 GHCVER=7.8.4 # see note about Alex/Happy
- CABALVER=1.22 GHCVER=7.10.2 # see note about Alex/Happy
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-$CABALVER ghc-$GHCVER libgsl0-dev liblapack-dev
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
install:
- cabal update
- cabal install alex
- cabal install happy
- cabal install gtk2hs-buildtools
- for pkg in $(ghc-pkg list --user); do ghc-pkg unregister --force ${pkg}; done
- cabal install Cabal
- cabal install --only-dependencies --enable-tests --enable-benchmarks --reorder-goals
# 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 --enable-benchmarks -v2 # -v2 provides useful information for debugging
- cabal build # this builds all libraries and executables (including tests/benchmarks)
- cabal test --show-details=always
# - cabal check
- cabal sdist # tests that a source-distribution can be generated
# The following scriptlet checks that the resulting source distribution can be built & installed
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
cd dist/;
if [ -f "$SRC_TGZ" ]; then
cabal install "$SRC_TGZ";
else
echo "expected '$SRC_TGZ' not found";
exit 1;
fi