|
1 |
| -# This file has been generated -- see https://github.com/hvr/multi-ghc-travis |
| 1 | +# This file has been generated by `make_travis_yml_2.hs` |
| 2 | +# see https://github.com/hvr/multi-ghc-travis for more information |
2 | 3 | language: c
|
3 | 4 | sudo: false
|
4 | 5 |
|
| 6 | +git: |
| 7 | + submodules: false # whether to recursively clone submodules |
| 8 | + |
5 | 9 | cache:
|
6 | 10 | directories:
|
7 |
| - - $HOME/.cabsnap |
8 | 11 | - $HOME/.cabal/packages
|
| 12 | + - $HOME/.cabal/store |
9 | 13 |
|
10 | 14 | before_cache:
|
11 | 15 | - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
|
12 |
| - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar |
| 16 | + # remove files that are regenerated by 'cabal update' |
| 17 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.* |
| 18 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json |
| 19 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache |
| 20 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar |
| 21 | + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx |
13 | 22 |
|
14 | 23 | matrix:
|
15 | 24 | include:
|
16 |
| - - env: CABALVER=1.16 GHCVER=7.0.4 NOTEST=1 |
17 |
| - compiler: ": #GHC 7.0.4" |
18 |
| - addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,zlib1g-dev], sources: [hvr-ghc]}} |
19 |
| - - env: CABALVER=1.16 GHCVER=7.2.2 NOTEST=1 |
20 |
| - compiler: ": #GHC 7.2.2" |
21 |
| - addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,zlib1g-dev], sources: [hvr-ghc]}} |
22 |
| - - env: CABALVER=1.16 GHCVER=7.4.2 |
23 |
| - compiler: ": #GHC 7.4.2" |
24 |
| - addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,zlib1g-dev], sources: [hvr-ghc]}} |
25 |
| - - env: CABALVER=1.16 GHCVER=7.6.3 |
26 |
| - compiler: ": #GHC 7.6.3" |
27 |
| - addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,zlib1g-dev], sources: [hvr-ghc]}} |
28 |
| - - env: CABALVER=1.18 GHCVER=7.8.4 |
29 |
| - compiler: ": #GHC 7.8.4" |
30 |
| - addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,zlib1g-dev], sources: [hvr-ghc]}} |
31 |
| - - env: CABALVER=1.22 GHCVER=7.10.1 |
32 |
| - compiler: ": #GHC 7.10.1" |
33 |
| - addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,zlib1g-dev], sources: [hvr-ghc]}} |
34 |
| - - env: CABALVER=head GHCVER=head NOTEST=1 |
35 |
| - compiler: ": #GHC head" |
36 |
| - addons: {apt: {packages: [cabal-install-head,ghc-head,zlib1g-dev], sources: [hvr-ghc]}} |
37 |
| - - env: CABALVER=head GHCVER=head |
38 |
| - compiler: ": #GHC head" |
| 25 | + - compiler: "ghc-7.0.4" |
| 26 | + env: TEST=--disable-tests |
| 27 | + addons: {apt: {packages: [cabal-install-head,ghc-7.0.4,zlib1g-dev], sources: [hvr-ghc]}} |
| 28 | + - compiler: "ghc-7.2.2" |
| 29 | + env: TEST=--disable-tests |
| 30 | + addons: {apt: {packages: [cabal-install-head,ghc-7.2.2,zlib1g-dev], sources: [hvr-ghc]}} |
| 31 | + - compiler: "ghc-7.4.2" |
| 32 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
| 33 | + addons: {apt: {packages: [cabal-install-head,ghc-7.4.2,zlib1g-dev], sources: [hvr-ghc]}} |
| 34 | + - compiler: "ghc-7.6.3" |
| 35 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
| 36 | + addons: {apt: {packages: [cabal-install-head,ghc-7.6.3,zlib1g-dev], sources: [hvr-ghc]}} |
| 37 | + - compiler: "ghc-7.8.4" |
| 38 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
| 39 | + addons: {apt: {packages: [cabal-install-head,ghc-7.8.4,zlib1g-dev], sources: [hvr-ghc]}} |
| 40 | + - compiler: "ghc-7.10.3" |
| 41 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
| 42 | + addons: {apt: {packages: [cabal-install-head,ghc-7.10.3,zlib1g-dev], sources: [hvr-ghc]}} |
| 43 | + - compiler: "ghc-8.0.1" |
| 44 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
| 45 | + addons: {apt: {packages: [cabal-install-head,ghc-8.0.1,zlib1g-dev], sources: [hvr-ghc]}} |
| 46 | + - compiler: "ghc-8.0.2" |
| 47 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
| 48 | + addons: {apt: {packages: [cabal-install-head,ghc-8.0.2,zlib1g-dev], sources: [hvr-ghc]}} |
| 49 | + - compiler: "ghc-head" |
| 50 | + # env: CABALVER=head TEST=--disable-tests BENCH=--disable-benchmarks |
39 | 51 | addons: {apt: {packages: [cabal-install-head,ghc-head,zlib1g-dev], sources: [hvr-ghc]}}
|
40 | 52 |
|
41 | 53 | allow_failures:
|
42 |
| - - env: CABALVER=head GHCVER=head |
| 54 | + - compiler: "ghc-head" |
43 | 55 |
|
44 | 56 | before_install:
|
| 57 | + - HC=${CC} |
45 | 58 | - unset CC
|
46 |
| - - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH |
47 |
| - - if [ "x$NOTEST" = "x" ]; then export CABFLAGS="--enable-tests"; else export CABFLAGS=""; fi |
| 59 | + - CABALVER=${CABALVER-head} |
| 60 | + - export PATH=/opt/ghc/bin:/opt/cabal/$CABALVER/bin:$PATH |
| 61 | + - PATH2=/opt/ghc/${HC/#ghc-}/bin:$PATH |
48 | 62 |
|
49 | 63 | install:
|
50 | 64 | - cabal --version
|
51 |
| - - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" |
52 |
| - - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; |
53 |
| - then |
54 |
| - zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > |
55 |
| - $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; |
56 |
| - fi |
| 65 | + - BENCH=${BENCH---enable-benchmarks} |
| 66 | + - TEST=${TEST---enable-tests} |
| 67 | + - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" |
57 | 68 | - travis_retry cabal update -v
|
58 | 69 | - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
|
59 |
| - - cabal install --only-dependencies $CABFLAGS --dry -v > installplan.txt |
60 |
| - - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt |
61 |
| - |
62 |
| -# check whether current requested install-plan matches cached package-db snapshot |
63 |
| - - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; |
64 |
| - then |
65 |
| - echo "cabal build-cache HIT"; |
66 |
| - rm -rfv .ghc; |
67 |
| - cp -a $HOME/.cabsnap/ghc $HOME/.ghc; |
68 |
| - cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; |
69 |
| - else |
70 |
| - echo "cabal build-cache MISS"; |
71 |
| - rm -rf $HOME/.cabsnap; |
72 |
| - mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; |
73 |
| - cabal install --only-dependencies $CABFLAGS; |
74 |
| - fi |
75 |
| - |
76 |
| -# snapshot package-db on cache miss |
77 |
| - - if [ ! -d $HOME/.cabsnap ]; |
78 |
| - then |
79 |
| - echo "snapshotting package-db to build-cache"; |
80 |
| - mkdir $HOME/.cabsnap; |
81 |
| - cp -a $HOME/.ghc $HOME/.cabsnap/ghc; |
82 |
| - cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; |
83 |
| - fi |
| 70 | + - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 |
84 | 71 |
|
85 | 72 | # Here starts the actual work to be performed for the package under test;
|
86 | 73 | # any command which exits with a non-zero exit code causes the build to fail.
|
87 | 74 | script:
|
88 | 75 | - if [ -f configure.ac ]; then autoreconf -i; fi
|
89 |
| - - cabal configure $CABFLAGS -v2 # -v2 provides useful information for debugging |
90 |
| - - cabal build # this builds all libraries and executables (including tests/benchmarks) |
91 |
| - - if [ "x$NOTEST" = "x" ]; then cabal test; fi |
92 |
| - - cabal sdist # tests that a source-distribution can be generated |
| 76 | + - SRC_BASENAME=$(PATH=${PATH2} cabal info . | awk '{print $2;exit}') |
| 77 | + # this builds all libraries and executables (including tests/benchmarks) |
| 78 | + - cabal new-build -w ${HC} ${TEST} ${BENCH} |
| 79 | + |
| 80 | + # there's no 'cabal new-test' yet, so let's emulate for now |
| 81 | + - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) ) |
| 82 | + - if [ "$TEST" != "--enable-tests" ]; then TESTS=(); fi |
| 83 | + - shopt -s globstar; |
| 84 | + RC=true; for T in ${TESTS[@]}; do echo "== $T =="; |
| 85 | + if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK ="; |
| 86 | + else echo "= $T FAILED ="; RC=false; fi; done; $RC |
| 87 | + - cabal sdist # test that a source-distribution can be generated |
93 | 88 |
|
94 |
| -# Check that the resulting source distribution can be built & installed. |
95 |
| -# If there are no other `.tar.gz` files in `dist`, this can be even simpler: |
96 |
| -# `cabal install --force-reinstalls dist/*-*.tar.gz` |
97 |
| - - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && |
98 |
| - (cd dist && cabal install --force-reinstalls "$SRC_TGZ") |
| 89 | + # Check that the resulting source distribution can be built w/o and w tests |
| 90 | + - tar -C dist/ -xf dist/$SRC_BASENAME.tar.gz |
| 91 | + - "echo 'packages: .' > dist/$SRC_BASENAME/cabal.project" |
| 92 | + - cd dist/$SRC_BASENAME/ |
| 93 | + - cabal new-build -w ${HC} --disable-tests --disable-benchmarks |
| 94 | + - rm -rf ./dist-newstyle |
| 95 | + - cabal new-build -w ${HC} ${TEST} ${BENCH} |
99 | 96 |
|
100 | 97 | # EOF
|
0 commit comments