git.iko.soy/typeable/pandoc
on 2.4 help sign in
typeable/pandoc/.travis.yml
200 lines 6.0 kB history raw
1# This .travis.yml is modified from the sample at
2# https://docs.haskellstack.org/en/stable/GUIDE/#travis-with-caching
4# Use new container infrastructure to enable caching
5sudo: false
7# Do not choose a language; we provide our own build tools.
8language: generic
10# Caching so the next build will be fast too.
11cache:
12 directories:
13 - $HOME/.ghc
14 - $HOME/.cabal
15 - $HOME/.stack
17env:
18 global:
19 - GHC_OPTIONS="-O0 -Werror"
21addons:
22 apt:
23 packages:
24 - happy-1.19.5
25 sources:
26 - hvr-ghc
28# The different configurations we want to test. We have BUILD=cabal which uses
29# cabal-install, and BUILD=stack which uses Stack. More documentation on each
30# of those below.
32# We set the compiler values here to tell Travis to use a different
33# cache file per set of arguments.
35# fast_finish: build successful when every builds not in allow_failure are finished
36# i.e. not waiting any of the allow_failure to finish
37matrix:
38 fast_finish: true
40 include:
41 # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
42 # https://github.com/hvr/multi-ghc-travis
43 # don't build benchmarks for ghc 7.10.3, because build takes too long...
44 - env: >-
45 BUILD=cabal
46 GHCVER=7.10.3
47 CABALVER=2.0
48 FLAGS="fast embed_data_files"
49 CABALARGS=""
50 TESTPATTERN="! /Round trip/"
51 compiler: ": #GHC 7.10.3"
53 # don't build benchmarks for ghc 8.0.2, because build takes too long...
54 - env: >-
55 BUILD=cabal
56 GHCVER=8.0.2
57 CABALVER=2.0
58 FLAGS="fast"
59 CABALARGS=""
60 TESTPATTERN="! /Round trip/"
61 compiler: ": #GHC 8.0.2"
63 - env: >-
64 BUILD=cabal
65 GHCVER=8.2.2
66 CABALVER=2.0
67 FLAGS="fast embed_data_files"
68 CABALARGS="--enable-benchmarks"
69 TESTPATTERN="! /Round trip/"
70 compiler: ": #GHC 8.2.2"
72 - env: >-
73 BUILD=cabal
74 GHCVER=8.4.3
75 CABALVER=2.2
76 FLAGS="fast embed_data_files"
77 CABALARGS="--enable-benchmarks"
78 TESTPATTERN="! /Round trip/"
79 compiler: ": #GHC 8.4.3"
81 - env: >-
82 BUILD=cabal
83 GHCVER=8.6.1
84 CABALVER=2.4
85 FLAGS="fast embed_data_files"
86 CABALARGS="--enable-benchmarks --allow-newer=haddock-library:base"
87 TESTPATTERN="! /Round trip/"
88 compiler: ": #GHC 8.6.1"
90 # Build with the newest GHC and cabal-install. This is an accepted failure,
91 # see below.
92 # - env: BUILD=cabal GHCVER=head CABALVER=head CABALAGS="--allow-newer"
93 # compiler: ": #GHC HEAD"
94 # addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
96 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
97 # variable, such as using --stack-yaml to point to a different file.
98 # - env: BUILD=stack ARGS="--stack-yaml stack.lts9.yaml" FLAGS="fast embed_data_files"
99 # compiler: ": #stack 8.0.2"
100 # addons: {apt: {packages: [ghc-8.0.2], sources: [hvr-ghc]}}
102 - env: >-
103 BUILD=stack
104 ARGS="--resolver lts-12"
105 GHCVER=8.4.3
106 TESTPATTERN="! /Round trip/"
107 compiler: ": #stack 8.4.3"
109 # Nightly builds are allowed to fail
110 - env: >-
111 BUILD=stack
112 ARGS="--resolver nightly"
113 GHCVER=8.4.3
114 TESTPATTERN="."
115 compiler: ": #stack nightly"
117 # - env: BUILD=stack ARGS="--resolver lts-8"
118 # compiler: ": #stack 8.0.2 osx"
119 # os: osx
121 # - env: BUILD=stack ARGS="--resolver nightly"
122 # compiler: ": #stack nightly osx"
123 # os: osx
125 allow_failures:
126 - env: BUILD=cabal GHCVER=head CABALVER=head
127 - env: >-
128 BUILD=stack
129 ARGS="--resolver nightly"
130 GHCVER=8.4.3
131 TESTPATTERN="."
133before_install:
134# Using compiler above sets CC to an invalid value, so unset it
135- unset CC
136- sudo apt-get install ${GHCVER:+ghc-$GHCVER} ${CABALVER:+cabal-install-$CABALVER}
137- export PATH=/opt/happy/1.19.5/bin/:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/cabal/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH
138# Download and unpack the stack executable
139- |
140 if [[ $BUILD == "stack" ]]; then
141 mkdir -p ~/.local/bin
142 if [ `uname` = "Darwin" ]
143 then
144 curl --insecure -L https://www.stackage.org/stack/osx-x86_64 |\
145 tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
146 else
147 curl -L https://www.stackage.org/stack/linux-x86_64 |\
148 tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
149 fi
150 fi
152install:
153- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
154- if [ -f configure.ac ]; then autoreconf -i; fi
155- |
156 case "$BUILD" in
157 stack)
158 ulimit -n 4096
159 stack config set system-ghc --global true
160 stack --no-terminal --install-ghc $ARGS build --only-dependencies --fast \
161 --flag 'pandoc:embed_data_files' --flag 'aeson:fast' --jobs 2
162 ;;
163 cabal)
164 cabal --version
165 travis_retry cabal update
166 case "$GHCVER" in
167 7.10.3)
168 cabal install -v1 --disable-optimization --flags="$FLAGS" \
169 --enable-tests --force-reinstalls --reorder-goals \
170 --max-backjumps=-1 $CABALARGS
171 ;;
172 *)
173 cabal install --disable-optimization --only-dependencies \
174 --flags="$FLAGS" --enable-tests --force-reinstalls \
175 --reorder-goals --max-backjumps=-1 $CABALARGS .
176 ;;
177 esac
178 ;;
179 esac
181script:
182- |
183 case "$BUILD" in
184 stack)
185 ulimit -n 4096
186 stack config set system-ghc --global true
187 stack --no-terminal $ARGS test --fast --flag 'aeson:fast' \
188 --flag pandoc:embed_data_files --haddock --no-haddock-deps \
189 --ghc-options="$GHC_OPTIONS" \
190 --test-arguments="--hide-successes --pattern \"$TESTPATTERN\""
191 ;;
192 cabal)
193 cabal sdist --output-directory=sourcedist && \
194 cd sourcedist && \
195 cabal configure --disable-optimization --enable-tests -v2 \
196 --flags="$FLAGS" --ghc-options="$GHC_OPTIONS" $CABALARGS && \
197 cabal build -v2 -j2 && \
198 cabal test --test-options="--pattern=\"$TESTPATTERN\""
199 ;;
200 esac