Skip to content

Commit 5bc4e08

Browse files
committed
Update Travis CI
Note: includes a manual hack for the Lift th-tests
1 parent d947bae commit 5bc4e08

File tree

2 files changed

+125
-123
lines changed

2 files changed

+125
-123
lines changed

.travis.yml

Lines changed: 124 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,158 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# runghc make_travis_yml_2.hs 'text.cabal'
3+
# haskell-ci 'text.cabal'
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.20190521
68
#
79
language: c
8-
sudo: false
9-
10-
# Bryan threatens to turn off Travis-CI if he gets any email :-)
11-
notifications:
12-
email: false
13-
10+
dist: xenial
1411
git:
15-
submodules: false # whether to recursively clone submodules
16-
12+
# whether to recursively clone submodules
13+
submodules: false
1714
cache:
1815
directories:
1916
- $HOME/.cabal/packages
2017
- $HOME/.cabal/store
21-
2218
before_cache:
23-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
19+
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2420
# remove files that are regenerated by 'cabal update'
25-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
26-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
27-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
28-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
29-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
30-
31-
- rm -rfv $HOME/.cabal/packages/head.hackage
32-
21+
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
22+
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
23+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
24+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
25+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
26+
- rm -rfv $CABALHOME/packages/head.hackage
3327
matrix:
3428
include:
35-
- compiler: "ghc-8.6.1"
36-
env: GHCHEAD=true
37-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1], sources: [hvr-ghc]}}
38-
- compiler: "ghc-8.4.3"
39-
# Fails due to GHC #15436
40-
env: TEST=--disable-tests BENCH=--disable-benchmarks
41-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}
42-
- compiler: "ghc-8.2.2"
43-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
44-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}
45-
- compiler: "ghc-8.0.2"
46-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
47-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2], sources: [hvr-ghc]}}
48-
- compiler: "ghc-7.10.3"
49-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
50-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3], 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-2.2,ghc-7.8.4], sources: [hvr-ghc]}}
54-
- compiler: "ghc-7.6.3"
55-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
56-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.3], sources: [hvr-ghc]}}
57-
- compiler: "ghc-7.4.2"
58-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
59-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.4.2], sources: [hvr-ghc]}}
60-
- compiler: "ghc-7.2.2"
61-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
62-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.2.2], sources: [hvr-ghc]}}
63-
- compiler: "ghc-7.0.4"
64-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
65-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.0.4], sources: [hvr-ghc]}}
66-
67-
allow_failures:
68-
- compiler: "ghc-8.6.1"
69-
29+
- compiler: ghc-8.6.5
30+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
31+
- compiler: ghc-8.4.4
32+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
33+
- compiler: ghc-8.2.2
34+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
35+
- compiler: ghc-8.0.2
36+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
37+
- compiler: ghc-7.10.3
38+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-2.4"]}}
39+
- compiler: ghc-7.8.4
40+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-2.4"]}}
41+
- compiler: ghc-7.6.3
42+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.6.3","cabal-install-2.4"]}}
43+
- compiler: ghc-7.4.2
44+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.4.2","cabal-install-2.4"]}}
45+
- compiler: ghc-7.2.2
46+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.2.2","cabal-install-2.4"]}}
47+
- compiler: ghc-7.0.4
48+
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.0.4","cabal-install-2.4"]}}
7049
before_install:
71-
- HC=${CC}
72-
- HCPKG=${HC/ghc/ghc-pkg}
50+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
51+
- HCPKG="$HC-pkg"
7352
- unset CC
74-
- ROOTDIR=$(pwd)
75-
- mkdir -p $HOME/.local/bin
76-
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
53+
- CABAL=/opt/ghc/bin/cabal
54+
- CABALHOME=$HOME/.cabal
55+
- export PATH="$CABALHOME/bin:$PATH"
56+
- TOP=$(pwd)
7757
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
7858
- echo $HCNUMVER
79-
59+
- CABAL="$CABAL -vnormal+nowrap+markoutput"
60+
- set -o pipefail
61+
- |
62+
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
63+
echo 'BEGIN { state = "output"; }' >> .colorful.awk
64+
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
65+
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
66+
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
67+
echo ' if (state == "cabal") {' >> .colorful.awk
68+
echo ' print blue($0)' >> .colorful.awk
69+
echo ' } else {' >> .colorful.awk
70+
echo ' print $0' >> .colorful.awk
71+
echo ' }' >> .colorful.awk
72+
echo '}' >> .colorful.awk
73+
- cat .colorful.awk
74+
- |
75+
color_cabal_output () {
76+
awk -f $TOP/.colorful.awk
77+
}
78+
- echo text | color_cabal_output
8079
install:
81-
- cabal --version
80+
- ${CABAL} --version
8281
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
83-
- BENCH=${BENCH---enable-benchmarks}
84-
- TEST=${TEST---enable-tests}
85-
- HADDOCK=${HADDOCK-true}
86-
- UNCONSTRAINED=${UNCONSTRAINED-true}
87-
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
82+
- TEST=--enable-tests
83+
- BENCH=--enable-benchmarks
8884
- GHCHEAD=${GHCHEAD-false}
89-
- travis_retry cabal update -v
90-
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
91-
- rm -fv cabal.project cabal.project.local
92-
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
85+
- rm -f $CABALHOME/config
9386
- |
94-
if $GHCHEAD; then
95-
sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config
96-
for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" ${HOME}/.cabal/config; done
97-
98-
echo 'repository head.hackage' >> ${HOME}/.cabal/config
99-
echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
100-
echo ' secure: True' >> ${HOME}/.cabal/config
101-
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
102-
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
103-
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
104-
echo ' key-threshold: 3' >> ${HOME}/.cabal.config
105-
106-
grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
107-
108-
cabal new-update head.hackage -v
109-
fi
110-
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
111-
- "printf 'packages: \".\"\\n' > cabal.project"
112-
- touch cabal.project.local
113-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- text | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
87+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
88+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
89+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
90+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
91+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
92+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
93+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
94+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
95+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
96+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
97+
echo "install-dirs user" >> $CABALHOME/config
98+
echo " prefix: $CABALHOME" >> $CABALHOME/config
99+
echo "repository hackage.haskell.org" >> $CABALHOME/config
100+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
101+
- cat $CABALHOME/config
102+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
103+
- travis_retry ${CABAL} v2-update -v
104+
# Generate cabal.project
105+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
106+
- touch cabal.project
107+
- |
108+
echo 'packages: "."' >> cabal.project
109+
- |
110+
echo "write-ghc-environment-files: always" >> cabal.project
111+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(text)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
114112
- cat cabal.project || true
115113
- cat cabal.project.local || true
116-
- if [ -f "./configure.ac" ]; then
117-
(cd "." && autoreconf -i);
118-
fi
119-
- rm -f cabal.project.freeze
120-
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
121-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
122-
- rm -rf .ghc.environment.* "."/dist
123-
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
124-
125-
# Here starts the actual work to be performed for the package under test;
126-
# any command which exits with a non-zero exit code causes the build to fail.
114+
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
115+
- ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
116+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
117+
- rm cabal.project.freeze
118+
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
119+
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
127120
script:
128-
# test that source-distributions can be generated
129-
- (cd "." && cabal sdist)
130-
- mv "."/dist/text-*.tar.gz ${DISTDIR}/
121+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
122+
# Packaging...
123+
- ${CABAL} v2-sdist all | color_cabal_output
124+
# Unpacking...
125+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
126+
- cp -av th-tests ${DISTDIR}/th-tests.src
131127
- cd ${DISTDIR} || false
132128
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
133-
- "printf 'packages: text-*/*.cabal\\n' > cabal.project"
134-
- touch cabal.project.local
135-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- text | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
129+
# Generate cabal.project
130+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
131+
- touch cabal.project
132+
- |
133+
echo 'packages: "text-*/*.cabal"' >> cabal.project
134+
- |
135+
echo 'packages: ./th-tests.src/' >> cabal.project
136+
- |
137+
echo "write-ghc-environment-files: always" >> cabal.project
138+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(text)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
136139
- cat cabal.project || true
137140
- cat cabal.project.local || true
141+
# Building...
138142
# this builds all libraries and executables (without tests/benchmarks)
139-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
140-
143+
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
144+
# Building with tests and benchmarks...
141145
# build & run tests, build benchmarks
142-
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
143-
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
144-
145-
# cabal check
146-
- (cd text-* && cabal check)
147-
148-
# haddock
149-
- rm -rf ./dist-newstyle
150-
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
151-
152-
# Build without installed constraints for packages in global-db
153-
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
146+
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
147+
# Testing...
148+
- ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
149+
# cabal check...
150+
- (cd text-* && ${CABAL} -vnormal check)
151+
# haddock...
152+
- ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
153+
# Building without installed constraints for packages in global-db...
154+
- rm -f cabal.project.local
155+
- ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
154156

155157
# REGENDATA ["text.cabal"]
156158
# EOF

text.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ maintainer: Bryan O'Sullivan <[email protected]>, Herbert Valerio Riedel <h
4343
copyright: 2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper
4444
category: Data, Text
4545
build-type: Simple
46-
tested-with: GHC==8.6.1, GHC==8.4.3,
46+
tested-with: GHC==8.6.5, GHC==8.4.4,
4747
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4,
4848
GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
4949
extra-source-files:

0 commit comments

Comments
 (0)