stack/.travis.yml
2015-06-18 12:56:27 +03:00

54 lines
2 KiB
YAML

# It may seem surprising that we don't dogfood stack itself here. The reason is
# twofold:
#
# 1. We want to ensure that the bootstrapping case works
#
# 2. Building with stack would be too easy a test, since it guarantees us a
# sane build environment. In CI, we want to make our life more difficult, so we
# use cabal without any Stackage snapshots.
#
env:
- CABALVER=1.18 GHCVER=7.8.4
- CABALVER=1.22 GHCVER=7.10.1
- CABALVER=1.22 GHCVER=7.10.2
- CABALVER=head GHCVER=head # see section about GHC HEAD snapshots
matrix:
allow_failures:
- env: CABALVER=head GHCVER=head
- env: CABALVER=1.22 GHCVER=7.10.2
# Note: the distinction between `before_install` and `install` is not important.
before_install:
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex
- export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
- cabal install cpphs
- cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls
script:
- if [ -f configure.ac ]; then autoreconf -i; fi
- cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
- cabal build # this builds all libraries and executables (including tests/benchmarks)
- cabal test
- cabal check
- cabal sdist # tests that a source-distribution can be generated
- cabal copy
- cd test/integration
- stack setup
- stack test
- cd ../..
# 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")