2016-05-03 21:17:06 +03:00
# Set-up
sudo : false
language : c
2018-02-26 23:53:16 +03:00
# If something is tagged, it's come from a PR which has been merged
# into master. There's no need to build both the tag and the merge
# commit.
if : tag IS blank
2016-05-03 21:17:06 +03:00
# Cache builds
cache :
directories :
- $HOME/.ghc
- $HOME/.cabal
- $HOME/.stack
2017-08-07 23:35:45 +03:00
# Goal: support latest 3 GHC major versions.
2016-05-03 21:17:06 +03:00
matrix :
2017-08-07 23:56:31 +03:00
fast_finish : true
2016-05-03 21:17:06 +03:00
include :
2018-02-09 20:21:53 +03:00
- env : MODE=test RESOLVER=lts-9.0 # GHC 8.0
2017-04-05 23:06:25 +03:00
addons : {apt : {packages : [ libgmp-dev]}}
2018-02-09 20:21:53 +03:00
- env : MODE=test RESOLVER=lts-10.0 # GHC 8.2
2017-12-23 06:08:47 +03:00
addons : {apt : {packages : [ libgmp-dev]}}
2018-03-24 23:45:31 +03:00
- env : MODE=test RESOLVER=nightly-2018-03-23 # GHC 8.4
addons : {apt : {packages : [ libgmp-dev]}}
2017-11-20 21:41:51 +03:00
- env : MODE=test RESOLVER=nightly
addons : {apt : {packages : [ libgmp-dev]}}
2018-02-09 20:20:52 +03:00
- env : MODE=doctest
2018-02-04 20:43:27 +03:00
addons : {apt : {packages : [ libgmp-dev]}}
2018-02-09 20:20:52 +03:00
- env : MODE=style
2016-05-03 21:17:06 +03:00
addons : {apt : {packages : [ libgmp-dev]}}
2018-02-13 00:52:12 +03:00
allow_failures :
- env : MODE=test RESOLVER=nightly
2016-05-03 21:17:06 +03:00
# Download and unpack the stack executable
before_install :
- export PATH=/opt/ghc/$GHCVER/bin:$HOME/.local/bin:$PATH
- mkdir -p ~/.local/bin
- curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
2018-02-09 20:20:52 +03:00
- if [[ ! -z "$RESOLVER" ]]; then if [[ -e ".travis/$RESOLVER.yaml" ]]; then mv .travis/$RESOLVER.yaml stack.yaml; else stack init --resolver=$RESOLVER --force; fi; fi
2017-11-20 21:41:51 +03:00
- stack --no-terminal setup
- if [[ "$MODE" == "style" ]]; then stack --no-terminal install stylish-haskell; fi
2018-02-04 20:43:27 +03:00
- if [[ "$MODE" == "doctest" ]]; then stack --no-terminal install doctest; fi
2016-05-03 21:17:06 +03:00
# Run tests
script :
2017-11-20 21:41:51 +03:00
- stack --no-terminal build concurrency
- stack --no-terminal build dejafu
- stack --no-terminal build hunit-dejafu
- stack --no-terminal build tasty-dejafu
- stack --no-terminal build dejafu-tests
- |
echo -en 'travis_fold:start:script.test\\r'
set -ex
case "$MODE" in
style)
curl -sL https://raw.github.com/ndmitchell/weeder/master/misc/travis.sh | sh -s .
2018-02-13 03:33:19 +03:00
curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s .
2017-11-20 21:41:51 +03:00
stack exec ./style.sh
2018-02-13 03:33:19 +03:00
git diff --exit-code
2017-11-20 21:41:51 +03:00
;;
test)
2018-02-16 23:04:52 +03:00
cd dejafu-tests
2018-02-16 23:04:35 +03:00
stack exec -- dejafu-tests +RTS -s
2017-11-20 21:41:51 +03:00
;;
2018-02-04 20:43:27 +03:00
doctest)
stack exec -- bash -c "DEJAFU_DOCTEST=y doctest dejafu/Test"
;;
2017-11-20 21:41:51 +03:00
esac
set +ex
echo -en 'travis_fold:end:script.test\\r'