diff options
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 95 |
1 files changed, 65 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 |
2 | language: c | 2 | language: c |
3 | |||
4 | sudo: false | 3 | sudo: false |
5 | 4 | ||
6 | # The following lines enable several GHC versions and/or HP versions | 5 | cache: |
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 | |||
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 | |||
10 | matrix: | 14 | matrix: |
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 | ||
22 | before_install: | 24 | before_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 | ||
25 | install: | 28 | install: |
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 | ||
32 | script: | 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. | ||
66 | script: | ||
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 |