-
Notifications
You must be signed in to change notification settings - Fork 38
/
.travis.yml
118 lines (97 loc) · 3.84 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# NOTE(mroberts): https://github.com/travis-ci/travis-ci/issues/4704
filter_secrets: false
sudo: false
language: generic
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
- $HOME/.stack
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
matrix:
include:
# NOTE(mroberts): See https://github.com/markandrus/twilio-haskell/issues/44
# - env: BUILD=cabal CABALVER=1.18 GHCVER=7.8.4
# compiler: ": #GHC 7.8.4"
# addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.1
compiler: ": #GHC 7.10.1"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.2
compiler: ": #GHC 7.10.2"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
- env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.1
compiler: ": #GHC 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
# NOTE(mroberts): I've borrowed this from Yesod's .travis.yml:
#
# https://github.com/yesodweb/yesod/blob/master/.travis.yml
#
- env: BUILD=stack ARGS=""
compiler: ": #stack default"
addons: {apt: {packages: [libgmp-dev]}}
# NOTE(mroberts): I'd like to support 7.8.4, but AMP makes this annoying.
# Take this up later, e.g. with base-compat.
# - env: BUILD=stack ARGS="--resolver lts-2"
# compiler: ": #stack 7.8.4"
# addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-3"
compiler: ": #stack 7.10.2"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-6"
compiler: ": #stack 7.10.3"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-7"
compiler: ": #stack 8.0.1"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-8"
compiler: ": #stack 8.0.2"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-9"
compiler: ": #stack 8.0.2"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-10"
compiler: ": #stack 8.2.2"
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--resolver lts-11"
compiler: ": #stack 8.2.2"
addons: {apt: {packages: [libgmp-dev]}}
before_install:
- unset CC
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$PATH
- mkdir -p ~/.local/bin
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
install:
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- |
set -ex
if [ "$ARGS" = "--resolver nightly" ]
then
stack --install-ghc $ARGS build cabal-install
stack --install-ghc $ARGS solver --update-config
fi
set +ex
script:
- |
set -ex
case "$BUILD" in
stack)
stack --install-ghc --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps --ghc-options="-Wall -Werror -fno-warn-name-shadowing -fno-warn-orphans -fno-warn-unticked-promoted-constructors -fno-warn-unused-do-bind"
;;
cabal)
cabal --version
travis_retry cabal update
sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
cabal install --dependencies-only --enable-tests --enable-benchmarks
cabal configure --enable-tests --enable-benchmarks -v2
cabal build
cabal test
cabal sdist
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
;;
esac
set +ex
after_success:
- script/publish_haddock.sh