|
7 | 7 | # sane build environment. In CI, we want to make our life more difficult, so we |
8 | 8 | # use cabal without any Stackage snapshots. |
9 | 9 | # |
| 10 | +language: c |
10 | 11 | sudo: false |
11 | 12 |
|
12 | 13 | cache: |
13 | 14 | directories: |
14 | 15 | - $HOME/.ghc |
15 | 16 | - $HOME/.cabal |
| 17 | + - $HOME/.stack |
16 | 18 |
|
17 | | -addons: |
18 | | - apt: |
19 | | - sources: |
20 | | - - hvr-ghc |
21 | | - packages: |
22 | | - - cabal-install-1.18 |
23 | | - - cabal-install-1.22 |
24 | | - - cabal-install-head |
25 | | - - ghc-7.8.4 |
26 | | - - ghc-7.10.1 |
27 | | - - ghc-7.10.2 |
28 | | - - ghc-head |
| 19 | +matrix: |
| 20 | + include: |
| 21 | + - env: BUILD=cabal CABALVER=1.18 GHCVER=7.8.4 |
| 22 | + compiler: ": #GHC 7.8.4" |
| 23 | + addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}} |
29 | 24 |
|
30 | | -env: |
31 | | - - CABALVER=1.18 GHCVER=7.8.4 |
32 | | - - CABALVER=1.22 GHCVER=7.10.1 |
33 | | - - CABALVER=1.22 GHCVER=7.10.2 |
34 | | - - CABALVER=head GHCVER=head # see section about GHC HEAD snapshots |
| 25 | + - env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.1 |
| 26 | + compiler: ": #GHC 7.10.1" |
| 27 | + addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}} |
| 28 | + |
| 29 | + - env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.2 |
| 30 | + compiler: ": #GHC 7.10.2" |
| 31 | + addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}} |
| 32 | + |
| 33 | + - env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3 |
| 34 | + compiler: ": #GHC 7.10.3" |
| 35 | + addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}} |
| 36 | + |
| 37 | + - env: BUILD=stack GHCVER=7.8.4 STACK_YAML=stack-7.8.yaml |
| 38 | + compiler: ": #stack 7.8.4" |
| 39 | + addons: {apt: {packages: [cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}} |
| 40 | + |
| 41 | + - env: BUILD=stack GHCVER=7.10.2 STACK_YAML=stack.yaml |
| 42 | + compiler: ": #stack 7.10.2" |
| 43 | + addons: {apt: {packages: [cabal-install-head,ghc-7.10.2], sources: [hvr-ghc]}} |
| 44 | + |
| 45 | + - env: BUILD=cabal CABALVER=head GHCVER=head |
| 46 | + compiler: ": #GHC head" |
| 47 | + addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} |
| 48 | + |
| 49 | + - env: BUILD=stack STACK_YAML=stack.yaml |
| 50 | + compiler: ": #stack 7.10.2 osx" |
| 51 | + os: osx |
35 | 52 |
|
36 | | -matrix: |
37 | 53 | allow_failures: |
38 | | - - env: CABALVER=head GHCVER=head |
| 54 | + - env: BUILD=cabal CABALVER=head GHCVER=head |
39 | 55 |
|
40 | 56 | # Note: the distinction between `before_install` and `install` is not important. |
| 57 | +# - in before_install we install build tools |
| 58 | +# - in install we install (haskell) dependencies |
41 | 59 | before_install: |
42 | | - - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH |
| 60 | + - unset CC |
| 61 | + - case "$BUILD" in |
| 62 | + stack) |
| 63 | + export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:$PATH;; |
| 64 | + cabal) |
| 65 | + export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH;; |
| 66 | + esac |
43 | 67 | - ./.travis-setup.sh |
44 | 68 |
|
45 | 69 | install: |
46 | | - - cabal --version |
47 | 70 | - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" |
48 | | - - travis_retry cabal update |
49 | | - - cabal install --only-dependencies --constraint="ignore +without-pcre" --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 |
| 71 | + - case "$BUILD" in |
| 72 | + stack) |
| 73 | + stack --no-terminal test --only-dependencies;; |
| 74 | + cabal) |
| 75 | + cabal --version; |
| 76 | + travis_retry cabal update; |
| 77 | + cabal install --only-dependencies --constraint="ignore +without-pcre" --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0;; |
| 78 | + esac |
50 | 79 |
|
51 | 80 | script: |
52 | | - - if [ -f configure.ac ]; then autoreconf -i; fi |
53 | | - - cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror" # -v2 provides useful information for debugging |
54 | | - - cabal build # this builds all libraries and executables (including tests/benchmarks) |
55 | | - - cabal test |
56 | | - - cabal check |
57 | | - - cabal sdist # tests that a source-distribution can be generated |
58 | | - |
59 | | - - cabal copy |
60 | | - - cd test/integration |
61 | | - # Takes too long for now |
62 | | - # - stack setup |
63 | | - # - stack test |
64 | | - - cd ../.. |
65 | | - |
66 | | -# Check that the resulting source distribution can be built & installed. |
67 | | -# If there are no other `.tar.gz` files in `dist`, this can be even simpler: |
68 | | -# `cabal install --force-reinstalls dist/*-*.tar.gz` |
69 | | - - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && |
70 | | - (cd dist && cabal install --force-reinstalls "$SRC_TGZ") |
| 81 | + - case "$BUILD" in |
| 82 | + stack) |
| 83 | + stack --no-terminal test;; |
| 84 | + cabal) |
| 85 | + cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror"; |
| 86 | + cabal build; |
| 87 | + cabal test; |
| 88 | + cabal check; |
| 89 | + cabal sdist; |
| 90 | + cabal copy; |
| 91 | + cd test/integration; |
| 92 | + true stack setup; |
| 93 | + true stack test; |
| 94 | + cd ../..; |
| 95 | + SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && |
| 96 | + (cd dist && cabal install --force-reinstalls "$SRC_TGZ");; |
| 97 | + esac |
0 commit comments