aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2016-05-30 09:36:12 -0400
committermichaelt <what_is_it_to_do_anything@yahoo.com>2016-05-30 09:36:12 -0400
commit192598a2334966439809d171fc77172afea61204 (patch)
tree9049ffc25568111da130a752528ece2ee2b65087
parenta31032bb469a2d7eef089d54fb5069405f0710c9 (diff)
downloadtext-pipes-192598a2334966439809d171fc77172afea61204.tar.gz
text-pipes-192598a2334966439809d171fc77172afea61204.tar.zst
text-pipes-192598a2334966439809d171fc77172afea61204.zip
try fancy hvr travis
-rw-r--r--.travis.yml90
1 files changed, 84 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index 712aa56..7f63899 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,84 @@
1language: haskell 1# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
2ghc: 2language: c
3 - 7.6 3sudo: false
4 - 7.8 4
5notifications: 5cache:
6 email: false \ No newline at end of file 6 directories:
7 - $HOME/.cabsnap
8 - $HOME/.cabal/packages
9
10before_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
14matrix:
15 include:
16 - env: CABALVER=1.16 GHCVER=7.6.3
17 compiler: ": #GHC 7.6.3"
18 addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
19 - env: CABALVER=1.18 GHCVER=7.8.4
20 compiler: ": #GHC 7.8.4"
21 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
22 - env: CABALVER=1.22 GHCVER=7.10.2
23 compiler: ": #GHC 7.10.2"
24 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
25 - env: CABALVER=1.24 GHCVER=8.0.1
26 compiler: ": #GHC 8.0.1"
27 addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
28
29before_install:
30 - unset CC
31 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
32
33install:
34 - cabal --version
35 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
36 - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
37 then
38 zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
39 $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
40 fi
41 - travis_retry cabal update -v
42 - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
43 - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
44 - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
45
46# check whether current requested install-plan matches cached package-db snapshot
47 - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
48 then
49 echo "cabal build-cache HIT";
50 rm -rfv .ghc;
51 cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
52 cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
53 else
54 echo "cabal build-cache MISS";
55 rm -rf $HOME/.cabsnap;
56 mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
57 cabal install --only-dependencies --enable-tests --enable-benchmarks;
58 fi
59
60# snapshot package-db on cache miss
61 - if [ ! -d $HOME/.cabsnap ];
62 then
63 echo "snapshotting package-db to build-cache";
64 mkdir $HOME/.cabsnap;
65 cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
66 cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
67 fi
68
69# Here starts the actual work to be performed for the package under test;
70# any command which exits with a non-zero exit code causes the build to fail.
71script:
72 - if [ -f configure.ac ]; then autoreconf -i; fi
73 - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
74 - cabal build # this builds all libraries and executables (including tests/benchmarks)
75 - cabal test
76 - cabal sdist # tests that a source-distribution can be generated
77
78# Check that the resulting source distribution can be built & installed.
79# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
80# `cabal install --force-reinstalls dist/*-*.tar.gz`
81 - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
82 (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
83
84# EOF \ No newline at end of file