Skip to content

Commit b4a96fd

Browse files
phadejhvr
authored andcommitted
Update travis
Note: tests are built and run with GHC>=7.4 only
1 parent 964a80a commit b4a96fd

File tree

2 files changed

+81
-93
lines changed

2 files changed

+81
-93
lines changed

.travis.yml

Lines changed: 77 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--irc-channel=irc.freenode.org#hackage' 'zlib.cabal' 'zlib1g-dev'
3+
# haskell-ci '-o' '.travis.yml' '--irc-channels=irc.freenode.org#hackage' 'zlib.cabal' '--apt=zlib1g-dev' '--tests-jobs=>=7.4'
44
#
5-
# For more information, see https://github.com/hvr/multi-ghc-travis
5+
# For more information, see https://github.com/haskell-CI/haskell-ci
6+
#
7+
# version: 0.3
68
#
79
language: c
8-
sudo: false
10+
dist: xenial
911

1012
git:
1113
submodules: false # whether to recursively clone submodules
@@ -24,126 +26,112 @@ cache:
2426
- $HOME/.cabal/store
2527

2628
before_cache:
27-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
29+
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2830
# remove files that are regenerated by 'cabal update'
29-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
30-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
31-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
32-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
33-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
31+
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
32+
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
33+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
34+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
35+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
3436

35-
- rm -rfv $HOME/.cabal/packages/head.hackage
37+
- rm -rfv $CABALHOME/packages/head.hackage
3638

3739
matrix:
3840
include:
39-
- compiler: "ghc-7.0.4"
40-
env: TEST=--disable-tests
41-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.0.4,zlib1g-dev], sources: [hvr-ghc]}}
42-
- compiler: "ghc-7.2.2"
43-
env: TEST=--disable-tests
44-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.2.2,zlib1g-dev], sources: [hvr-ghc]}}
45-
- compiler: "ghc-7.4.2"
46-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
47-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.4.2,zlib1g-dev], sources: [hvr-ghc]}}
48-
- compiler: "ghc-7.6.3"
49-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
50-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3,zlib1g-dev], sources: [hvr-ghc]}}
51-
- compiler: "ghc-7.8.4"
52-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
53-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4,zlib1g-dev], sources: [hvr-ghc]}}
54-
- compiler: "ghc-7.10.3"
55-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
56-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3,zlib1g-dev], sources: [hvr-ghc]}}
57-
- compiler: "ghc-8.0.1"
58-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
59-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.1,zlib1g-dev], sources: [hvr-ghc]}}
60-
- compiler: "ghc-8.0.2"
61-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
62-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2,zlib1g-dev], sources: [hvr-ghc]}}
41+
- compiler: "ghc-8.6.4"
42+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4,zlib1g-dev], sources: [hvr-ghc]}}
43+
- compiler: "ghc-8.4.4"
44+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4,zlib1g-dev], sources: [hvr-ghc]}}
6345
- compiler: "ghc-8.2.2"
64-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
65-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2,zlib1g-dev], sources: [hvr-ghc]}}
66-
- compiler: "ghc-8.4.1"
67-
env: GHCHEAD=true
68-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1,zlib1g-dev], sources: [hvr-ghc]}}
69-
70-
allow_failures:
71-
- compiler: "ghc-8.4.1"
46+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2,zlib1g-dev], sources: [hvr-ghc]}}
47+
- compiler: "ghc-8.0.2"
48+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2,zlib1g-dev], sources: [hvr-ghc]}}
49+
- compiler: "ghc-8.0.1"
50+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.1,zlib1g-dev], sources: [hvr-ghc]}}
51+
- compiler: "ghc-7.10.3"
52+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3,zlib1g-dev], sources: [hvr-ghc]}}
53+
- compiler: "ghc-7.8.4"
54+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4,zlib1g-dev], sources: [hvr-ghc]}}
55+
- compiler: "ghc-7.6.3"
56+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3,zlib1g-dev], sources: [hvr-ghc]}}
57+
- compiler: "ghc-7.4.2"
58+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2,zlib1g-dev], sources: [hvr-ghc]}}
59+
- compiler: "ghc-7.2.2"
60+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.2.2,zlib1g-dev], sources: [hvr-ghc]}}
61+
- compiler: "ghc-7.0.4"
62+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.4,zlib1g-dev], sources: [hvr-ghc]}}
7263

7364
before_install:
74-
- HC=${CC}
65+
- HC=/opt/ghc/bin/${CC}
7566
- HCPKG=${HC/ghc/ghc-pkg}
7667
- unset CC
68+
- CABAL=/opt/ghc/bin/cabal
69+
- CABALHOME=$HOME/.cabal
70+
- export PATH="$CABALHOME/bin:$PATH"
7771
- ROOTDIR=$(pwd)
78-
- mkdir -p $HOME/.local/bin
79-
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
8072
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
8173
- echo $HCNUMVER
8274

8375
install:
84-
- cabal --version
76+
- ${CABAL} --version
8577
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
86-
- BENCH=${BENCH---enable-benchmarks}
87-
- TEST=${TEST---enable-tests}
88-
- HADDOCK=${HADDOCK-true}
89-
- INSTALLED=${INSTALLED-true}
78+
- TEST=--enable-tests
79+
- if [ $HCNUMVER -lt 70400 ] ; then TEST=--disable-tests ; fi
80+
- BENCH=--enable-benchmarks
9081
- GHCHEAD=${GHCHEAD-false}
91-
- travis_retry cabal update -v
92-
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
82+
- travis_retry ${CABAL} update -v
83+
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
9384
- rm -fv cabal.project cabal.project.local
94-
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
95-
- |
96-
if $GHCHEAD; then
97-
sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
98-
99-
echo 'repository head.hackage' >> ${HOME}/.cabal/config
100-
echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
101-
echo ' secure: True' >> ${HOME}/.cabal/config
102-
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
103-
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
104-
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
105-
echo ' key-threshold: 3' >> ${HOME}/.cabal.config
106-
107-
cabal new-update head.hackage -v
108-
fi
109-
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
110-
- "printf 'packages: \".\"\\n' > cabal.project"
111-
- cat cabal.project
112-
- if [ -f "./configure.ac" ]; then
113-
(cd "." && autoreconf -i);
114-
fi
85+
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
86+
- rm -f cabal.project
87+
- touch cabal.project
88+
- "printf 'packages: \".\"\\n' >> cabal.project"
89+
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
90+
- touch cabal.project.local
91+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(zlib)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
92+
- cat cabal.project || true
93+
- cat cabal.project.local || true
94+
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
11595
- rm -f cabal.project.freeze
116-
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
117-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
96+
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
97+
- "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
98+
- rm "cabal.project.freeze"
99+
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
100+
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
118101
- rm -rf .ghc.environment.* "."/dist
119102
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
120103

121104
# Here starts the actual work to be performed for the package under test;
122105
# any command which exits with a non-zero exit code causes the build to fail.
123106
script:
124107
# test that source-distributions can be generated
125-
- (cd "." && cabal sdist)
126-
- mv "."/dist/zlib-*.tar.gz ${DISTDIR}/
108+
- ${CABAL} new-sdist all
109+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
127110
- cd ${DISTDIR} || false
128111
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
129-
- "printf 'packages: zlib-*/*.cabal\\n' > cabal.project"
130-
- cat cabal.project
112+
- rm -f cabal.project
113+
- touch cabal.project
114+
- "printf 'packages: \"zlib-*/*.cabal\"\\n' >> cabal.project"
115+
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
116+
- touch cabal.project.local
117+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(zlib)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
118+
- cat cabal.project || true
119+
- cat cabal.project.local || true
131120
# this builds all libraries and executables (without tests/benchmarks)
132-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
133-
134-
# Build with installed constraints for packages in global-db
135-
- 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
121+
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
136122

137123
# build & run tests, build benchmarks
138-
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
139-
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
124+
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
125+
- if [ $HCNUMVER -ge 70400 ] ; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all ; fi
140126

141127
# cabal check
142-
- (cd zlib-* && cabal check)
128+
- (cd zlib-* && ${CABAL} check)
143129

144130
# haddock
145-
- rm -rf ./dist-newstyle
146-
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
131+
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
132+
133+
# Build without installed constraints for packages in global-db
134+
- rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;
147135

148-
# REGENDATA ["-o",".travis.yml","--irc-channel=irc.freenode.org#hackage","zlib.cabal","zlib1g-dev"]
136+
# REGENDATA ["-o",".travis.yml","--irc-channels=irc.freenode.org#hackage","zlib.cabal","--apt=zlib1g-dev","--tests-jobs=>=7.4"]
149137
# EOF

zlib.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ description: This package provides a pure interface for compressing and
2020
provides access to the full zlib feature set.
2121
build-type: Simple
2222
cabal-version: >= 1.10
23-
tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3, GHC ==8.0.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.1
23+
tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3, GHC ==8.0.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.4, GHC==8.6.4
2424

2525
extra-source-files: changelog
2626
-- zlib C sources (for Windows)
@@ -103,7 +103,7 @@ test-suite tests
103103
default-language: Haskell2010
104104
build-depends: base, bytestring, zlib,
105105
QuickCheck == 2.*,
106-
tasty >= 0.8 && < 0.12,
107-
tasty-quickcheck == 0.8.*,
108-
tasty-hunit >= 0.8 && < 0.10
106+
tasty >= 0.8 && < 1.3,
107+
tasty-quickcheck >= 0.8 && < 0.11,
108+
tasty-hunit >= 0.8 && < 0.11
109109
ghc-options: -Wall

0 commit comments

Comments
 (0)