Skip to content

Commit 90878a9

Browse files
committed
Add travis-ci config
1 parent 5f322e0 commit 90878a9

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# NB: don't set `language: haskell` here
2+
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.
4+
env:
5+
- GHCVER=7.4.2
6+
- GHCVER=7.6.3
7+
- GHCVER=7.8.1
8+
# - GHCVER=head # see section about GHC HEAD snapshots
9+
10+
# Note: the distinction between `before_install` and `install` is not important.
11+
before_install:
12+
- sudo add-apt-repository -y ppa:hvr/ghc
13+
- sudo apt-get update
14+
- sudo apt-get install cabal-install-1.18 ghc-$GHCVER happy
15+
- export PATH=/opt/ghc/$GHCVER/bin:$PATH
16+
17+
install:
18+
- cabal-1.18 update
19+
- cabal-1.18 install --only-dependencies --enable-tests --enable-benchmarks
20+
21+
# 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.
22+
script:
23+
- cabal-1.18 configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
24+
- cabal-1.18 build # this builds all libraries and executables (including tests/benchmarks)
25+
- cabal-1.18 test
26+
- cabal-1.18 check
27+
- cabal-1.18 sdist # tests that a source-distribution can be generated
28+
29+
# The following scriptlet checks that the resulting source distribution can be built & installed
30+
- export SRC_TGZ=$(cabal-1.18 info . | awk '{print $2 ".tar.gz";exit}') ;
31+
cd dist/;
32+
if [ -f "$SRC_TGZ" ]; then
33+
cabal-1.18 install "$SRC_TGZ";
34+
else
35+
echo "expected '$SRC_TGZ' not found";
36+
exit 1;
37+
fi

0 commit comments

Comments
 (0)