Skip to content

Instantly share code, notes, and snippets.

@Tehnix
Forked from tonyday567/.travis.yml
Created January 3, 2019 19:17
Show Gist options
  • Save Tehnix/83b353a0d599d8b1a4cce57c7d06acb4 to your computer and use it in GitHub Desktop.
Save Tehnix/83b353a0d599d8b1a4cce57c7d06acb4 to your computer and use it in GitHub Desktop.
A multi-ghc/cabal/stack haskell travis
language: haskell
dist: trusty
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
- $HOME/.stack
- $TRAVIS_BUILD_DIR/.stack-work
cabal: "2.4"
matrix:
include:
- env: BUILD=cabal
ghc: "8.6.3"
- env: BUILD=cabal
ghc: "8.4.4"
- env: BUILD=cabal
ghc: "8.2.2"
- env: BUILD=cabal
ghc: "8.0.2"
- env: BUILD=cabal
ghc: "7.10.3"
# --system-ghc is used to take advantage of language: haskell and save build time. If the stack resolver ghc and system-ghc become different, stack will download the right ghc
- env: BUILD=stack ARGS="--resolver lts-12.22 --system-ghc"
ghc: "8.4.4"
# a -Werror build that is allowed to fail
- env: BUILD=werror ARGS="--resolver lts-12.22 --system-ghc"
ghc: "8.4.4"
- env: BUILD=stack ARGS="--resolver nightly --system-ghc"
ghc: "8.6.2"
allow_failures:
- env: BUILD=stack ARGS="--resolver nightly --system-ghc"
- env: BUILD=werror ARGS="--resolver lts-12.22 --system-ghc"
install:
- |
case "$BUILD" in
cabal)
cabal --version
ghc --version
;;
stack|werror)
ghc --version
PATH=$HOME/.local/bin:$PATH
mkdir -p ~/.local/bin
if [ `uname` = "Darwin" ]
then
travis_retry curl --insecure -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
else
travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
fi
;;
esac
script:
- |
case "$BUILD" in
cabal)
cabal v2-update
cabal v2-build
cabal v2-test --enable-test
;;
stack)
stack --no-terminal $ARGS test --haddock --no-haddock-deps
;;
werror)
stack --no-terminal $ARGS test --haddock --no-haddock-deps --ghc-options -Werror --ghc-options -Wcompat --ghc-options -Wincomplete-record-updates --ghc-options -Wincomplete-uni-patterns --ghc-options -Wredundant-constraints
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment