.travis.yml 1.93 KB
Newer Older
1
2
3
# Based on https://github.com/hvr/multi-ghc-travis
#
# NB: don't set `language: haskell` here
judah's avatar
judah committed
4
env:
judah's avatar
judah committed
5
6
7
8
 - CABALVER=1.16 GHCVER=7.0.1
 - CABALVER=1.16 GHCVER=7.0.2
 - CABALVER=1.16 GHCVER=7.0.3
 - CABALVER=1.16 GHCVER=7.0.4
9
10
 - CABALVER=1.16 GHCVER=7.2.1
 - CABALVER=1.16 GHCVER=7.2.2
judah's avatar
judah committed
11
12
13
14
15
16
17
18
19
 - CABALVER=1.16 GHCVER=7.4.1
 - CABALVER=1.16 GHCVER=7.4.2
 - CABALVER=1.16 GHCVER=7.6.1
 - CABALVER=1.16 GHCVER=7.6.2
 - CABALVER=1.18 GHCVER=7.6.3
 - CABALVER=1.18 GHCVER=7.8.1
 - CABALVER=1.18 GHCVER=7.8.2
 - CABALVER=1.18 GHCVER=7.8.3
 - CABALVER=1.22 GHCVER=7.10.1
judah's avatar
judah committed
20

21
# Note: the distinction between `before_install` and `install` is not important.
judah's avatar
judah committed
22
before_install:
23
24
25
26
 - 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
 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
judah's avatar
judah committed
27
28

install:
29
30
31
 - cabal --version
 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
 - travis_retry cabal update
32
 - cabal install --only-dependencies
judah's avatar
judah committed
33
 - cabal install "Cabal == $CABALVER.*"  # Use the same Cabal version for Setup.hs and cabal-install
judah's avatar
judah committed
34

35
# 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.
judah's avatar
judah committed
36
script:
37
 - if [ -f configure.ac ]; then autoreconf -i; fi
judah's avatar
judah committed
38
 - cabal --version
39
 - cabal configure -v2  # -v2 provides useful information for debugging
40
41
42
43
 - cabal build   # this builds all libraries and executables (including tests/benchmarks)
 - cabal check
 - cabal sdist   # tests that a source-distribution can be generated

judah's avatar
judah committed
44
# The following scriptlet checks that the resulting source distribution can be built & installed
45
 - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
judah's avatar
judah committed
46
47
   cd dist/;
   if [ -f "$SRC_TGZ" ]; then
48
      cabal install --force-reinstalls "$SRC_TGZ";
judah's avatar
judah committed
49
50
51
52
   else
      echo "expected '$SRC_TGZ' not found";
      exit 1;
   fi