Skip to content

Commit 64f636d

Browse files
committed
Test with 8.2.2 and 8.4.1, too. Regenerate .travis.yml.
1 parent bd6565a commit 64f636d

File tree

2 files changed

+107
-66
lines changed

2 files changed

+107
-66
lines changed

.travis.yml

Lines changed: 104 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,128 @@
1-
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
1+
# This Travis job script has been generated by a script via
2+
#
3+
# runghc make_travis_yml_2.hs '-o' '.travis.yml' 'GLURaw.cabal'
4+
#
5+
# For more information, see https://github.com/hvr/multi-ghc-travis
6+
#
27
language: c
38
sudo: false
49

10+
git:
11+
submodules: false # whether to recursively clone submodules
12+
513
cache:
614
directories:
7-
- $HOME/.cabsnap
815
- $HOME/.cabal/packages
16+
- $HOME/.cabal/store
917

1018
before_cache:
1119
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
12-
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
20+
# remove files that are regenerated by 'cabal update'
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
26+
27+
- rm -rfv $HOME/.cabal/packages/head.hackage
1328

1429
matrix:
1530
include:
16-
- env: CABALVER=1.18 GHCVER=7.8.4
17-
compiler: ": #GHC 7.8.4"
18-
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
19-
- env: CABALVER=1.22 GHCVER=7.10.3
20-
compiler: ": #GHC 7.10.3"
21-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
22-
- env: CABALVER=1.24 GHCVER=8.0.2
23-
compiler: ": #GHC 8.0.2"
24-
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
25-
- env: CABALVER=head GHCVER=head
26-
compiler: ": #GHC head"
27-
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
31+
- compiler: "ghc-7.8.4"
32+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
33+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
34+
- compiler: "ghc-7.10.3"
35+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
36+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
37+
- compiler: "ghc-8.0.2"
38+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
39+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
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]}}
43+
- compiler: "ghc-8.4.1"
44+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
45+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
46+
- compiler: "ghc-head"
47+
env: GHCHEAD=true
48+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
2849

2950
allow_failures:
30-
- env: CABALVER=head GHCVER=head
51+
- compiler: "ghc-head"
3152

3253
before_install:
33-
- unset CC
34-
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
54+
- HC=${CC}
55+
- HCPKG=${HC/ghc/ghc-pkg}
56+
- unset CC
57+
- ROOTDIR=$(pwd)
58+
- mkdir -p $HOME/.local/bin
59+
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
60+
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
61+
- echo $HCNUMVER
3562

3663
install:
37-
- cabal --version
38-
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
39-
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
40-
then
41-
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
42-
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
43-
fi
44-
- travis_retry cabal update -v
45-
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
46-
- cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
47-
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
48-
49-
# check whether current requested install-plan matches cached package-db snapshot
50-
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
51-
then
52-
echo "cabal build-cache HIT";
53-
rm -rfv .ghc;
54-
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
55-
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
56-
else
57-
echo "cabal build-cache MISS";
58-
rm -rf $HOME/.cabsnap;
59-
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
60-
cabal install --only-dependencies --enable-tests --enable-benchmarks;
61-
fi
62-
63-
# snapshot package-db on cache miss
64-
- if [ ! -d $HOME/.cabsnap ];
65-
then
66-
echo "snapshotting package-db to build-cache";
67-
mkdir $HOME/.cabsnap;
68-
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
69-
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
70-
fi
64+
- cabal --version
65+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
66+
- BENCH=${BENCH---enable-benchmarks}
67+
- TEST=${TEST---enable-tests}
68+
- HADDOCK=${HADDOCK-true}
69+
- INSTALLED=${INSTALLED-true}
70+
- GHCHEAD=${GHCHEAD-false}
71+
- travis_retry cabal update -v
72+
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
73+
- rm -fv cabal.project cabal.project.local
74+
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
75+
- |
76+
if $GHCHEAD; then
77+
sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
78+
79+
echo 'repository head.hackage' >> ${HOME}/.cabal/config
80+
echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
81+
echo ' secure: True' >> ${HOME}/.cabal/config
82+
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
83+
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
84+
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
85+
echo ' key-threshold: 3' >> ${HOME}/.cabal.config
86+
87+
cabal new-update head.hackage -v
88+
fi
89+
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
90+
- "printf 'packages: \".\"\\n' > cabal.project"
91+
- cat cabal.project
92+
- if [ -f "./configure.ac" ]; then
93+
(cd "." && autoreconf -i);
94+
fi
95+
- rm -f cabal.project.freeze
96+
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
97+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
98+
- rm -rf .ghc.environment.* "."/dist
99+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
71100

72101
# Here starts the actual work to be performed for the package under test;
73102
# any command which exits with a non-zero exit code causes the build to fail.
74103
script:
75-
- if [ -f configure.ac ]; then autoreconf -i; fi
76-
- cabal configure --enable-tests --enable-benchmarks --ghc-options=-Werror -v2 # -v2 provides useful information for debugging
77-
- cabal build # this builds all libraries and executables (including tests/benchmarks)
78-
- cabal test
79-
- if [ $CABALVER \> 1.18 ]; then cabal check; fi # Cabal 1.18 complains about PatternSynonyms
80-
- cabal haddock # tests that documentation can be generated
81-
- cabal sdist # tests that a source-distribution can be generated
82-
83-
# Check that the resulting source distribution can be built & installed.
84-
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
85-
# `cabal install --force-reinstalls dist/*-*.tar.gz`
86-
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
87-
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
104+
# test that source-distributions can be generated
105+
- (cd "." && cabal sdist)
106+
- mv "."/dist/GLURaw-*.tar.gz ${DISTDIR}/
107+
- cd ${DISTDIR} || false
108+
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
109+
- "printf 'packages: GLURaw-*/*.cabal\\n' > cabal.project"
110+
- cat cabal.project
111+
# this builds all libraries and executables (without tests/benchmarks)
112+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
113+
114+
# Build with installed constraints for packages in global-db
115+
- 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
116+
117+
# build & run tests, build benchmarks
118+
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
119+
120+
# cabal check
121+
- (cd GLURaw-* && cabal check)
122+
123+
# haddock
124+
- rm -rf ./dist-newstyle
125+
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
88126

127+
# REGENDATA ["-o",".travis.yml","GLURaw.cabal"]
89128
# EOF

GLURaw.cabal

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ tested-with:
2525
GHC == 7.8.4
2626
GHC == 7.10.3
2727
GHC == 8.0.2
28-
GHC == 8.1
28+
GHC == 8.2.2
29+
GHC == 8.4.1
30+
GHC == 8.5.*
2931
cabal-version: >= 1.10
3032
extra-source-files:
3133
CHANGELOG.md

0 commit comments

Comments
 (0)