Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #24 from vincenthz/travis
Browse files Browse the repository at this point in the history
add travis
  • Loading branch information
vincenthz committed Dec 10, 2017
2 parents 727928a + dd08cbf commit 7b8da4b
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Use new container infrastructure to enable caching
sudo: false

# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
- $HOME/.stack

# The different configurations we want to test. We have BUILD=cabal which uses
# cabal-install, and BUILD=stack which uses Stack.
matrix:
include:
- env: BUILD=hlint
language: generic
compiler: hlint
- env: BUILD=stack RESOLVER=ghc-8.0
language: generic
addons: { apt: { packages: [ libgmp-dev ] } }
compiler: ghc-8.0
- env: BUILD=stack RESOLVER=ghc-8.2
language: generic
compiler: ghc-8.2
addons: { apt: { packages: [ libgmp-dev ] } }
- env: BUILD=stack RESOLVER=ghc-7.10
language: generic
addons: { apt: { packages: [ libgmp-dev ] } }
compiler: ghc-7.10
- env: BUILD=stack RESOLVER=ghc-7.8
language: generic
addons: { apt: { packages: [ libgmp-dev ] } }
compiler: ghc-7.8
- env: BUILD=stack RESOLVER=ghc-8.0
os: osx
language: generic
compiler: ghc-8.0

install:
- export PATH=$HOME/.local/bin::$HOME/.cabal/bin:$PATH
- mkdir -p ~/.local/bin
- |
case "$BUILD" in
stack)
if [ `uname` = "Darwin" ]
then
travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
else
travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
fi
;;
cabal)
;;
esac
script:
- |
set -ex
if [ "x${RUNTEST}" = "xfalse" ]; then exit 0; fi
case "$BUILD" in
stack)
rm stack.yaml && ln -sv .travis/stack-${RESOLVER}.yaml stack.yaml
stack --no-terminal test \
--flag foundation:bounds-check ${EXPERIMENTAL} \
--install-ghc \
--coverage --bench --no-run-benchmarks \
--haddock --no-haddock-deps
;;
cabal)
cabal install --only-dependencies --enable-tests
cabal test
cabal check
cabal sdist
;;
hlint)
curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s . --cpp-define=__GLASGOW_HASKELL__=800 --cpp-define=x86_64_HOST_ARCH=1 --cpp-define=mingw32_HOST_OS=1
;;
esac
set +ex
# It doesn't seem to be working so far.
#
#after_script:
# - travis_retry curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.3.0/shc-linux-x64-$GHCVER.tar.bz2 | tar -xj
# - ./shc foundation test-foundation
5 changes: 5 additions & 0 deletions .travis/stack-ghc-7.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: lts-6.35
packages:
- encoding
- parse
- types
5 changes: 5 additions & 0 deletions .travis/stack-ghc-7.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: lts-2.22
packages:
- encoding
- parse
- types
5 changes: 5 additions & 0 deletions .travis/stack-ghc-8.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: lts-9.17
packages:
- encoding
- parse
- types
5 changes: 5 additions & 0 deletions .travis/stack-ghc-8.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: nightly-2017-10-21
packages:
- encoding
- parse
- types
5 changes: 5 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: lts-9.17
packages:
- encoding
- parse
- types

0 comments on commit 7b8da4b

Please sign in to comment.