forked from composewell/packcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
153 lines (122 loc) · 6.1 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# See https://github.com/harendra-kumar/packcheck for all parameters and their
# explanation.
env:
global:
- PACKCHECK="./packcheck.sh"
# The commit id of packcheck.sh to use from
# https://github.com/harendra-kumar/packcheck. Used only when the script
# does not exist in the package repo at the path specified by "PACKCHECK"
- PACKCHECK_COMMIT="e90061743c0a074029eaffa13073a61942267b57"
- GHC_OPTIONS="-Werror"
# ------------------------------------------------------------------------
# Builds that need stack
# ------------------------------------------------------------------------
- STACKVER="1.6.3"
- STACK_UPGRADE="y"
# ------------------------------------------------------------------------
# Common parameters: Normally you would not need to customize these params
# ------------------------------------------------------------------------
- CABAL_REINIT_CONFIG=y
- CABAL_CHECK_RELAX=y
- CABAL_NO_SANDBOX=y
- CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com
- TEST_INSTALL=y
- PATH=/bin:/usr/bin
- LC_ALL=C.UTF-8
notifications:
email: false
# This matrix has total 11 builds enabled, 4 builds each (3 last major compiler
# versions and head) for stack and cabal, 2 OSX builds (stack and cabal for
# latest compiler version), and one hlint build. You may want to comment out
# some of the builds to be lighter on the CI infrastructure.
#
# We pre-install the cabal-install package to not incur the penalty of building
# it the first time in cached builds or every time in uncached builds.
matrix:
include:
# --------------------------------------------------------------------------
# (Linux) stack builds
# --------------------------------------------------------------------------
- env: BUILD=stack CABALVER=1.22 GHCVER=7.10.3 RESOLVER=lts-6
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
- env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 RESOLVER=lts-9
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
- env: BUILD=stack CABALVER=2.0 GHCVER=8.2.2 RESOLVER=lts-10
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
# Nightly
- env: BUILD=stack RESOLVER=nightly
# Using a custom stack-yaml config file.
#- env: BUILD=stack STACK_YAML=.ci/stack-8.0.yaml
# You can customize a stack build even without a custom stack-yaml
# using STACK_OPTIONS, STACK_BUILD_OPTIONS, GHC_OPTIONS etc.
#- env: BUILD=stack RESOLVER=lts-10.0 STACK_BUILD_OPTIONS="--flag packcheck:dev"
# --------------------------------------------------------------------------
# (Linux) cabal builds require pre-installed cabal-install and ghc
# --------------------------------------------------------------------------
- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
- env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.2
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
- env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
- env: BUILD=cabal CABALVER=head GHCVER=head
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
# --------------------------------------------------------------------------
# OS X builds
# --------------------------------------------------------------------------
# GHC 8.2.2/cabal build via stack
- env: BUILD=cabal RESOLVER=lts-10
os: osx
# GHC 8.2.2/stack
- env: BUILD=stack RESOLVER=lts-10
os: osx
# --------------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------------
- env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
# --------------------------------------------------------------------------
# Build and send coverage report to coveralls.io using hpc-coveralls
# --------------------------------------------------------------------------
# Note COVERALLS (hpc-coveralls) works only with cabal build.
# For this to succeed you have to add your porject to coveralls.io first
#- env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
# addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
# --------------------------------------------------------------------------
# Builds that are allowed to fail
# --------------------------------------------------------------------------
allow_failures:
- env: BUILD=stack RESOLVER=nightly
- env: BUILD=cabal CABALVER=head GHCVER=head
- env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
# ------------------------------------------------------------------------
# Settings beyond this point are advanced and normally not tweaked
# ------------------------------------------------------------------------
language: generic
sudo: false
cache:
directories:
- $HOME/.cabal
- $HOME/.ghc
- $HOME/.local
- $HOME/.stack
install: true
script:
- |
# When GHCVER or CABALVER env variables are specified, modify the path to
# find the binaries installed from hvr-ghc repo
add_path() { eval "test -n \"\$$1\"" && eval "PATH=/opt/$2/\"\$$1\"/bin:$PATH"; true; }
# Emit the value of the var specified as arg only when the build is cabal
cabal_env() { test "$BUILD" = cabal && echo $1; }
# If a custom stack-yaml is specified, replace the default with that
if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
unset STACK_YAML
# Get packcheck if needed
CURL=$(which curl)
PACKCHECK_URL=https://raw.githubusercontent.com/harendra-kumar/packcheck/${PACKCHECK_COMMIT}/packcheck.sh
if test ! -e "$PACKCHECK"; then $CURL -sL -o "$PACKCHECK" $PACKCHECK_URL; fi;
chmod +x $PACKCHECK
add_path GHCVER ghc
add_path CABALVER cabal
# In addition to PACKCHECK envvars hpc-coveralls needs TRAVIS,
# TRAVIS_JOB_ID variables set by the travis CI environment.
- bash -c "$PACKCHECK $BUILD"