on wai-extra/3.0.16.0 help sign in
typeable/wai/.travis.yml
182 lines 6.4 kB history raw
1# Copy these contents into the root directory of your Github project in a file
2# named .travis.yml
4# Use new container infrastructure to enable caching
5sudo: false
7# Choose a lightweight base image; we provide our own build tools.
8language: c
10# Caching so the next build will be fast too.
11cache:
12 directories:
13 - $HOME/.ghc
14 - $HOME/.cabal
15 - $HOME/.stack
17# The different configurations we want to test. We have BUILD=cabal which uses
18# cabal-install, and BUILD=stack which uses Stack. More documentation on each
19# of those below.
21# We set the compiler values here to tell Travis to use a different
22# cache file per set of arguments.
24# If you need to have different apt packages for each combination in the
25# matrix, you can use a line such as:
26# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
27matrix:
28 include:
29 # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
30 # https://github.com/hvr/multi-ghc-travis
31 - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
32 compiler: ": #GHC 7.6.3"
33 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.22,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
34 - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
35 compiler: ": #GHC 7.8.4"
36 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
37 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
38 compiler: ": #GHC 7.10.3"
39 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
41 # Build with the newest GHC and cabal-install. This is an accepted failure,
42 # see below.
43 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
44 compiler: ": #GHC HEAD"
45 addons: {apt: {packages: [libfcgi-dev,cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
47 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
48 # variable, such as using --stack-yaml to point to a different file.
49 - env: BUILD=stack ARGS=""
50 compiler: ": #stack default"
51 addons: {apt: {packages: [libfcgi-dev,ghc-7.10.3], sources: [hvr-ghc]}}
53 #- env: BUILD=stack ARGS="--resolver lts-2"
54 # compiler: ": #stack 7.8.4"
55 # addons: {apt: {packages: [libfcgi-dev,ghc-7.8.4], sources: [hvr-ghc]}}
57 - env: BUILD=stack ARGS="--resolver lts-3"
58 compiler: ": #stack 7.10.2"
59 addons: {apt: {packages: [libfcgi-dev,ghc-7.10.2], sources: [hvr-ghc]}}
61 - env: BUILD=stack ARGS="--resolver lts-5"
62 compiler: ": #stack 7.10.3"
63 addons: {apt: {packages: [libfcgi-dev,ghc-7.10.3], sources: [hvr-ghc]}}
65 # Nightly builds are allowed to fail
66 - env: BUILD=stack ARGS="--resolver nightly"
67 compiler: ": #stack nightly"
68 addons: {apt: {packages: [libfcgi-dev,libgmp,libgmp-dev]}}
70 # Build on OS X in addition to Linux
71 - env: BUILD=stack ARGS=""
72 compiler: ": #stack default osx"
73 os: osx
75 #- env: BUILD=stack ARGS="--resolver lts-2"
76 # compiler: ": #stack 7.8.4 osx"
77 # os: osx
79 - env: BUILD=stack ARGS="--resolver lts-3"
80 compiler: ": #stack 7.10.2 osx"
81 os: osx
83 - env: BUILD=stack ARGS="--resolver lts-5"
84 compiler: ": #stack 7.10.3 osx"
85 os: osx
87 - env: BUILD=stack ARGS="--resolver nightly"
88 compiler: ": #stack nightly osx"
89 os: osx
91 allow_failures:
92 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
93 - env: BUILD=stack ARGS="--resolver nightly"
95before_install:
96# Using compiler above sets CC to an invalid value, so unset it
97- unset CC
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# Due to https://github.com/haskell/cabal/issues/3453, we don't build benchmarks on GHC 7.6.3
103- if [ "x$GHCVER" != "x7.6.3" ]; then CABALARGS="$CABALARGS --enable-benchmarks"; fi
105# Download and unpack the stack executable
106- 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
107- mkdir -p ~/.local/bin
108- |
109 if [ `uname` = "Darwin" ]
110 then
111 travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
113 # brew no longer has fcgi
114 # brew install fcgi
115 grep -v wai-handler-fastcgi < stack.yaml > tmp
116 mv tmp stack.yaml
117 else
118 travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
119 fi
121 # Use the more reliable S3 mirror of Hackage
122 mkdir -p $HOME/.cabal
123 echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
124 echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
126 if [ "$CABALVER" != "1.16" ]
127 then
128 echo 'jobs: $ncpus' >> $HOME/.cabal/config
129 fi
131# Get the list of packages from the stack.yaml file
132- PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
134install:
135- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
136- if [ -f configure.ac ]; then autoreconf -i; fi
137- |
138 set -ex
139 case "$BUILD" in
140 stack)
141 stack --no-terminal --install-ghc $ARGS test --only-dependencies
142 ;;
143 cabal)
144 cabal --version
145 travis_retry cabal update
147 # Due to dependency on wai-logger (which depends on some packages here),
148 # we can't build just dependencies
149 #
150 # cabal install --only-dependencies --enable-tests --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
151 cabal install hspec-discover
152 ;;
153 esac
154 set +ex
156script:
157- |
158 set -ex
159 case "$BUILD" in
160 stack)
161 stack --no-terminal $ARGS test --haddock --no-haddock-deps
162 ;;
163 cabal)
164 cabal install --enable-tests --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
166 ORIGDIR=$(pwd)
167 for dir in $PACKAGES
168 do
169 cd $dir
170 cabal check || [ "$CABALVER" == "1.16" ]
171 cabal sdist
172 NAMEVER=$(cabal info . | awk '{print $2;exit}')
173 SRC_TGZ=dist/$NAMEVER.tar.gz
174 tar zxf $SRC_TGZ
175 cd $NAMEVER
176 cabal configure --enable-tests
177 cabal build
178 cd $ORIGDIR
179 done
180 ;;
181 esac
182 set +ex