on wai-handler-launch-3.0.2.4 help sign in
typeable/wai/.travis.yml
215 lines 7.3 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 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
37 compiler: ": #GHC 7.10.3"
38 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
39 - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
40 compiler: ": #GHC 8.0.2"
41 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
42 - env: BUILD=cabal GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
43 compiler: ": #GHC 8.2.2"
44 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
46 # Build with the newest GHC and cabal-install. This is an accepted failure,
47 # see below.
48 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
49 compiler: ": #GHC HEAD"
50 addons: {apt: {packages: [libfcgi-dev,cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
52 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
53 # variable, such as using --stack-yaml to point to a different file.
54 #- env: BUILD=stack ARGS=""
55 # compiler: ": #stack default"
56 # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
58 #- env: BUILD=stack ARGS="--resolver lts-2"
59 # compiler: ": #stack 7.8.4"
60 # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
62 #- env: BUILD=stack ARGS="--resolver lts-3"
63 # compiler: ": #stack 7.10.2"
64 # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
66 - env: BUILD=stack ARGS="--resolver lts-6"
67 compiler: ": #stack 7.10.3"
68 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
70 #- env: BUILD=stack ARGS="--resolver lts-7"
71 # compiler: ": #stack 8.0.1"
72 # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
74 - env: BUILD=stack ARGS="--resolver lts-9"
75 compiler: ": #stack 8.0.2"
76 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
78 - env: BUILD=stack ARGS="--resolver lts-10"
79 compiler: ": #stack 8.2.2"
80 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
82 # Nightly builds are allowed to fail
83 - env: BUILD=stack ARGS="--resolver nightly"
84 compiler: ": #stack nightly"
85 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
87 # Build on OS X in addition to Linux
88 #- env: BUILD=stack ARGS=""
89 # compiler: ": #stack default osx"
90 # os: osx
92 # Travis includes an OS X which is incompatible with GHC 7.8.4
93 #- env: BUILD=stack ARGS="--resolver lts-2"
94 # compiler: ": #stack 7.8.4 osx"
95 # os: osx
97 #- env: BUILD=stack ARGS="--resolver lts-3"
98 # compiler: ": #stack 7.10.2 osx"
99 # os: osx
101 - env: BUILD=stack ARGS="--resolver lts-6"
102 compiler: ": #stack 7.10.3 osx"
103 os: osx
105 #- env: BUILD=stack ARGS="--resolver lts-7"
106 # compiler: ": #stack 8.0.1 osx"
107 # os: osx
109 - env: BUILD=stack ARGS="--resolver lts-9"
110 compiler: ": #stack 8.0.2 osx"
111 os: osx
113 - env: BUILD=stack ARGS="--resolver lts-10"
114 compiler: ": #stack 8.2.2 osx"
115 os: osx
117 - env: BUILD=stack ARGS="--resolver nightly"
118 compiler: ": #stack nightly osx"
119 os: osx
121 allow_failures:
122 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
123 - env: BUILD=stack ARGS="--resolver nightly"
125before_install:
126# Using compiler above sets CC to an invalid value, so unset it
127- unset CC
129# We want to always allow newer versions of packages when building on GHC HEAD
130- CABALARGS=""
131- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
133# Download and unpack the stack executable
134- 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
135- mkdir -p ~/.local/bin
136- |
137 if [ `uname` = "Darwin" ]
138 then
139 travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
141 # brew no longer has fcgi
142 # brew install fcgi
143 grep -v wai-handler-fastcgi < stack.yaml > tmp
144 mv tmp stack.yaml
145 else
146 travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
147 fi
149 # Use the more reliable S3 mirror of Hackage
150 mkdir -p $HOME/.cabal
151 echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
152 echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
154 if [ "$CABALVER" != "1.16" ]
155 then
156 echo 'jobs: $ncpus' >> $HOME/.cabal/config
157 fi
159install:
160- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
161- if [ -f configure.ac ]; then autoreconf -i; fi
162- |
163 set -ex
164 case "$BUILD" in
165 stack)
166 # Avoid out of memory condition
167 stack --no-terminal --install-ghc $ARGS build Cabal
169 stack --no-terminal --install-ghc $ARGS test --only-dependencies
170 ;;
171 cabal)
172 cabal --version
173 travis_retry cabal update
175 # Get the list of packages from the stack.yaml file
176 PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
178 # Due to dependency on wai-logger (which depends on some packages here),
179 # we can't build just dependencies
180 #
181 # cabal install --only-dependencies --enable-tests --force-reinstalls --ghc-options=-O0 --max-backjumps=-1 $CABALARGS $PACKAGES
182 cabal install hspec-discover
183 ;;
184 esac
185 set +ex
187script:
188- |
189 set -ex
190 case "$BUILD" in
191 stack)
192 stack --no-terminal $ARGS test --haddock --no-haddock-deps
193 ;;
194 cabal)
195 cabal install --enable-tests --force-reinstalls --ghc-options=-O0 --max-backjumps=-1 $CABALARGS $PACKAGES
197 ORIGDIR=$(pwd)
198 for dir in $PACKAGES
199 do
200 cd $dir
201 cabal check || [ "$CABALVER" == "1.16" ]
202 # Takes too long, see https://github.com/yesodweb/wai/issues/665
203 #cabal sdist
204 #PKGVER=$(cabal info . | awk '{print $2;exit}')
205 #SRC_TGZ=$PKGVER.tar.gz
206 #cd dist
207 #tar zxfv "$SRC_TGZ"
208 #cd "$PKGVER"
209 #cabal configure --enable-tests
210 #cabal build
211 cd $ORIGDIR
212 done
213 ;;
214 esac
215 set +ex