language: c # explicitly request container-based infrastructure sudo: false matrix: include: - env: CABALVER=1.18 GHCVER=7.8.4 HAPPYVER=1.19.4 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.4], sources: [hvr-ghc]}} - env: CABALVER=1.22 GHCVER=7.10.1 HAPPYVER=1.19.5 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,happy-1.19.5],sources: [hvr-ghc]}} - env: CABALVER=head GHCVER=head HAPPYVER=head addons: {apt: {packages: [cabal-install-head,ghc-head,happy-head], sources: [hvr-ghc]}} allow_failures: - env: CABALVER=1.18 GHCVER=7.8.4 HAPPYVER=1.19.4 - env: CABALVER=head GHCVER=head HAPPYVER=head before_install: - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH:/opt/happy/$HAPPYVER/bin install: - cabal --version - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" - travis_retry cabal update - cabal install --only-dependencies --enable-tests --enable-benchmarks # Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail. script: - if [ -f configure.ac ]; then autoreconf -i; fi - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging - cabal build --ghc-options="-O0" # this builds all libraries and executables (including tests/benchmarks) - cabal test - cabal check - cabal sdist # tests that a source-distribution can be generated # Check that the resulting source distribution can be built & installed. # If there are no other `.tar.gz` files in `dist`, this can be even simpler: # `cabal install --force-reinstalls dist/*-*.tar.gz` - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && (cd dist && cabal install --force-reinstalls "$SRC_TGZ")