stack/.travis.yml
2015-08-23 21:04:26 +02:00

71 lines
2.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.
#
sudo: false
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
addons:
apt:
sources:
- hvr-ghc
packages:
- cabal-install-1.18
- cabal-install-1.22
- cabal-install-head
- ghc-7.8.4
- ghc-7.10.1
- ghc-7.10.2
- ghc-head
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:
- export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- ./.travis-setup.sh
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
- cabal install --only-dependencies --constraint="ignore +without-pcre" --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0
script:
- if [ -f configure.ac ]; then autoreconf -i; fi
- cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror" # -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
# Takes too long for now
# - 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")