@@ -1,84 +1,104 @@
1−# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
1+# This Travis job script has been generated by a script via
3+# runghc make_travis_yml_2.hs 'hjsonpointer.cabal'
5+# For more information, see https://github.com/hvr/multi-ghc-travis
3−# Manually modified to remove cabal check. I don't want a description field.
7+# NOTE: After generating comment out `cabal check`, it requires a description field.
6sudo: false
10sudo: false
13+ submodules: false # whether to recursively clone submodules
9 directories:
16 directories:
11 - $HOME/.cabal/packages
17 - $HOME/.cabal/packages
13before_cache:
20before_cache:
14 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
21 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
22+ # remove files that are regenerated by 'cabal update'
15− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
23+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
24+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
25+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
26+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
27+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
29+ - rm -rfv $HOME/.cabal/packages/head.hackage
19− - env: CABALVER=1.18 GHCVER=7.8.4
33+ - compiler: "ghc-8.0.2"
20− compiler: ": #GHC 7.8.4"
34+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
21− addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
35+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
22− - env: CABALVER=1.22 GHCVER=7.10.2
36+ - compiler: "ghc-8.2.2"
23− compiler: ": #GHC 7.10.2"
37+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
24− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
38+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
25− - env: CABALVER=1.24 GHCVER=8.0.1
39+ - compiler: "ghc-8.4.1"
26− compiler: ": #GHC 8.0.1"
40+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
27− addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
41+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
29before_install:
43before_install:
45+ - HCPKG=${HC/ghc/ghc-pkg}
30− - unset CC
46+ - unset CC
48+ - mkdir -p $HOME/.local/bin
31− - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
49+ - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
50+ - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
34− - cabal --version
54+ - cabal --version
35− - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
55+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
36− - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
56+ - BENCH=${BENCH---enable-benchmarks}
37− then
57+ - TEST=${TEST---enable-tests}
38− zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
58+ - HADDOCK=${HADDOCK-true}
39− $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
59+ - INSTALLED=${INSTALLED-true}
40− fi
60+ - GHCHEAD=${GHCHEAD-false}
41− - travis_retry cabal update -v
61+ - travis_retry cabal update -v
42− - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
62+ - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
43− - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
63+ - rm -fv cabal.project cabal.project.local
44− - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
64+ - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
45−
65+ - "printf 'packages: \".\"\\n' > cabal.project"
46−# check whether current requested install-plan matches cached package-db snapshot
66+ - cat cabal.project
47− - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
67+ - if [ -f "./configure.ac" ]; then
48− then
68+ (cd "." && autoreconf -i);
49− echo "cabal build-cache HIT";
69+ fi
50− rm -rfv .ghc;
70+ - rm -f cabal.project.freeze
51− cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
71+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
52− cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
72+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
53− else
73+ - rm -rf .ghc.environment.* "."/dist
54− echo "cabal build-cache MISS";
74+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
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;
60−# snapshot package-db on cache miss
61− - if [ ! -d $HOME/.cabsnap ];
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/;
69# Here starts the actual work to be performed for the package under test;
76# Here starts the actual work to be performed for the package under test;
70# any command which exits with a non-zero exit code causes the build to fail.
77# any command which exits with a non-zero exit code causes the build to fail.
72− - if [ -f configure.ac ]; then autoreconf -i; fi
79+ # test that source-distributions can be generated
73− - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
80+ - (cd "." && cabal sdist)
81+ - mv "."/dist/hjsonpointer-*.tar.gz ${DISTDIR}/
82+ - cd ${DISTDIR} || false
83+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
84+ - "printf 'packages: hjsonpointer-*/*.cabal\\n' > cabal.project"
74− - cabal build # this builds all libraries and executables (including tests/benchmarks)
86+ # this builds all libraries and executables (without tests/benchmarks)
75− - cabal test
87+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
76− - cabal sdist # tests that a source-distribution can be generated
88+
89+ # Build with installed constraints for packages in global-db
90+ - if $INSTALLED; then echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh; else echo "Not building with installed constraints"; fi
92+ # build & run tests, build benchmarks
93+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
94+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
97+ # - (cd hjsonpointer-* && cabal check)
78−# Check that the resulting source distribution can be built & installed.
99+ # haddock
79−# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
100+ - rm -rf ./dist-newstyle
80−# `cabal install --force-reinstalls dist/*-*.tar.gz`
101+ - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
81− - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
82− (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
103+# REGENDATA ["hjsonpointer.cabal"]