1 # from https://docs.haskellstack.org/en/stable/GUIDE/#travis-with-caching
3 # Use new container infrastructure to enable caching
6 # Choose a lightweight base image; we provide our own build tools.
9 # Caching so the next build will be fast too.
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
20 # We set the compiler values here to tell Travis to use a different
21 # cache file per set of arguments.
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]}}
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 HAPPYVER=1.19.5 ALEXVER=3.1.7
31 # compiler: ": #GHC 7.0.4"
32 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
33 #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
34 # compiler: ": #GHC 7.2.2"
35 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
36 #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
37 # compiler: ": #GHC 7.4.2"
38 # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
39 - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
40 compiler: ": #GHC 7.6.3"
41 addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
42 - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
43 compiler: ": #GHC 7.8.4"
44 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
45 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
46 compiler: ": #GHC 7.10.3"
47 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
48 - env: BUILD=cabal GHCVER=8.0.1 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
49 compiler: ": #GHC 8.0.1"
50 addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
52 # Build with the newest GHC and cabal-install. This is an accepted failure,
54 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
55 compiler: ": #GHC HEAD"
56 addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
58 # # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
59 # # variable, such as using --stack-yaml to point to a different file.
60 # - env: BUILD=stack ARGS=""
61 # compiler: ": #stack default"
62 # addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
64 # - env: BUILD=stack ARGS="--resolver lts-2"
65 # compiler: ": #stack 7.8.4"
66 # addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}}
68 # - env: BUILD=stack ARGS="--resolver lts-3"
69 # compiler: ": #stack 7.10.2"
70 # addons: {apt: {packages: [ghc-7.10.2], sources: [hvr-ghc]}}
72 # - env: BUILD=stack ARGS="--resolver lts-6"
73 # compiler: ": #stack 7.10.3"
74 # addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
76 # # Nightly builds are allowed to fail
77 # - env: BUILD=stack ARGS="--resolver nightly"
78 # compiler: ": #stack nightly"
79 # addons: {apt: {packages: [libgmp,libgmp-dev]}}
81 # # Build on OS X in addition to Linux
82 # - env: BUILD=stack ARGS=""
83 # compiler: ": #stack default osx"
86 # - env: BUILD=stack ARGS="--resolver lts-2"
87 # compiler: ": #stack 7.8.4 osx"
90 # - env: BUILD=stack ARGS="--resolver lts-3"
91 # compiler: ": #stack 7.10.2 osx"
94 # - env: BUILD=stack ARGS="--resolver lts-6"
95 # compiler: ": #stack 7.10.3 osx"
98 # - env: BUILD=stack ARGS="--resolver nightly"
99 # compiler: ": #stack nightly osx"
103 - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
104 # - env: BUILD=stack ARGS="--resolver nightly"
107 # Using compiler above sets CC to an invalid value, so unset it
110 # We want to always allow newer versions of packages when building on GHC HEAD
112 - if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
114 # Download and unpack the stack executable
115 - 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
116 - mkdir -p ~/.local/bin
118 if [ `uname` = "Darwin" ]
120 travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
122 travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
125 # Use the more reliable S3 mirror of Hackage
126 mkdir -p $HOME/.cabal
127 echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
128 echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
130 if [ "$CABALVER" != "1.16" ]
132 echo 'jobs: $ncpus' >> $HOME/.cabal/config
135 # Get the list of packages from the stack.yaml file
136 - PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
139 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
140 - if [ -f configure.ac ]; then autoreconf -i; fi
145 stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
149 travis_retry cabal update
150 cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
160 stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
163 cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
169 cabal check || [ "$CABALVER" == "1.16" ]
171 PKGVER=$(cabal info . | awk '{print $2;exit}')
172 SRC_TGZ=$PKGVER.tar.gz
176 cabal configure --enable-tests