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