1 # Use new container infrastructure to enable caching
4 # Choose a lightweight base image; we provide our own build tools.
7 # Caching so the next build will be fast too.
14 # The different configurations we want to test. We have BUILD=cabal which uses
15 # cabal-install, and BUILD=stack which uses Stack. More documentation on each
18 # We set the compiler values here to tell Travis to use a different
19 # cache file per set of arguments.
21 # If you need to have different apt packages for each combination in the
22 # matrix, you can use a line such as:
23 # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
26 # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
27 # https://github.com/hvr/multi-ghc-travis
28 #- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
29 # compiler: ": #GHC 7.0.4"
30 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
31 #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
32 # compiler: ": #GHC 7.2.2"
33 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
34 #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
35 # compiler: ": #GHC 7.4.2"
36 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
37 - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
38 compiler: ": #GHC 7.6.3"
39 addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
40 - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
41 compiler: ": #GHC 7.8.4"
42 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
43 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
44 compiler: ": #GHC 7.10.3"
45 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
47 # Build with the newest GHC and cabal-install. This is an accepted failure,
49 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
50 compiler: ": #GHC HEAD"
51 addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
53 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
54 # variable, such as using --stack-yaml to point to a different file.
55 - env: BUILD=stack ARGS=""
56 compiler: ": #stack default"
57 addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
59 # - env: BUILD=stack ARGS="--resolver lts-2"
60 # compiler: ": #stack 7.8.4"
61 # addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}}
63 # - env: BUILD=stack ARGS="--resolver lts-3"
64 # compiler: ": #stack 7.10.2"
65 # addons: {apt: {packages: [ghc-7.10.2], sources: [hvr-ghc]}}
67 # - env: BUILD=stack ARGS="--resolver lts-5"
68 # compiler: ": #stack 7.10.3"
69 # addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
71 # Nightly builds are allowed to fail
72 - env: BUILD=stack ARGS="--resolver nightly"
73 compiler: ": #stack nightly"
74 addons: {apt: {packages: [libgmp,libgmp-dev]}}
76 # Build on OS X in addition to Linux
77 - env: BUILD=stack ARGS=""
78 compiler: ": #stack default osx"
81 # - env: BUILD=stack ARGS="--resolver lts-2"
82 # compiler: ": #stack 7.8.4 osx"
85 # - env: BUILD=stack ARGS="--resolver lts-3"
86 # compiler: ": #stack 7.10.2 osx"
89 # - env: BUILD=stack ARGS="--resolver lts-5"
90 # compiler: ": #stack 7.10.3 osx"
93 - env: BUILD=stack ARGS="--resolver nightly"
94 compiler: ": #stack nightly osx"
98 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
99 - env: BUILD=stack ARGS="--resolver nightly"
102 # Using compiler above sets CC to an invalid value, so unset it
105 # We want to always allow newer versions of packages when building on GHC HEAD
107 - if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
109 # Download and unpack the stack executable
110 - 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
111 - mkdir -p ~/.local/bin
113 if [ `uname` = "Darwin" ]
115 travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
117 travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
120 # Use the more reliable S3 mirror of Hackage
121 mkdir -p $HOME/.cabal
122 echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
123 echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
125 if [ "$CABALVER" != "1.16" ]
127 echo 'jobs: $ncpus' >> $HOME/.cabal/config
130 # Get the list of packages from the stack.yaml file
131 - PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
134 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
135 - if [ -f configure.ac ]; then autoreconf -i; fi
140 stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
144 travis_retry cabal update
145 cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
155 stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
158 cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
164 cabal check || [ "$CABALVER" == "1.16" ]
166 SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && \
167 (cd dist && cabal install --force-reinstalls "$SRC_TGZ")