git.iko.soy/typeable/http-api-data
on master help sign in
Update .travis.yml (also bump doctest bound)
3962051Oleg Grenrus
.travis.yml+49−65
@@ -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
2#
2#
3−# make_travis_yml_2.hs 'http-api-data.cabal'
3+# make_travis_yml_2.hs '--branch' 'master' '-o' '.travis.yml' 'http-api-data.cabal'
4#
4#
5# For more information, see https://github.com/hvr/multi-ghc-travis
5# For more information, see https://github.com/hvr/multi-ghc-travis
6#
6#
@@ -10,6 +10,10 @@ sudo: false
10git:
10git:
11 submodules: false # whether to recursively clone submodules
11 submodules: false # whether to recursively clone submodules
12
12
13+branches:
14+ only:
15+ - master
16+
13cache:
17cache:
14 directories:
18 directories:
15 - $HOME/.cabal/packages
19 - $HOME/.cabal/packages
@@ -35,80 +39,60 @@ matrix:
35 - compiler: "ghc-8.0.2"
39 - compiler: "ghc-8.0.2"
36 # env: TEST=--disable-tests BENCH=--disable-benchmarks
40 # env: TEST=--disable-tests BENCH=--disable-benchmarks
37 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]}}
38− - compiler: "ghc-8.2.1"
42+ - compiler: "ghc-8.2.2"
39− env: CABALFLAGS="--allow-newer"
40− # env: TEST=--disable-tests BENCH=--disable-benchmarks
41− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
42− - compiler: "ghc-head"
43− env: CABALFLAGS="--allow-newer"
44 # env: TEST=--disable-tests BENCH=--disable-benchmarks
43 # env: TEST=--disable-tests BENCH=--disable-benchmarks
45− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
44+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
46−
47− allow_failures:
48− - compiler: "ghc-8.2.1" # needs time-1.8.0.2
49− - compiler: "ghc-head"
50
45
51before_install:
46before_install:
52− - HC=${CC}
47+ - HC=${CC}
48+ - HCPKG=${HC/ghc/ghc-pkg}
53− - unset CC
49+ - unset CC
54− - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
50+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
55− - PKGNAME='http-api-data'
56
51
57install:
52install:
58− - cabal --version
53+ - cabal --version
59− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
54+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
60− - BENCH=${BENCH---enable-benchmarks}
55+ - BENCH=${BENCH---enable-benchmarks}
61− - TEST=${TEST---enable-tests}
56+ - TEST=${TEST---enable-tests}
57+ - HADDOCK=${HADDOCK-true}
58+ - INSTALLED=${INSTALLED-true}
62− - travis_retry cabal update -v
59+ - travis_retry cabal update -v
63− - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
60+ - sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
64− # Soon we'll have build-tool-depends: in cabal-head
65− - cabal get hspec-discover-2.3.2
66− - cd hspec-discover-2.3.2
67− - cabal new-build hspec-discover:exe:hspec-discover
68− - mkdir -p ~/.local/bin
69− - shopt -s globstar; cp dist-newstyle/**/hspec-discover/hspec-discover ~/.local/bin
70− - cd ..
71− # Continue
72− - rm -fv cabal.project.local
61+ - rm -fv cabal.project.local
73− - "echo 'packages: .' > cabal.project"
62+ - "echo 'packages: .' > cabal.project"
63+ - if [ -f "./configure.ac" ]; then
64+ (cd "."; autoreconf -i);
65+ fi
74− - rm -f cabal.project.freeze
66+ - rm -f cabal.project.freeze
75− - cabal new-build ${CABALFLAGS} -w ${HC} ${TEST} ${BENCH} --dep -j2
67+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
76− - cabal new-build ${CABALFLAGS} -w ${HC} --disable-tests --disable-benchmarks --dep -j2
68+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
69+ - rm -rf "."/.ghc.environment.* "."/dist
70+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
77
71
78# Here starts the actual work to be performed for the package under test;
72# Here starts the actual work to be performed for the package under test;
79# any command which exits with a non-zero exit code causes the build to fail.
73# any command which exits with a non-zero exit code causes the build to fail.
80script:
74script:
81− - if [ -f configure.ac ]; then autoreconf -i; fi
82− - rm -rf dist/
83− - cabal sdist # test that a source-distribution can be generated
75+ # test that source-distributions can be generated
84− - cd dist/
76+ - (cd "."; cabal sdist)
85− - SRCTAR=(${PKGNAME}-*.tar.gz)
77+ - mv "."/dist/http-api-data-*.tar.gz ${DISTDIR}/
86− - SRC_BASENAME="${SRCTAR/%.tar.gz}"
78+ - cd ${DISTDIR}
87− - tar -xvf "./$SRC_BASENAME.tar.gz"
79+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
88− - cd "$SRC_BASENAME/"
89−## from here on, CWD is inside the extracted source-tarball
90− - rm -fv cabal.project.local
91− - "echo 'packages: .' > cabal.project"
80+ - "printf 'packages: http-api-data-*/*.cabal\n' > cabal.project"
92− # this builds all libraries and executables (without tests/benchmarks)
81+ # this builds all libraries and executables (without tests/benchmarks)
93− - rm -f cabal.project.freeze
94− - cabal new-build ${CABALFLAGS} -w ${HC} --disable-tests --disable-benchmarks
82+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
83+
84+ # Build with installed constraints for packages in global-db
85+ - if $INSTALLED; then
95− - cabal new-build ${CABALFLAGS} -w ${HC} --disable-tests --disable-benchmarks --flag http-api-data:use-text-show
86+ 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;
96− # this builds all libraries and executables (including tests/benchmarks)
87+ else echo "Not building with installed constraints"; fi
97− # - rm -rf ./dist-newstyle
98− - cabal new-build ${CABALFLAGS} -w ${HC} ${TEST} ${BENCH}
99
88
100− # there's no 'cabal new-test' yet, so let's emulate for now
89+ # build & run tests, build benchmarks
101− - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) )
90+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
102− - if [ "$TEST" != "--enable-tests" ]; then TESTS=(); fi
91+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
103− - shopt -s globstar;
104− RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
105− if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
106− else echo "= $T FAILED ="; RC=false; fi; done; $RC
107
92
108− - cabal new-build ${CABALFLAGS} -w ${HC} ${TEST} ${BENCH} --flag http-api-data:use-text-show
93+ # haddock
109− - shopt -s globstar;
94+ - rm -rf ./dist-newstyle
110− RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
95+ - if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
111− if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
112− else echo "= $T FAILED ="; RC=false; fi; done; $RC
113
96
97+# REGENDATA ["--branch","master","-o",".travis.yml","http-api-data.cabal"]
114# EOF
98# EOF
http-api-data.cabal+2−1
@@ -20,7 +20,7 @@ tested-with:
20 GHC==7.8.4,
20 GHC==7.8.4,
21 GHC==7.10.3,
21 GHC==7.10.3,
22 GHC==8.0.2,
22 GHC==8.0.2,
23− GHC==8.1.*
23+ GHC==8.2.2
24
24
25custom-setup
25custom-setup
26 setup-depends:
26 setup-depends:
@@ -70,6 +70,7 @@ test-suite spec
70 hs-source-dirs: test
70 hs-source-dirs: test
71 ghc-options: -Wall
71 ghc-options: -Wall
72 default-language: Haskell2010
72 default-language: Haskell2010
73+ build-tool-depends: hspec-discover:hspec-discover
73 build-depends: HUnit
74 build-depends: HUnit
74 , hspec >= 1.3
75 , hspec >= 1.3
75 , base >= 4 && < 5
76 , base >= 4 && < 5