aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJulien Tanguy <julien.tanguy@jhome.fr>2015-08-17 19:11:24 +0200
committerJulien Tanguy <julien.tanguy@jhome.fr>2015-08-17 19:11:24 +0200
commitb1c4109f79dd96e033c9a849328dabe90ee9afe8 (patch)
tree2bb20be1e609d7ac860df57eeee957573140dd24
parenta11f20be0fadf21cc96164b49305b59ac7445aa2 (diff)
downloadhmacaroons-b1c4109f79dd96e033c9a849328dabe90ee9afe8.tar.gz
hmacaroons-b1c4109f79dd96e033c9a849328dabe90ee9afe8.tar.zst
hmacaroons-b1c4109f79dd96e033c9a849328dabe90ee9afe8.zip
Use hvr's generated .travis.yml
-rw-r--r--.travis.yml95
-rw-r--r--hmacaroons.cabal1
2 files changed, 66 insertions, 30 deletions
diff --git a/.travis.yml b/.travis.yml
index 618741d..f0ecd95 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,45 +1,80 @@
1# See also https://github.com/hvr/multi-ghc-travis for more information 1# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
2language: c 2language: c
3
4sudo: false 3sudo: false
5 4
6# The following lines enable several GHC versions and/or HP versions 5cache:
7# to be tested; often it's enough to test only against the last 6 directories:
8# release of a major GHC version. Setting HPVER implictly sets 7 - $HOME/.cabsnap
9# GHCVER. Omit lines with versions you don't need/want testing for. 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
10matrix: 14matrix:
11 include: 15 include:
12 - env: CABALVER=1.18 GHCVER=7.8.4 CTOPTS="" 16 - env: CABALVER=1.18 GHCVER=7.8.4
13 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}} 17 compiler: ": #GHC 7.8.4"
14 - env: CABALVER=1.22 GHCVER=7.10.1 CTOPTS="--show-details=streaming" 18 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
15 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1],sources: [hvr-ghc]}} 19 - env: CABALVER=1.22 GHCVER=7.10.1
16 - env: CABALVER=head GHCVER=head CTOPTS="--show-details=streaming" 20 compiler: ": #GHC 7.10.1"
17 addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} 21 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
18 22
19 allow_failures:
20 - env: CABALVER=head GHCVER=head
21 23
22before_install: 24before_install:
23 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH 25 - unset CC
26 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
24 27
25install: 28install:
26 - cabal --version 29 - cabal --version
27 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" 30 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
28 - travis_retry cabal update 31 - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
29 - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config # The container environment reports 16 cores 32 then
30 - cabal install --only-dependencies --enable-tests --enable-benchmarks 33 zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
34 $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
35 fi
36 - travis_retry cabal update -v
37 - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
38 - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
39 - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
31 40
32script: 41# check whether current requested install-plan matches cached package-db snapshot
33 - cabal configure --enable-tests --enable-benchmarks -v2 42 - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
34 - cabal build 43 then
35 44 echo "cabal build-cache HIT";
36 - cabal test $CTOPTS 45 rm -rfv .ghc;
46 cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
47 cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
48 else
49 echo "cabal build-cache MISS";
50 rm -rf $HOME/.cabsnap;
51 mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
52 cabal install --only-dependencies --enable-tests --enable-benchmarks;
53 fi
37 54
38 - cabal check 55# snapshot package-db on cache miss
56 - if [ ! -d $HOME/.cabsnap ];
57 then
58 echo "snapshotting package-db to build-cache";
59 mkdir $HOME/.cabsnap;
60 cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
61 cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
62 fi
39 63
40 - cabal sdist 64# Here starts the actual work to be performed for the package under test;
65# any command which exits with a non-zero exit code causes the build to fail.
66script:
67 - if [ -f configure.ac ]; then autoreconf -i; fi
68 - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
69 - cabal build # this builds all libraries and executables (including tests/benchmarks)
70 - cabal test
71 - cabal check
72 - cabal sdist # tests that a source-distribution can be generated
41 73
42 - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && 74# Check that the resulting source distribution can be built & installed.
43 (cd dist && cabal install --force-reinstalls "$SRC_TGZ") 75# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
76# `cabal install --force-reinstalls dist/*-*.tar.gz`
77 - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
78 (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
44 79
45# EOF 80# EOF
diff --git a/hmacaroons.cabal b/hmacaroons.cabal
index 85958b9..8c6f410 100644
--- a/hmacaroons.cabal
+++ b/hmacaroons.cabal
@@ -43,6 +43,7 @@ extra-source-files: README.md
43 CONTRIBUTING.md 43 CONTRIBUTING.md
44 CHANGELOG.md 44 CHANGELOG.md
45cabal-version: >=1.10 45cabal-version: >=1.10
46tested-with: GHC==7.8.4, GHC==7.10.1
46 47
47source-repository head 48source-repository head
48 type: git 49 type: git