@@ -1,6 +1,6 @@
1# This Travis job script has been generated by a script via
1# This Travis job script has been generated by a script via
3−# make_travis_yml_2.hs '--branch' 'master' 'servant-swagger-ui.cabal'
3+# make_travis_yml_2.hs '-o' '.travis.yml' '--branch' 'master' '--constraints=$ROOTDIR/constraints.hs' 'servant-swagger-ui.cabal'
5# For more information, see https://github.com/hvr/multi-ghc-travis
5# For more information, see https://github.com/hvr/multi-ghc-travis
@@ -39,67 +39,62 @@ matrix:
39 - compiler: "ghc-8.0.2"
39 - compiler: "ghc-8.0.2"
40 # env: TEST=--disable-tests BENCH=--disable-benchmarks
40 # env: TEST=--disable-tests BENCH=--disable-benchmarks
41 addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
41 addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
42− - compiler: "ghc-8.2.1"
42+ - compiler: "ghc-8.2.2"
43 # env: TEST=--disable-tests BENCH=--disable-benchmarks
43 # env: TEST=--disable-tests BENCH=--disable-benchmarks
44− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
44+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
46before_install:
46before_install:
47− - HC=${CC}
47+ - HC=${CC}
48+ - HCPKG=${HC/ghc/ghc-pkg}
48− - unset CC
49+ - unset CC
49− - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
51+ - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH"
50− - PKGNAME='servant-swagger-ui'
53− - cabal --version
54+ - cabal --version
54− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
55+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
55− - BENCH=${BENCH---enable-benchmarks}
56+ - BENCH=${BENCH---enable-benchmarks}
56− - TEST=${TEST---enable-tests}
57+ - TEST=${TEST---enable-tests}
58+ - HADDOCK=${HADDOCK-true}
59+ - INSTALLED=${INSTALLED-true}
57− - travis_retry cabal update -v
60+ - travis_retry cabal update -v
58− - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
61+ - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
59− - rm -fv cabal.project.local
62+ - rm -fv cabal.project.local
60− - "echo 'packages: .' > cabal.project"
63+ - "echo 'packages: .' > cabal.project"
64+ - if [ -f "./configure.ac" ]; then
65+ (cd "."; autoreconf -i);
61− - rm -f cabal.project.freeze
67+ - rm -f cabal.project.freeze
62− - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
68+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
63− - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
69+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
70+ - rm -rf "."/.ghc.environment.* "."/dist
71+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
65# Here starts the actual work to be performed for the package under test;
73# Here starts the actual work to be performed for the package under test;
66# any command which exits with a non-zero exit code causes the build to fail.
74# any command which exits with a non-zero exit code causes the build to fail.
68− - if [ -f configure.ac ]; then autoreconf -i; fi
69− - rm -rf .ghc.environment.* dist/
70− - cabal sdist # test that a source-distribution can be generated
76+ # test that source-distributions can be generated
71− - cd dist/
77+ - (cd "." && cabal sdist)
72− - SRCTAR=(${PKGNAME}-*.tar.gz)
78+ - mv "."/dist/servant-swagger-ui-*.tar.gz ${DISTDIR}/
73− - SRC_BASENAME="${SRCTAR/%.tar.gz}"
79+ - cd ${DISTDIR} || false
74− - tar -xvf "./$SRC_BASENAME.tar.gz"
80+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
75− - cd "$SRC_BASENAME/"
76−## from here on, CWD is inside the extracted source-tarball
77− - rm -fv cabal.project.local
78− - "echo 'packages: .' > cabal.project"
81+ - "printf 'packages: servant-swagger-ui-*/*.cabal\\n' > cabal.project"
79− # this builds all libraries and executables (without tests/benchmarks)
82+ # this builds all libraries and executables (without tests/benchmarks)
80− - rm -f cabal.project.freeze
81− - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
83+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
82− # this builds all libraries and executables (including tests/benchmarks)
83− # - rm -rf ./dist-newstyle
85− - if [ $HC = "ghc-8.0.2" -o $HC = "ghc-8.2.1" ]; then UNLESSGHC80=true; fi
85+ # Build with installed constraints for packages in global-db
86− - if [ $HC = "ghc-8.2.1" ]; then UNLESSGHC82=true; fi
86+ - 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
88− #- $UNLESSGHC80 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.4.*'
88+ # build & run tests, build benchmarks
89− #- $UNLESSGHC80 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.5.*'
89+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
90− #- $UNLESSGHC80 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.6.*'
90+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
91− #- $UNLESSGHC82 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.7.*'
92− #- $UNLESSGHC82 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.8.*'
93− - $UNLESSGHC82 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.9.*'
94− - $UNLESSGHC82 cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.10.*'
95− - cabal new-build -w ${HC} --disable-tests --disable-benchmarks '--constraint=servant==0.11.*'
92+ # build & run tests, with constraints
93+ - for c in $($ROOTDIR/constraints.hs list ${HC}); do echo "=== Constraint" $c; echo "--------------------------------"; cabal new-build -w ${HC} --disable-tests --disable-benchmarks $($ROOTDIR/constraints.hs constraints $c) all; done
98− # build & run tests, build benchmarks
95+ # haddock
99− - cabal new-build -w ${HC} ${TEST} ${BENCH} all
96+ - rm -rf ./dist-newstyle
100− - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
97+ - if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
103− - cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all
99+# REGENDATA ["-o",".travis.yml","--branch","master","--constraints=$ROOTDIR/constraints.hs","servant-swagger-ui.cabal"]