@@ -1,31 +1,50 @@
1−# Based on https://github.com/hvr/multi-ghc-travis and https://github.com/ekmett/lens/blob/master/.travis.yml
3# NB: don't set `language: haskell` here
1# NB: don't set `language: haskell` here
5# 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.
3# 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.
7− - GHCVER=7.6.3
5+ - CABALVER=1.18 GHCVER=7.6.3
8− - GHCVER=7.8.2
6+ - CABALVER=1.18 GHCVER=7.8.3
7+ - CABALVER=1.22 GHCVER=7.10.1
11+ - env: CABALVER=1.22 GHCVER=7.10.1
10# Note: the distinction between `before_install` and `install` is not important.
13# Note: the distinction between `before_install` and `install` is not important.
11before_install:
14before_install:
12 - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
15 - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
13 - travis_retry sudo apt-get update
16 - travis_retry sudo apt-get update
14− - travis_retry sudo apt-get install cabal-install-1.18 ghc-$GHCVER happy alex # see note about happy/alex
17+ - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex
15− - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.18/bin:$PATH
18+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
17− # Update happy when building with GHC 7.8 or head
19− if [ $GHCVER = "head" ] || [ $GHCVER = "7.8.2" ]; then
20+ if [ $GHCVER = "head" ] || [ ${GHCVER%.*} = "7.8" ] || [ ${GHCVER%.*} = "7.10" ]; then
20− cabal install happy alex
21+ travis_retry sudo apt-get install happy-1.19.4 alex-3.1.3
21− export PATH=$HOME/.cabal/bin:$PATH
22+ export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH
24+ travis_retry sudo apt-get install happy alex
29+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
30+ - travis_retry cabal update
25 - cabal install --only-dependencies --enable-tests --enable-benchmarks
31 - cabal install --only-dependencies --enable-tests --enable-benchmarks
27# 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.
33# 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.
35+ - if [ -f configure.ac ]; then autoreconf -i; fi
29− - cabal configure --enable-tests
36+ - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
30− - cabal build
37+ - cabal build # this builds all libraries and executables (including tests/benchmarks)
31 - cabal test
38 - cabal test
40+ - cabal sdist # tests that a source-distribution can be generated
42+# The following scriptlet checks that the resulting source distribution can be built & installed
43+ - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
45+ if [ -f "$SRC_TGZ" ]; then
46+ cabal install --force-reinstalls "$SRC_TGZ";
48+ echo "expected '$SRC_TGZ' not found";