git.iko.soy/typeable/pandoc
on mallard help sign in
typeable/pandoc/.travis.yml
125 lines 4.5 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.4.2 CABALVER=1.16
32 compiler: ": #GHC 7.4.2"
33 addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
34 - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16
35 compiler: ": #GHC 7.6.3"
36 addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
37 - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18
38 compiler: ": #GHC 7.8.4"
39 addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
40 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
41 compiler: ": #GHC 7.10.3"
42 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
44 # Build with the newest GHC and cabal-install. This is an accepted failure,
45 # see below.
46 - env: BUILD=cabal GHCVER=head CABALVER=head
47 compiler: ": #GHC HEAD"
48 addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
50 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
51 # variable, such as using --stack-yaml to point to a different file.
52 - env: BUILD=stack ARGS="--resolver lts-5"
53 compiler: ": #stack 7.10.3"
54 addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
56 # Nightly builds are allowed to fail
57 - env: BUILD=stack ARGS="--resolver nightly"
58 compiler: ": #stack nightly"
59 addons: {apt: {packages: [libgmp-dev]}}
61 - env: BUILD=stack ARGS="--resolver lts-5"
62 compiler: ": #stack 7.10.3 osx"
63 os: osx
65 - env: BUILD=stack ARGS="--resolver nightly"
66 compiler: ": #stack nightly osx"
67 os: osx
69 allow_failures:
70 - env: BUILD=cabal GHCVER=head CABALVER=head
71 - env: BUILD=stack ARGS="--resolver nightly"
73before_install:
74# Using compiler above sets CC to an invalid value, so unset it
75- unset CC
77# We want to always allow newer versions of packages when building on GHC HEAD
78- CABALARGS=""
79- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
81# Download and unpack the stack executable
82- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$PATH
83- mkdir -p ~/.local/bin
84- |
85 if [ `uname` = "Darwin" ]
86 then
87 curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
88 else
89 curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
90 fi
92install:
93- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
94- if [ -f configure.ac ]; then autoreconf -i; fi
95- |
96 case "$BUILD" in
97 stack)
98 stack --no-terminal --install-ghc $ARGS test --only-dependencies
99 ;;
100 cabal)
101 cabal --version
102 travis_retry cabal update
103 cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS
104 ;;
105 esac
107script:
108- |
109 case "$BUILD" in
110 stack)
111 stack --no-terminal $ARGS test --haddock --no-haddock-deps --ghc-options="-Wall -fno-warn-unused-do-bind -Werror"
112 ;;
113 cabal)
114 cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror"
115 cabal build
116 cabal check || [ "$CABALVER" == "1.16" ]
117 cabal test
118 cabal copy
119 # cabal sdist fails on cabal 1.16:
120 cabal sdist || [ "$CABALVER" == "1.16" ]
121 SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && \
122 (cd dist && cabal install --enable-tests --force-reinstalls "$SRC_TGZ" || \
123 [ "$CABALVER" == "1.16" ])
124 ;;
125 esac