@@ -1,8 +1,15 @@
1−# This file has been generated by `make_travis_yml_2.hs`
1+# This Travis job script has been generated by a script via
3+# runghc make_travis_yml_2.hs 'monoidal-containers.cabal'
2−# see https://github.com/hvr/multi-ghc-travis for more information
5+# For more information, see https://github.com/hvr/multi-ghc-travis
11+ submodules: false # whether to recursively clone submodules
7 directories:
14 directories:
8 - $HOME/.cabal/packages
15 - $HOME/.cabal/packages
@@ -10,59 +17,109 @@ cache:
11before_cache:
18before_cache:
12 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
19 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
20+ # remove files that are regenerated by 'cabal update'
13− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
21+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
27+ - rm -rfv $HOME/.cabal/packages/head.hackage
17− - env: CABALVER=1.24 GHCVER=7.6.3
31+ - compiler: "ghc-7.6.3"
18− compiler: ": #GHC 7.6.3"
32+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
19− addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3], sources: [hvr-ghc]}}
33+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3], sources: [hvr-ghc]}}
20− - env: CABALVER=1.24 GHCVER=7.8.4
34+ - compiler: "ghc-7.8.4"
21− compiler: ": #GHC 7.8.4"
35+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
36+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
37+ - compiler: "ghc-8.0.2"
38+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
22− addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4], sources: [hvr-ghc]}}
39+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
23− - env: CABALVER=1.24 GHCVER=8.0.1
40+ - compiler: "ghc-8.2.2"
41+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
42+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
24− compiler: ": #GHC 8.0.1"
43+ - compiler: "ghc-8.4.1"
25− addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
45+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
48+ - compiler: "ghc-8.4.1"
27before_install:
50before_install:
52+ - HCPKG=${HC/ghc/ghc-pkg}
28− - unset CC
53+ - unset CC
55+ - mkdir -p $HOME/.local/bin
29− - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
56+ - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
57+ - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
32− - cabal --version
61+ - cabal --version
33− - BENCH=${BENCH---enable-benchmarks}
34− - TEST=${TEST---enable-tests}
35− - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
62+ - 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 ];
63+ - BENCH=${BENCH---enable-benchmarks}
37− then
64+ - TEST=${TEST---enable-tests}
38− zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
65+ - HADDOCK=${HADDOCK-true}
39− $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
66+ - INSTALLED=${INSTALLED-true}
40− fi
67+ - GHCHEAD=${GHCHEAD-false}
41− - travis_retry cabal update -v
68+ - travis_retry cabal update -v
42− - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
69+ - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
70+ - rm -fv cabal.project cabal.project.local
71+ # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
74+ sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
76+ echo 'repository head.hackage' >> ${HOME}/.cabal/config
77+ echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
78+ echo ' secure: True' >> ${HOME}/.cabal/config
79+ echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
80+ echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
81+ echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
82+ echo ' key-threshold: 3' >> ${HOME}/.cabal.config
84+ cabal new-update head.hackage -v
86+ - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
87+ - "printf 'packages: \".\"\\n' > cabal.project"
89+ - if [ -f "./configure.ac" ]; then
90+ (cd "." && autoreconf -i);
92+ - rm -f cabal.project.freeze
43− - cabal new-build ${TEST} ${BENCH} --dep
93+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
94+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
95+ - rm -rf .ghc.environment.* "."/dist
96+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
45# Here starts the actual work to be performed for the package under test;
98# Here starts the actual work to be performed for the package under test;
46# any command which exits with a non-zero exit code causes the build to fail.
99# any command which exits with a non-zero exit code causes the build to fail.
48− - if [ -f configure.ac ]; then autoreconf -i; fi
101+ # test that source-distributions can be generated
102+ - (cd "." && cabal sdist)
103+ - mv "."/dist/monoidal-containers-*.tar.gz ${DISTDIR}/
104+ - cd ${DISTDIR} || false
105+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
106+ - "printf 'packages: monoidal-containers-*/*.cabal\\n' > cabal.project"
49− # this builds all libraries and executables (including tests/benchmarks)
108+ # this builds all libraries and executables (without tests/benchmarks)
50− - cabal new-build ${TEST} ${BENCH} -v2 # -v2 provides useful information for debugging
109+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
52− # there's no 'cabal new-test' yet, so let's emulate for now
111+ # Build with installed constraints for packages in global-db
53− - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) );
112+ - 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
54− RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
113+
55− if dist-newstyle/build/*/build/$T/$T; then echo "= $T OK =";
114+ # build & run tests, build benchmarks
56− else echo "= $T FAILED ="; RC=false; fi; done; $RC
115+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
57− - cabal sdist # test that a source-distribution can be generated
116+
59− # Check that the resulting source distribution can be built w/o and w tests
118+ - (cd monoidal-containers-* && cabal check)
60− - SRC_BASENAME=$(cabal info . | awk '{print $2;exit}')
119+
61− - tar -C dist/ -xf dist/$SRC_BASENAME.tar.gz
120+ # haddock
62− - "echo 'packages: *.cabal' > dist/$SRC_BASENAME/cabal.project"
63− - cd dist/$SRC_BASENAME/
64− - cabal new-build --disable-tests --disable-benchmarks
65− - rm -rf ./dist-newstyle
121+ - rm -rf ./dist-newstyle
66− - cabal new-build ${TEST} ${BENCH}
122+ - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
124+# REGENDATA ["monoidal-containers.cabal"]