New travis with support for multiple GHCs (#106)

This commit is contained in:
Aditya Manthramurthy 2019-02-26 15:58:23 -08:00 committed by GitHub
parent 0fc264bbc2
commit ab7d04bb59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,40 +1,52 @@
# This is the simple Travis configuration, which is intended for use sudo: true
# on applications which do not require cross-platform and language: haskell
# multiple-GHC-version support. For more information and other
# options, see:
#
# https://docs.haskellstack.org/en/stable/travis_ci/
#
# Copy these contents into the root directory of your Github project in a file
# named .travis.yml
# Use new container infrastructure to enable caching git:
sudo: false depth: 5
# Do not choose a language; we provide our own build tools. cabal: "2.4"
language: generic
# Caching so the next build will be fast too.
cache: cache:
directories: directories:
- $HOME/.stack - "$HOME/.cabal/store"
- "$HOME/.stack"
- "$TRAVIS_BUILD_DIR/.stack-work"
# Ensure necessary system libraries are present matrix:
addons: include:
apt:
packages:
- libgmp-dev
before_install: # Cabal
# Download and unpack the stack executable - ghc: 8.2.2
- mkdir -p ~/.local/bin - ghc: 8.4.4
- export PATH=$HOME/.local/bin:$PATH - ghc: 8.6.3
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# Stack
- ghc: 8.6.3
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"
install: install:
# Build dependencies - |
- stack --no-terminal --install-ghc test --only-dependencies if [ -z "$STACK_YAML" ]; then
ghc --version
cabal --version
cabal new-update
cabal new-build --enable-tests --enable-benchmarks
else
# install stack
curl -sSL https://get.haskellstack.org/ | sh
# build project with stack
stack --version
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
fi
script: script:
# Build the package, its tests, and its docs and run the tests - |
- stack --no-terminal test --haddock --no-haddock-deps --test-arguments --num-threads=1 if [ -z "$STACK_YAML" ]; then
cabal new-test --enable-tests
else
stack test --system-ghc
fi
notifications:
email: false