on wai-extra/3.0.20.0 help sign in
typeable/wai/.travis.yml
219 lines 8.1 kB history raw
1# This is the complex Travis configuration, which is intended for use
2# on open source libraries which need compatibility across multiple GHC
3# versions, must work with cabal-install, and should be
4# cross-platform. For more information and other options, see:
5#
6# https://docs.haskellstack.org/en/stable/travis_ci/
7#
8# Copy these contents into the root directory of your Github project in a file
9# named .travis.yml
11# Use new container infrastructure to enable caching
12sudo: false
14# Choose a lightweight base image; we provide our own build tools.
15language: c
17# Caching so the next build will be fast too.
18cache:
19 directories:
20 - $HOME/.ghc
21 - $HOME/.cabal
22 - $HOME/.stack
24# The different configurations we want to test. We have BUILD=cabal which uses
25# cabal-install, and BUILD=stack which uses Stack. More documentation on each
26# of those below.
28# We set the compiler values here to tell Travis to use a different
29# cache file per set of arguments.
31# If you need to have different apt packages for each combination in the
32# matrix, you can use a line such as:
33# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
34matrix:
35 include:
36 # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
37 # https://github.com/hvr/multi-ghc-travis
38 #- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
39 # compiler: ": #GHC 7.0.4"
40 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
41 #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
42 # compiler: ": #GHC 7.2.2"
43 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
44 #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
45 # compiler: ": #GHC 7.4.2"
46 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
47 - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
48 compiler: ": #GHC 7.6.3"
49 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.24,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
50 - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
51 compiler: ": #GHC 7.8.4"
52 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
53 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
54 compiler: ": #GHC 7.10.3"
55 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
56 - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
57 compiler: ": #GHC 8.0.2"
58 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
60 # Build with the newest GHC and cabal-install. This is an accepted failure,
61 # see below.
62 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
63 compiler: ": #GHC HEAD"
64 addons: {apt: {packages: [libfcgi-dev,cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
66 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
67 # variable, such as using --stack-yaml to point to a different file.
68 - env: BUILD=stack ARGS=""
69 compiler: ": #stack default"
70 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
72 #- env: BUILD=stack ARGS="--resolver lts-2"
73 # compiler: ": #stack 7.8.4"
74 # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
76 - env: BUILD=stack ARGS="--resolver lts-3"
77 compiler: ": #stack 7.10.2"
78 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
80 - env: BUILD=stack ARGS="--resolver lts-6"
81 compiler: ": #stack 7.10.3"
82 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
84 - env: BUILD=stack ARGS="--resolver lts-7"
85 compiler: ": #stack 8.0.1"
86 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
88 - env: BUILD=stack ARGS="--resolver lts-8"
89 compiler: ": #stack 8.0.2"
90 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
92 # Nightly builds are allowed to fail
93 - env: BUILD=stack ARGS="--resolver nightly"
94 compiler: ": #stack nightly"
95 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
97 # Build on OS X in addition to Linux
98 - env: BUILD=stack ARGS=""
99 compiler: ": #stack default osx"
100 os: osx
102 # Travis includes an OS X which is incompatible with GHC 7.8.4
103 #- env: BUILD=stack ARGS="--resolver lts-2"
104 # compiler: ": #stack 7.8.4 osx"
105 # os: osx
107 - env: BUILD=stack ARGS="--resolver lts-3"
108 compiler: ": #stack 7.10.2 osx"
109 os: osx
111 - env: BUILD=stack ARGS="--resolver lts-6"
112 compiler: ": #stack 7.10.3 osx"
113 os: osx
115 - env: BUILD=stack ARGS="--resolver lts-7"
116 compiler: ": #stack 8.0.1 osx"
117 os: osx
119 - env: BUILD=stack ARGS="--resolver lts-8"
120 compiler: ": #stack 8.0.2 osx"
121 os: osx
123 - env: BUILD=stack ARGS="--resolver nightly"
124 compiler: ": #stack nightly osx"
125 os: osx
127 allow_failures:
128 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
129 - env: BUILD=stack ARGS="--resolver nightly"
131before_install:
132# Using compiler above sets CC to an invalid value, so unset it
133- unset CC
135# We want to always allow newer versions of packages when building on GHC HEAD
136- CABALARGS=""
137- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
138# Due to https://github.com/haskell/cabal/issues/3453, we don't build benchmarks on GHC 7.6.3
139- if [ "x$GHCVER" != "x7.6.3" ]; then CABALARGS="$CABALARGS --enable-benchmarks"; fi
141# Download and unpack the stack executable
142- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH
143- mkdir -p ~/.local/bin
144- |
145 if [ `uname` = "Darwin" ]
146 then
147 travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
149 # brew no longer has fcgi
150 # brew install fcgi
151 grep -v wai-handler-fastcgi < stack.yaml > tmp
152 mv tmp stack.yaml
153 else
154 travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
155 fi
157 # Use the more reliable S3 mirror of Hackage
158 mkdir -p $HOME/.cabal
159 echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
160 echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
162 if [ "$CABALVER" != "1.16" ]
163 then
164 echo 'jobs: $ncpus' >> $HOME/.cabal/config
165 fi
167install:
168- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
169- if [ -f configure.ac ]; then autoreconf -i; fi
170- |
171 set -ex
172 case "$BUILD" in
173 stack)
174 stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
175 ;;
176 cabal)
177 cabal --version
178 travis_retry cabal update
180 # Get the list of packages from the stack.yaml file
181 PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
183 # Due to dependency on wai-logger (which depends on some packages here),
184 # we can't build just dependencies
185 #
186 # cabal install --only-dependencies --enable-tests --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
187 cabal install hspec-discover
188 ;;
189 esac
190 set +ex
192script:
193- |
194 set -ex
195 case "$BUILD" in
196 stack)
197 stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
198 ;;
199 cabal)
200 cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
202 ORIGDIR=$(pwd)
203 for dir in $PACKAGES
204 do
205 cd $dir
206 cabal check || [ "$CABALVER" == "1.16" ]
207 cabal sdist
208 PKGVER=$(cabal info . | awk '{print $2;exit}')
209 SRC_TGZ=$PKGVER.tar.gz
210 cd dist
211 tar zxfv "$SRC_TGZ"
212 cd "$PKGVER"
213 cabal configure --enable-tests
214 cabal build
215 cd $ORIGDIR
216 done
217 ;;
218 esac
219 set +ex