@@ -1,11 +1,12 @@
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
23language: c
34sudo: false
45
56cache:
67 directories:
7− - $HOME/.cabsnap
88 - $HOME/.cabal/packages
9+ - $HOME/.cabal/store
910
1011before_cache:
1112 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
@@ -13,15 +14,15 @@ before_cache:
1314
1415matrix:
1516 include:
16− - env: CABALVER=1.22 GHCVER=7.10.1
17+ - env: CABALVER=1.24 GHCVER=7.10.1
1718 compiler: ": #GHC 7.10.1"
18− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
19− - env: CABALVER=1.22 GHCVER=7.10.2
19+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.1], sources: [hvr-ghc]}}
20+ - env: CABALVER=1.24 GHCVER=7.10.2
2021 compiler: ": #GHC 7.10.2"
21− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
22− - env: CABALVER=1.22 GHCVER=7.10.3
22+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.2], sources: [hvr-ghc]}}
23+ - env: CABALVER=1.24 GHCVER=7.10.3
2324 compiler: ": #GHC 7.10.3"
24− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
25+ addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3], sources: [hvr-ghc]}}
2526 - env: CABALVER=1.24 GHCVER=8.0.1
2627 compiler: ": #GHC 8.0.1"
2728 addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
@@ -32,6 +33,8 @@ before_install:
3233
3334install:
3435 - cabal --version
36+ - BENCH=${BENCH---enable-benchmarks}
37+ - TEST=${TEST---enable-tests}
3538 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
3639 - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
3740 then
@@ -40,46 +43,29 @@ install:
4043 fi
4144 - travis_retry cabal update -v
4245 - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
43− - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
44− - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
45−
46−# check whether current requested install-plan matches cached package-db snapshot
47− - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
48− then
49− echo "cabal build-cache HIT";
50− rm -rfv .ghc;
51− cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
52− cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
53− else
54− echo "cabal build-cache MISS";
55− rm -rf $HOME/.cabsnap;
56− mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
57− cabal install --only-dependencies --enable-tests --enable-benchmarks;
58− fi
59−
60−# snapshot package-db on cache miss
61− - if [ ! -d $HOME/.cabsnap ];
62− then
63− echo "snapshotting package-db to build-cache";
64− mkdir $HOME/.cabsnap;
65− cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
66− cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
67− fi
46+ - cabal new-build ${TEST} ${BENCH} --dep
6847
6948# Here starts the actual work to be performed for the package under test;
7049# any command which exits with a non-zero exit code causes the build to fail.
7150script:
7251 - if [ -f configure.ac ]; then autoreconf -i; fi
73− - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
74− - cabal build # this builds all libraries and executables (including tests/benchmarks)
75− - cabal test
76− - cabal check
77− - cabal sdist # tests that a source-distribution can be generated
52+ # this builds all libraries and executables (including tests/benchmarks)
53+ - cabal new-build ${TEST} ${BENCH} -v2 # -v2 provides useful information for debugging
54+
55+ # there's no 'cabal new-test' yet, so let's emulate for now
56+ - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) );
57+ RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
58+ if dist-newstyle/build/*/build/$T/$T; then echo "= $T OK =";
59+ else echo "= $T FAILED ="; RC=false; fi; done; $RC
60+ - cabal sdist # test that a source-distribution can be generated
7861
79−# Check that the resulting source distribution can be built & installed.
80−# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
81−# `cabal install --force-reinstalls dist/*-*.tar.gz`
82− - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
83− (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
62+ # Check that the resulting source distribution can be built w/o and w tests
63+ - SRC_BASENAME=$(cabal info . | awk '{print $2;exit}')
64+ - tar -C dist/ -xf dist/$SRC_BASENAME.tar.gz
65+ - "echo 'packages: *.cabal' > dist/$SRC_BASENAME/cabal.project"
66+ - cd dist/$SRC_BASENAME/
67+ - cabal new-build --disable-tests --disable-benchmarks
68+ - rm -rf ./dist-newstyle
69+ - cabal new-build ${TEST} ${BENCH}
8470
8571# EOF