2015-03-04 16:45:22 -08:00
# Taken from multi-ghc-travis
# 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 :
- CABALVER=1.18 GHCVER=7.6.3
- CABALVER=1.18 GHCVER=7.8.4 # see note about Alex/Happy for GHC >= 7.8
2015-04-07 11:05:11 -07:00
- CABALVER=1.22 GHCVER=7.10.1
2015-08-03 02:28:37 +05:30
- CABALVER=1.22 GHCVER=7.10.2
2015-03-04 18:07:26 -08:00
# - CABALVER=head GHCVER=head # see section about GHC HEAD snapshots
2015-03-04 16:45:22 -08:00
# 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-$CABALVER ghc-$GHCVER # see note about happy/alex
2015-03-04 18:30:33 -08:00
- travis_retry sudo apt-get install libmagic-dev
2015-03-20 13:35:03 -07:00
- travis_retry sudo apt-get install python3
2015-03-04 16:50:51 -08:00
- travis_retry git clone http://www.github.com/zeromq/zeromq4-x.git libzmq
2015-03-04 17:05:36 -08:00
- export OLDPWD=$(pwd) && cd libzmq && travis_retry ./autogen.sh && travis_retry ./configure && make && travis_retry sudo make install && travis_retry sudo ldconfig && cd $OLDPWD
2015-03-05 17:09:31 -08:00
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH
2015-03-04 16:45:22 -08:00
- |
if [ $GHCVER = "head" ] || [ ${GHCVER%.*} = "7.8" ] || [ ${GHCVER%.*} = "7.10" ]; then
travis_retry sudo apt-get install happy-1.19.4 alex-3.1.3
2015-03-26 10:45:03 +05:30
travis_retry sudo apt-get install libblas-dev liblapack-dev
2015-03-04 16:45:22 -08:00
export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH
else
travis_retry sudo apt-get install happy alex
fi
install :
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
2015-03-04 18:07:26 -08:00
- travis_retry cabal install cpphs
2015-03-04 18:30:33 -08:00
- travis_retry cabal install gtk2hs-buildtools
2015-03-06 13:03:42 -08:00
- |
if [ ${GHCVER%.*} = "7.8" ]; then
travis_retry cabal install arithmoi==0.4.* -fllvm
2015-03-20 14:07:44 -07:00
travis_retry git clone http://www.github.com/gibiansky/hindent
2015-03-20 22:40:49 -07:00
cd hindent && travis_retry cabal install && cd ..
2015-03-06 13:03:42 -08:00
fi
2015-03-04 16:45:22 -08:00
# 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 :
2015-03-04 23:06:22 -08:00
- |
2015-08-03 10:41:31 +05:30
if [ ${GHCVER%.*} = "7.8" ]; then
2015-03-06 21:11:30 -08:00
travis_retry ./build.sh all
2015-08-03 10:41:31 +05:30
elif [ ${GHCVER%.*} = "7.10" ]; then
travis_retry ./build.sh all no-widgets
2015-03-06 21:11:30 -08:00
else
travis_retry ./build.sh ihaskell
2015-03-04 22:47:28 -08:00
fi
2015-08-03 10:41:31 +05:30
2015-03-05 14:26:37 -08:00
# Build and run the test suite
2015-03-26 12:42:40 +05:30
- travis_retry cabal install --only-dependencies --enable-tests
2015-03-05 19:55:47 -08:00
- travis_retry cabal configure --enable-tests
2015-04-07 14:42:16 -07:00
- |
if [ ${GHCVER%.*} = "7.8" ]; then
travis_retry cabal test --show-details=always
fi
2015-03-20 14:07:44 -07:00
- |
if [ ${GHCVER%.*} = "7.8" ]; then
./verify_formatting.py
fi
2015-03-04 16:45:22 -08:00
- cabal sdist
# 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 --force-reinstalls "$SRC_TGZ";
else
echo "expected '$SRC_TGZ' not found";
exit 1;
fi