|
| 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 | +git: |
| 7 | + submodules: false # whether to recursively clone submodules |
| 8 | + |
| 9 | +cache: |
| 10 | + directories: |
| 11 | + - $HOME/.cabal/packages |
| 12 | + - $HOME/.cabal/store |
| 13 | + |
| 14 | +before_cache: |
| 15 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log |
| 16 | + # remove files that are regenerated by 'cabal update' |
| 17 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.* |
| 18 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json |
| 19 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache |
| 20 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar |
| 21 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx |
| 22 | + |
| 23 | +matrix: |
| 24 | + include: |
| 25 | + - env: CABALVER=head GHCVER=8.0.1 |
| 26 | + compiler: ": #GHC 8.0.1" |
| 27 | + addons: {apt: {packages: [cabal-install-head,ghc-8.0.1,libssl-dev], sources: [hvr-ghc]}} |
| 28 | + |
| 29 | +before_install: |
| 30 | + - unset CC |
| 31 | + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH |
| 32 | + |
| 33 | +install: |
| 34 | + - cabal --version |
| 35 | + - BENCH=${BENCH---enable-benchmarks} |
| 36 | + - TEST=${TEST---enable-tests} |
| 37 | + - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" |
| 38 | + - travis_retry cabal update -v |
| 39 | + - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config |
| 40 | + - cabal new-build ${TEST} ${BENCH} --dep -j2 |
| 41 | + |
| 42 | +# Here starts the actual work to be performed for the package under test; |
| 43 | +# any command which exits with a non-zero exit code causes the build to fail. |
| 44 | +script: |
| 45 | + - if [ -f configure.ac ]; then autoreconf -i; fi |
| 46 | + # this builds all libraries and executables (including tests/benchmarks) |
| 47 | + - cabal new-build ${TEST} ${BENCH} |
| 48 | + |
| 49 | + # there's no 'cabal new-test' yet, so let's emulate for now |
| 50 | + - SRC_BASENAME=$(cabal info . | awk '{print $2;exit}') |
| 51 | + - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) ); |
| 52 | + shopt -s globstar; |
| 53 | + RC=true; for T in ${TESTS[@]}; do echo "== $T =="; |
| 54 | + if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK ="; |
| 55 | + else echo "= $T FAILED ="; RC=false; fi; done; $RC |
| 56 | + - cabal sdist # test that a source-distribution can be generated |
| 57 | + |
| 58 | + # Check that the resulting source distribution can be built w/o and w tests |
| 59 | + - tar -C dist/ -xf dist/$SRC_BASENAME.tar.gz |
| 60 | + - "echo 'packages: .' > dist/$SRC_BASENAME/cabal.project" |
| 61 | + - cd dist/$SRC_BASENAME/ |
| 62 | + - cabal new-build --disable-tests --disable-benchmarks |
| 63 | + - rm -rf ./dist-newstyle |
| 64 | + - cabal new-build ${TEST} ${BENCH} |
| 65 | + |
| 66 | +# EOF |
0 commit comments