@@ -1,11 +1,18 @@
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:
6+# https://docs.haskellstack.org/en/stable/travis_ci/
1# Copy these contents into the root directory of your Github project in a file
8# Copy these contents into the root directory of your Github project in a file
2# named .travis.yml
9# named .travis.yml
4# Use new container infrastructure to enable caching
11# Use new container infrastructure to enable caching
5sudo: false
12sudo: false
7−# Choose a lightweight base image; we provide our own build tools.
14+# Do not choose a language; we provide our own build tools.
8−language: c
15+language: generic
10# Caching so the next build will be fast too.
17# Caching so the next build will be fast too.
@@ -28,69 +35,100 @@ matrix:
29 # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
36 # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
30 # https://github.com/hvr/multi-ghc-travis
37 # https://github.com/hvr/multi-ghc-travis
31− - env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16
38+ - env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
32 compiler: ": #GHC 7.0.4"
39 compiler: ": #GHC 7.0.4"
33− addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}}
40+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
34− - env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16
41+ - env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
35 compiler: ": #GHC 7.2.2"
42 compiler: ": #GHC 7.2.2"
36− addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2], sources: [hvr-ghc]}}
43+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
37− - env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16
44+ - env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
38 compiler: ": #GHC 7.4.2"
45 compiler: ": #GHC 7.4.2"
39− addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
46+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
40− - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16
47+ - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
41 compiler: ": #GHC 7.6.3"
48 compiler: ": #GHC 7.6.3"
42− addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
49+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
43− - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18
50+ - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
44 compiler: ": #GHC 7.8.4"
51 compiler: ": #GHC 7.8.4"
45− addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
52+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
46− - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
53+ - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
47 compiler: ": #GHC 7.10.3"
54 compiler: ": #GHC 7.10.3"
48− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
55+ addons: {apt: {packages: [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: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
59+ - env: BUILD=cabal GHCVER=8.2.1 CABALVER=2.0
60+ compiler: ": #GHC 8.2.1"
61+ addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.1], sources: [hvr-ghc]}}
50 # Build with the newest GHC and cabal-install. This is an accepted failure,
63 # Build with the newest GHC and cabal-install. This is an accepted failure,
51 # see below.
64 # see below.
52− - env: BUILD=cabal GHCVER=head CABALVER=head
65+ - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
53 compiler: ": #GHC HEAD"
66 compiler: ": #GHC HEAD"
54− addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
67+ addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
56 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
69 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
57 # variable, such as using --stack-yaml to point to a different file.
70 # variable, such as using --stack-yaml to point to a different file.
71+ - env: BUILD=stack ARGS=""
72+ compiler: ": #stack default"
73+ addons: {apt: {packages: [libgmp-dev]}}
58 - env: BUILD=stack ARGS="--resolver lts-2"
75 - env: BUILD=stack ARGS="--resolver lts-2"
59 compiler: ": #stack 7.8.4"
76 compiler: ": #stack 7.8.4"
60− addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}}
77+ addons: {apt: {packages: [libgmp-dev]}}
62 - env: BUILD=stack ARGS="--resolver lts-3"
79 - env: BUILD=stack ARGS="--resolver lts-3"
63 compiler: ": #stack 7.10.2"
80 compiler: ": #stack 7.10.2"
64− addons: {apt: {packages: [ghc-7.10.2], sources: [hvr-ghc]}}
81+ addons: {apt: {packages: [libgmp-dev]}}
66− - env: BUILD=stack ARGS="--resolver lts-5"
83+ - env: BUILD=stack ARGS="--resolver lts-6"
67 compiler: ": #stack 7.10.3"
84 compiler: ": #stack 7.10.3"
68− addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
85+ addons: {apt: {packages: [libgmp-dev]}}
87+ - env: BUILD=stack ARGS="--resolver lts-7"
88+ compiler: ": #stack 8.0.1"
89+ addons: {apt: {packages: [libgmp-dev]}}
91+ - env: BUILD=stack ARGS="--resolver lts-9"
92+ compiler: ": #stack 8.0.2"
93+ addons: {apt: {packages: [libgmp-dev]}}
70 # Nightly builds are allowed to fail
95 # Nightly builds are allowed to fail
71 - env: BUILD=stack ARGS="--resolver nightly"
96 - env: BUILD=stack ARGS="--resolver nightly"
72 compiler: ": #stack nightly"
97 compiler: ": #stack nightly"
73 addons: {apt: {packages: [libgmp-dev]}}
98 addons: {apt: {packages: [libgmp-dev]}}
75− # Build on OS X in addition to Linux
100+ # Build on macOS in addition to Linux
76− - env: BUILD=stack ARGS="--resolver lts-2"
101+ - env: BUILD=stack ARGS=""
77− compiler: ": #stack 7.8.4 osx"
102+ compiler: ": #stack default osx"
105+ # Travis includes an macOS which is incompatible with GHC 7.8.4
106+ #- env: BUILD=stack ARGS="--resolver lts-2"
107+ # compiler: ": #stack 7.8.4 osx"
80 - env: BUILD=stack ARGS="--resolver lts-3"
110 - env: BUILD=stack ARGS="--resolver lts-3"
81 compiler: ": #stack 7.10.2 osx"
111 compiler: ": #stack 7.10.2 osx"
84− - env: BUILD=stack ARGS="--resolver lts-5"
114+ - env: BUILD=stack ARGS="--resolver lts-6"
85 compiler: ": #stack 7.10.3 osx"
115 compiler: ": #stack 7.10.3 osx"
118+ - env: BUILD=stack ARGS="--resolver lts-7"
119+ compiler: ": #stack 8.0.1 osx"
122+ - env: BUILD=stack ARGS="--resolver lts-9"
123+ compiler: ": #stack 8.0.2 osx"
88 - env: BUILD=stack ARGS="--resolver nightly"
126 - env: BUILD=stack ARGS="--resolver nightly"
89 compiler: ": #stack nightly osx"
127 compiler: ": #stack nightly osx"
92 allow_failures:
130 allow_failures:
93− - env: BUILD=cabal GHCVER=head CABALVER=head
131+ - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
94 - env: BUILD=stack ARGS="--resolver nightly"
132 - env: BUILD=stack ARGS="--resolver nightly"
96before_install:
134before_install:
@@ -102,45 +140,73 @@ before_install:
102- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
140- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
104# Download and unpack the stack executable
142# Download and unpack the stack executable
105−- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$PATH
143+- 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
106- mkdir -p ~/.local/bin
144- mkdir -p ~/.local/bin
108 if [ `uname` = "Darwin" ]
146 if [ `uname` = "Darwin" ]
110− curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
148+ travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
112− curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
150+ travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
153+ # Use the more reliable S3 mirror of Hackage
154+ mkdir -p $HOME/.cabal
155+ echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
156+ echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
158+ if [ "$CABALVER" != "1.16" ]
160+ echo 'jobs: $ncpus' >> $HOME/.cabal/config
116- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
164- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
117- if [ -f configure.ac ]; then autoreconf -i; fi
165- if [ -f configure.ac ]; then autoreconf -i; fi
119 case "$BUILD" in
168 case "$BUILD" in
121− stack --no-terminal --install-ghc $ARGS test --only-dependencies
170+ stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
124 cabal --version
173 cabal --version
125 travis_retry cabal update
174 travis_retry cabal update
176+ # Get the list of packages from the stack.yaml file
177+ PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
126− cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS
179+ cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
132 case "$BUILD" in
187 case "$BUILD" in
134− stack --no-terminal $ARGS test --haddock --no-haddock-deps
189+ stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
137− cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror"
192+ cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
195+ for dir in $PACKAGES
139− cabal check || [ "$CABALVER" == "1.16" ]
198+ cabal check || [ "$CABALVER" == "1.16" ]
141− cabal sdist
199+ cabal sdist
143− SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && \
200+ PKGVER=$(cabal info . | awk '{print $2;exit}')
144− (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
201+ SRC_TGZ=$PKGVER.tar.gz
205+ cabal configure --enable-tests