|
1 | | -# It seems that we can't use the CABALVER and GHCVER environment variables in a |
2 | | -# toplevel addons.apt.packages section, so we have to duplicate things below. |
| 1 | +# This file has been generated -- see https://github.com/hvr/multi-ghc-travis |
| 2 | +language: c |
| 3 | +sudo: false |
| 4 | + |
| 5 | +cache: |
| 6 | + directories: |
| 7 | + - $HOME/.cabsnap |
| 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 | + |
3 | 14 | matrix: |
4 | 15 | include: |
5 | | - - env: CABALVER=1.16 GHCVER=7.0.4 |
6 | | - addons: |
7 | | - apt: |
8 | | - sources: |
9 | | - - hvr-ghc |
10 | | - packages: |
11 | | - - freeglut3-dev |
12 | | - - cabal-install-1.16 |
13 | | - - ghc-7.0.4 |
14 | | - - env: CABALVER=1.16 GHCVER=7.2.2 |
15 | | - addons: |
16 | | - apt: |
17 | | - sources: |
18 | | - - hvr-ghc |
19 | | - packages: |
20 | | - - freeglut3-dev |
21 | | - - cabal-install-1.16 |
22 | | - - ghc-7.2.2 |
23 | | - - env: CABALVER=1.16 GHCVER=7.4.2 |
24 | | - addons: |
25 | | - apt: |
26 | | - sources: |
27 | | - - hvr-ghc |
28 | | - packages: |
29 | | - - freeglut3-dev |
30 | | - - cabal-install-1.16 |
31 | | - - ghc-7.4.2 |
32 | | - - env: CABALVER=1.16 GHCVER=7.6.3 |
33 | | - addons: |
34 | | - apt: |
35 | | - sources: |
36 | | - - hvr-ghc |
37 | | - packages: |
38 | | - - freeglut3-dev |
39 | | - - cabal-install-1.16 |
40 | | - - ghc-7.6.3 |
41 | | - - env: CABALVER=1.20 GHCVER=7.8.4 |
42 | | - addons: |
43 | | - apt: |
44 | | - sources: |
45 | | - - hvr-ghc |
46 | | - packages: |
47 | | - - freeglut3-dev |
48 | | - - cabal-install-1.20 |
49 | | - - ghc-7.8.4 |
50 | | - - env: CABALVER=1.22 GHCVER=7.10.3 |
51 | | - addons: |
52 | | - apt: |
53 | | - sources: |
54 | | - - hvr-ghc |
55 | | - packages: |
56 | | - - freeglut3-dev |
57 | | - - cabal-install-1.22 |
58 | | - - ghc-7.10.3 |
59 | | - - env: CABALVER=1.24 GHCVER=8.0.1 |
60 | | - addons: |
61 | | - apt: |
62 | | - sources: |
63 | | - - hvr-ghc |
64 | | - packages: |
65 | | - - freeglut3-dev |
66 | | - - cabal-install-1.24 |
67 | | - - ghc-8.0.1 |
68 | | - - env: CABALVER=head GHCVER=head |
69 | | - addons: |
70 | | - apt: |
71 | | - sources: |
72 | | - - hvr-ghc |
73 | | - packages: |
74 | | - - freeglut3-dev |
75 | | - - cabal-install-head |
76 | | - - ghc-head |
| 16 | + - env: CABALVER=1.16 GHCVER=7.0.4 |
| 17 | + compiler: ": #GHC 7.0.4" |
| 18 | + addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,freeglut3-dev], sources: [hvr-ghc]}} |
| 19 | + - env: CABALVER=1.16 GHCVER=7.2.2 |
| 20 | + compiler: ": #GHC 7.2.2" |
| 21 | + addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,freeglut3-dev], 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,freeglut3-dev], 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,freeglut3-dev], 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,freeglut3-dev], 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,freeglut3-dev], sources: [hvr-ghc]}} |
| 34 | + - env: CABALVER=1.24 GHCVER=8.0.1 |
| 35 | + compiler: ": #GHC 8.0.1" |
| 36 | + addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,freeglut3-dev], sources: [hvr-ghc]}} |
| 37 | + - env: CABALVER=head GHCVER=head |
| 38 | + compiler: ": #GHC head" |
| 39 | + addons: {apt: {packages: [cabal-install-head,ghc-head,freeglut3-dev], sources: [hvr-ghc]}} |
| 40 | + |
77 | 41 | allow_failures: |
78 | | - - env: CABALVER=head GHCVER=head |
| 42 | + - env: CABALVER=head GHCVER=head |
79 | 43 |
|
80 | | -sudo: false |
| 44 | +before_install: |
| 45 | + - unset CC |
| 46 | + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH |
81 | 47 |
|
82 | | -# The packages from the PPA don't put this into the PATH automatically. |
83 | 48 | install: |
84 | | - - export PATH="/opt/cabal/$CABALVER/bin:/opt/ghc/$GHCVER/bin:$PATH" |
85 | | - |
86 | | -before_script: |
87 | 49 | - cabal --version |
88 | | - - cabal update |
89 | | - - ghc --version |
90 | | - - ghc-pkg list |
91 | | - - if test "$GHCVER" \> "7.1"; then cabal install random; fi |
92 | | - - ghc-pkg list |
| 50 | + - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" |
| 51 | + - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; |
| 52 | + then |
| 53 | + zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > |
| 54 | + $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; |
| 55 | + fi |
| 56 | + - travis_retry cabal update -v |
| 57 | + - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config |
| 58 | + - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt |
| 59 | + - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt |
| 60 | + |
| 61 | +# check whether current requested install-plan matches cached package-db snapshot |
| 62 | + - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; |
| 63 | + then |
| 64 | + echo "cabal build-cache HIT"; |
| 65 | + rm -rfv .ghc; |
| 66 | + cp -a $HOME/.cabsnap/ghc $HOME/.ghc; |
| 67 | + cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; |
| 68 | + else |
| 69 | + echo "cabal build-cache MISS"; |
| 70 | + rm -rf $HOME/.cabsnap; |
| 71 | + mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; |
| 72 | + cabal install --only-dependencies --enable-tests --enable-benchmarks; |
| 73 | + fi |
93 | 74 |
|
| 75 | +# snapshot package-db on cache miss |
| 76 | + - if [ ! -d $HOME/.cabsnap ]; |
| 77 | + then |
| 78 | + echo "snapshotting package-db to build-cache"; |
| 79 | + mkdir $HOME/.cabsnap; |
| 80 | + cp -a $HOME/.ghc $HOME/.cabsnap/ghc; |
| 81 | + cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; |
| 82 | + fi |
| 83 | + |
| 84 | +# Here starts the actual work to be performed for the package under test; |
| 85 | +# any command which exits with a non-zero exit code causes the build to fail. |
94 | 86 | script: |
95 | | - - cabal install --enable-documentation --flags=BuildExamples `test "$GHCVER" \> "7.3" && echo "--jobs"` |
96 | | - - cabal sdist |
| 87 | + - if [ -f configure.ac ]; then autoreconf -i; fi |
| 88 | + - cabal configure --enable-tests --enable-benchmarks --ghc-options=-Werror -v2 # -v2 provides useful information for debugging |
| 89 | + - cabal build # this builds all libraries and executables (including tests/benchmarks) |
| 90 | + - cabal test |
| 91 | + - cabal check |
| 92 | + - cabal haddock # tests that documentation can be generated |
| 93 | + - cabal sdist # tests that a source-distribution can be generated |
| 94 | + |
| 95 | +# Check that the resulting source distribution can be built & installed. |
| 96 | +# If there are no other `.tar.gz` files in `dist`, this can be even simpler: |
| 97 | +# `cabal install --force-reinstalls dist/*-*.tar.gz` |
| 98 | + - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && |
| 99 | + (cd dist && cabal install --force-reinstalls "$SRC_TGZ") |
97 | 100 |
|
98 | | -after_script: |
99 | | - - ghc-pkg list |
| 101 | +# EOF |
0 commit comments