@@ -0,0 +1,91 @@
1+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
8+ - $HOME/.cabal/packages
11+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
12+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
16+ - env: CABALVER=1.16 GHCVER=7.0.1
17+ compiler: ": #GHC 7.0.1"
18+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.1], sources: [hvr-ghc]}}
19+ - env: CABALVER=1.16 GHCVER=7.2.1
20+ compiler: ": #GHC 7.2.1"
21+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.1], 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], 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], 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], sources: [hvr-ghc]}}
31+ - env: CABALVER=1.22 GHCVER=7.10.3
32+ compiler: ": #GHC 7.10.3"
33+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
37+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
41+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
42+ - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
44+ zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
45+ $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
47+ - travis_retry cabal update -v
48+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
49+ - cabal install --only-dependencies --enable-tests --dry -v > installplan.txt
50+ - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
52+# check whether current requested install-plan matches cached package-db snapshot
53+ - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
55+ echo "cabal build-cache HIT";
57+ cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
58+ cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
60+ echo "cabal build-cache MISS";
61+ rm -rf $HOME/.cabsnap;
62+ mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
63+ cabal install --only-dependencies --enable-tests;
66+# snapshot package-db on cache miss
67+ - if [ ! -d $HOME/.cabsnap ];
69+ echo "snapshotting package-db to build-cache";
70+ mkdir $HOME/.cabsnap;
71+ cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
72+ cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
75+# Here starts the actual work to be performed for the package under test;
76+# any command which exits with a non-zero exit code causes the build to fail.
78+ - if [ -f configure.ac ]; then autoreconf -i; fi
79+ - cabal configure --enable-tests -v2 # -v2 provides useful information for debugging
80+ - cabal build # this builds all libraries and executables (including tests)
83+ - cabal sdist # tests that a source-distribution can be generated
85+# Check that the resulting source distribution can be built & installed.
86+# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
87+# `cabal install --force-reinstalls dist/*-*.tar.gz`
88+ - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
89+ (cd dist && cabal install --force-reinstalls "$SRC_TGZ")