Skip to content

Commit dfb4140

Browse files
committed
New stack-based travis.yml
1 parent 93693aa commit dfb4140

File tree

1 file changed

+145
-5
lines changed

1 file changed

+145
-5
lines changed

.travis.yml

+145-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,145 @@
1-
language: haskell
2-
ghc:
3-
- 7.4
4-
- 7.6
5-
- 7.8
1+
# New travis config by FPComplete/Michael Snoyman
2+
3+
# Use new container infrastructure to enable caching
4+
sudo: false
5+
6+
# Choose a lightweight base image; we provide our own build tools.
7+
language: c
8+
9+
# Caching so the next build will be fast too.
10+
cache:
11+
directories:
12+
- $HOME/.ghc
13+
- $HOME/.cabal
14+
- $HOME/.stack
15+
16+
# The different configurations we want to test. We have BUILD=cabal which uses
17+
# cabal-install, and BUILD=stack which uses Stack. More documentation on each
18+
# of those below.
19+
#
20+
# We set the compiler values here to tell Travis to use a different
21+
# cache file per set of arguments.
22+
#
23+
# If you need to have different apt packages for each combination in the
24+
# matrix, you can use a line such as:
25+
# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
26+
matrix:
27+
include:
28+
# We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
29+
# https://github.com/hvr/multi-ghc-travis
30+
# - env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16
31+
# compiler: ": #GHC 7.0.4"
32+
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}}
33+
# - env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16
34+
# compiler: ": #GHC 7.2.2"
35+
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2], sources: [hvr-ghc]}}
36+
- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16
37+
compiler: ": #GHC 7.4.2"
38+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
39+
- env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16
40+
compiler: ": #GHC 7.6.3"
41+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
42+
- env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18
43+
compiler: ": #GHC 7.8.4"
44+
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
45+
- env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
46+
compiler: ": #GHC 7.10.3"
47+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
48+
49+
# Build with the newest GHC and cabal-install. This is an accepted failure,
50+
# see below.
51+
- env: BUILD=cabal GHCVER=head CABALVER=head
52+
compiler: ": #GHC HEAD"
53+
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
54+
55+
# The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
56+
# variable, such as using --stack-yaml to point to a different file.
57+
- env: BUILD=stack ARGS="--resolver lts-2"
58+
compiler: ": #stack 7.8.4"
59+
addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}}
60+
61+
- env: BUILD=stack ARGS="--resolver lts-3"
62+
compiler: ": #stack 7.10.2"
63+
addons: {apt: {packages: [ghc-7.10.2], sources: [hvr-ghc]}}
64+
65+
- env: BUILD=stack ARGS="--resolver lts-5"
66+
compiler: ": #stack 7.10.3"
67+
addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
68+
69+
# Nightly builds are allowed to fail
70+
- env: BUILD=stack ARGS="--resolver nightly"
71+
compiler: ": #stack nightly"
72+
addons: {apt: {packages: [libgmp-dev]}}
73+
74+
# Build on OS X in addition to Linux
75+
- env: BUILD=stack ARGS="--resolver lts-2"
76+
compiler: ": #stack 7.8.4 osx"
77+
os: osx
78+
79+
- env: BUILD=stack ARGS="--resolver lts-3"
80+
compiler: ": #stack 7.10.2 osx"
81+
os: osx
82+
83+
- env: BUILD=stack ARGS="--resolver lts-5"
84+
compiler: ": #stack 7.10.3 osx"
85+
os: osx
86+
87+
- env: BUILD=stack ARGS="--resolver nightly"
88+
compiler: ": #stack nightly osx"
89+
os: osx
90+
91+
allow_failures:
92+
- env: BUILD=cabal GHCVER=head CABALVER=head
93+
- env: BUILD=stack ARGS="--resolver nightly"
94+
95+
before_install:
96+
# Using compiler above sets CC to an invalid value, so unset it
97+
- unset CC
98+
99+
# We want to always allow newer versions of packages when building on GHC HEAD
100+
- CABALARGS=""
101+
- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
102+
103+
# Download and unpack the stack executable
104+
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$PATH
105+
- mkdir -p ~/.local/bin
106+
- |
107+
if [ `uname` = "Darwin" ]
108+
then
109+
curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
110+
else
111+
curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
112+
fi
113+
114+
install:
115+
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
116+
- if [ -f configure.ac ]; then autoreconf -i; fi
117+
- |
118+
case "$BUILD" in
119+
stack)
120+
stack --no-terminal --install-ghc $ARGS build --only-dependencies --test
121+
;;
122+
cabal)
123+
cabal --version
124+
travis_retry cabal update
125+
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS
126+
;;
127+
esac
128+
129+
script:
130+
- |
131+
case "$BUILD" in
132+
stack)
133+
stack --no-terminal $ARGS test --haddock --no-haddock-deps
134+
;;
135+
cabal)
136+
cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror"
137+
cabal build
138+
cabal check || [ "$CABALVER" == "1.16" ]
139+
cabal test
140+
cabal sdist
141+
cabal copy
142+
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && \
143+
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
144+
;;
145+
esac

0 commit comments

Comments
 (0)