|
1 |
| -# GHC 7.10 is too slow to successfully build the test suite |
2 |
| - |
3 |
| -env: |
4 |
| - - GHCVER=7.0.1 CABALVER=1.16 TESTS="--enable-tests" |
5 |
| - - GHCVER=7.0.4 CABALVER=1.16 TESTS="--enable-tests" |
6 |
| - # we have to use CABALVER=1.16 for GHC<7.6 as well, as there's |
7 |
| - # no package for earlier cabal versions in the PPA |
8 |
| - - GHCVER=7.2.2 CABALVER=1.16 TESTS="--enable-tests" |
9 |
| - - GHCVER=7.4.2 CABALVER=1.16 TESTS="--enable-tests" |
10 |
| - - GHCVER=7.6.3 CABALVER=1.16 TESTS="--enable-tests" |
11 |
| - - GHCVER=7.8.4 CABALVER=1.18 TESTS="--enable-tests" |
12 |
| - - GHCVER=7.10.2 CABALVER=1.22 TESTS="" |
13 |
| - - GHCVER=head CABALVER=head TESTS="" |
| 1 | +# This file has been generated by `make_travis_yml_2.hs` |
| 2 | +# see https://github.com/hvr/multi-ghc-travis for more information |
| 3 | +language: c |
| 4 | +sudo: false |
| 5 | + |
| 6 | +cache: |
| 7 | + directories: |
| 8 | + - $HOME/.cabal/packages |
| 9 | + - $HOME/.cabal/store |
| 10 | + |
| 11 | +before_cache: |
| 12 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log |
| 13 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar |
14 | 14 |
|
15 | 15 | matrix:
|
| 16 | + include: |
| 17 | + - env: CABALVER=1.24 GHCVER=7.0.4 |
| 18 | + compiler: ": #GHC 7.0.4" |
| 19 | + addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.4], sources: [hvr-ghc]}} |
| 20 | + - env: CABALVER=1.24 GHCVER=7.2.2 |
| 21 | + compiler: ": #GHC 7.2.2" |
| 22 | + addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.2], sources: [hvr-ghc]}} |
| 23 | + - env: CABALVER=1.24 GHCVER=7.6.3 |
| 24 | + compiler: ": #GHC 7.6.3" |
| 25 | + addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3], sources: [hvr-ghc]}} |
| 26 | + - env: CABALVER=1.24 GHCVER=7.8.4 |
| 27 | + compiler: ": #GHC 7.8.4" |
| 28 | + addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4], sources: [hvr-ghc]}} |
| 29 | + - env: CABALVER=1.24 GHCVER=7.10.3 |
| 30 | + compiler: ": #GHC 7.10.3" |
| 31 | + addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3], sources: [hvr-ghc]}} |
| 32 | + - env: CABALVER=1.24 GHCVER=8.0.1 |
| 33 | + compiler: ": #GHC 8.0.1" |
| 34 | + addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}} |
| 35 | + - env: CABALVER=head GHCVER=head |
| 36 | + compiler: ": #GHC head" |
| 37 | + addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} |
| 38 | + |
16 | 39 | allow_failures:
|
17 |
| - - env: GHCVER=head CABALVER=head TESTS="" |
| 40 | + - env: CABALVER=head GHCVER=head |
18 | 41 |
|
19 | 42 | before_install:
|
20 |
| - - travis_retry sudo add-apt-repository -y ppa:hvr/ghc |
21 |
| - - travis_retry sudo apt-get update |
22 |
| - - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER |
| 43 | + - unset CC |
23 | 44 | - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
|
24 |
| - - cabal --version |
25 | 45 |
|
26 | 46 | install:
|
27 |
| - - travis_retry cabal update |
28 |
| - - cabal install $TESTS --only-dependencies |
| 47 | + - cabal --version |
| 48 | + - BENCH=${BENCH---enable-benchmarks} |
| 49 | + - TEST=${TEST---enable-tests} |
| 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 new-build ${TEST} ${BENCH} --dep |
29 | 59 |
|
| 60 | +# Here starts the actual work to be performed for the package under test; |
| 61 | +# any command which exits with a non-zero exit code causes the build to fail. |
30 | 62 | script:
|
31 |
| - - cabal configure -v2 $TESTS |
32 |
| - - cabal build |
33 |
| - - cabal sdist |
34 |
| - - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ; |
35 |
| - cd dist/; |
36 |
| - if [ -f "$SRC_TGZ" ]; then |
37 |
| - cabal install "$SRC_TGZ"; |
38 |
| - else |
39 |
| - echo "expected '$SRC_TGZ' not found"; |
40 |
| - exit 1; |
41 |
| - fi |
| 63 | + - if [ -f configure.ac ]; then autoreconf -i; fi |
| 64 | + # this builds all libraries and executables (including tests/benchmarks) |
| 65 | + - cabal new-build ${TEST} ${BENCH} -v2 # -v2 provides useful information for debugging |
| 66 | + |
| 67 | + # there's no 'cabal new-test' yet, so let's emulate for now |
| 68 | + - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) ); |
| 69 | + RC=true; for T in ${TESTS[@]}; do echo "== $T =="; |
| 70 | + if dist-newstyle/build/*/build/$T/$T; then echo "= $T OK ="; |
| 71 | + else echo "= $T FAILED ="; RC=false; fi; done; $RC |
| 72 | + - cabal sdist # test that a source-distribution can be generated |
| 73 | + |
| 74 | + # Check that the resulting source distribution can be built w/o and w tests |
| 75 | + - SRC_BASENAME=$(cabal info . | awk '{print $2;exit}') |
| 76 | + - tar -C dist/ -xf dist/$SRC_BASENAME.tar.gz |
| 77 | + - "echo 'packages: *.cabal' > dist/$SRC_BASENAME/cabal.project" |
| 78 | + - cd dist/$SRC_BASENAME/ |
| 79 | + - cabal new-build --disable-tests --disable-benchmarks |
| 80 | + - rm -rf ./dist-newstyle |
| 81 | + - cabal new-build ${TEST} ${BENCH} |
| 82 | + |
| 83 | +# EOF |
0 commit comments