Skip to content

Commit 234896a

Browse files
committed
Add Travis-CI job control file
This builds and tests containers with GHC 7.0, 7.4, 7.6, 7.8, and GHC HEAD (Once haskell/cabal#1806 is fixed we can use CABALVER=1.20 w/ GHCVER=7.8.2)
1 parent c17cfaf commit 234896a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.travis.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# NB: don't set `language: haskell` here
2+
3+
# See also https://github.com/hvr/multi-ghc-travis for more information
4+
env:
5+
- GHCVER=7.0.4 CABALVER=1.16
6+
# we have to use CABALVER=1.16 for GHC<7.6 as well, as there's
7+
# no package for earlier cabal versions in the PPA
8+
- GHCVER=7.4.2 CABALVER=1.16
9+
- GHCVER=7.6.3 CABALVER=1.16
10+
- GHCVER=7.8.2 CABALVER=1.18
11+
# NOTE: we can't use Cabal 1.20 yet due to
12+
# https://github.com/haskell/cabal/issues/1806
13+
- GHCVER=head CABALVER=1.18
14+
15+
matrix:
16+
allow_failures:
17+
- env: GHCVER=head CABALVER=1.18
18+
19+
# Note: the distinction between `before_install` and `install` is not
20+
# important.
21+
before_install:
22+
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
23+
- travis_retry sudo apt-get update
24+
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
25+
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
26+
- cabal --version
27+
28+
install:
29+
- travis_retry cabal update
30+
- cabal install --only-dependencies
31+
# we need to install the test-suite deps manually as the cabal solver would
32+
# otherwise complaing about cyclic deps
33+
- cabal install 'test-framework >= 0.3.3' 'test-framework-quickcheck2 >= 0.2.9' 'QuickCheck >= 2.4.0.1' 'ChasingBottoms' 'HUnit' 'test-framework-hunit'
34+
35+
# Here starts the actual work to be performed for the package under
36+
# test; any command which exits with a non-zero exit code causes the
37+
# build to fail.
38+
script:
39+
# -v2 provides useful information for debugging
40+
- cabal configure -v2 --enable-tests
41+
42+
# this builds all libraries and executables
43+
# (including tests/benchmarks)
44+
- cabal build
45+
- cabal test
46+
47+
# tests that a source-distribution can be generated
48+
- cabal sdist
49+
50+
# check that the generated source-distribution can be built & installed
51+
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
52+
cd dist/;
53+
if [ -f "$SRC_TGZ" ]; then
54+
cabal install --force-reinstalls "$SRC_TGZ";
55+
else
56+
echo "expected '$SRC_TGZ' not found";
57+
exit 1;
58+
fi
59+
60+
# EOF

0 commit comments

Comments
 (0)