Skip to content

Commit 07a6885

Browse files
committed
Add Travis-CI control file
1 parent 309f6ee commit 07a6885

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.travis.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
2+
language: c
3+
sudo: false
4+
5+
cache:
6+
directories:
7+
- $HOME/.cabsnap
8+
- $HOME/.cabal/packages
9+
10+
before_cache:
11+
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
12+
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
13+
14+
matrix:
15+
include:
16+
- env: CABALVER=1.16 GHCVER=7.0.4 NOTEST=1
17+
compiler: ": #GHC 7.0.4"
18+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,zlib1g-dev], sources: [hvr-ghc]}}
19+
- env: CABALVER=1.16 GHCVER=7.2.2 NOTEST=1
20+
compiler: ": #GHC 7.2.2"
21+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,zlib1g-dev], sources: [hvr-ghc]}}
22+
- env: CABALVER=1.16 GHCVER=7.4.2
23+
compiler: ": #GHC 7.4.2"
24+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,zlib1g-dev], sources: [hvr-ghc]}}
25+
- env: CABALVER=1.16 GHCVER=7.6.3
26+
compiler: ": #GHC 7.6.3"
27+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,zlib1g-dev], sources: [hvr-ghc]}}
28+
- env: CABALVER=1.18 GHCVER=7.8.4
29+
compiler: ": #GHC 7.8.4"
30+
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,zlib1g-dev], sources: [hvr-ghc]}}
31+
- env: CABALVER=1.22 GHCVER=7.10.1
32+
compiler: ": #GHC 7.10.1"
33+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,zlib1g-dev], sources: [hvr-ghc]}}
34+
- env: CABALVER=head GHCVER=head
35+
compiler: ": #GHC head"
36+
addons: {apt: {packages: [cabal-install-head,ghc-head,zlib1g-dev], sources: [hvr-ghc]}}
37+
38+
allow_failures:
39+
- env: CABALVER=head GHCVER=head
40+
41+
before_install:
42+
- unset CC
43+
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
44+
- if [ "x$NOTEST" = "x" ]; then export CABFLAGS="--enable-tests"; else export CABFLAGS=""; fi
45+
46+
install:
47+
- cabal --version
48+
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
49+
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
50+
then
51+
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
52+
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
53+
fi
54+
- travis_retry cabal update -v
55+
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
56+
- cabal install --only-dependencies $CABFLAGS --dry -v > installplan.txt
57+
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
58+
59+
# check whether current requested install-plan matches cached package-db snapshot
60+
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
61+
then
62+
echo "cabal build-cache HIT";
63+
rm -rfv .ghc;
64+
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
65+
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
66+
else
67+
echo "cabal build-cache MISS";
68+
rm -rf $HOME/.cabsnap;
69+
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
70+
cabal install --only-dependencies $CABFLAGS;
71+
fi
72+
73+
# snapshot package-db on cache miss
74+
- if [ ! -d $HOME/.cabsnap ];
75+
then
76+
echo "snapshotting package-db to build-cache";
77+
mkdir $HOME/.cabsnap;
78+
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
79+
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
80+
fi
81+
82+
# Here starts the actual work to be performed for the package under test;
83+
# any command which exits with a non-zero exit code causes the build to fail.
84+
script:
85+
- if [ -f configure.ac ]; then autoreconf -i; fi
86+
- cabal configure $CABFLAGS -v2 # -v2 provides useful information for debugging
87+
- cabal build # this builds all libraries and executables (including tests/benchmarks)
88+
- if [ "x$NOTEST" = "x" ]; then cabal test; fi
89+
- cabal sdist # tests that a source-distribution can be generated
90+
91+
# Check that the resulting source distribution can be built & installed.
92+
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
93+
# `cabal install --force-reinstalls dist/*-*.tar.gz`
94+
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
95+
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
96+
97+
# EOF

zlib.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ description: This package provides a pure interface for compressing and
1818
provides access to the full zlib feature set.
1919
build-type: Simple
2020
cabal-version: >= 1.10
21+
tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.1, GHC ==7.11.*
22+
2123
extra-source-files: changelog
2224
-- zlib C sources (for Windows)
2325
cbits/crc32.h cbits/inffast.h cbits/inflate.h

0 commit comments

Comments
 (0)