Skip to content

Commit e59d940

Browse files
committed
Use make_travis_yml to generate .travis.yml
1 parent 45081c2 commit e59d940

File tree

2 files changed

+106
-82
lines changed

2 files changed

+106
-82
lines changed

.travis.yml

Lines changed: 91 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,101 @@
1-
# It seems that we can't use the CABALVER and GHCVER environment variables in a
2-
# toplevel addons.apt.packages section, so we have to duplicate things below.
1+
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
2+
language: c
3+
sudo: false
4+
5+
cache:
6+
directories:
7+
- $HOME/.cabsnap
8+
- $HOME/.cabal/packages
9+
10+
before_cache:
11+
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
12+
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
13+
314
matrix:
415
include:
5-
- env: CABALVER=1.16 GHCVER=7.0.4
6-
addons:
7-
apt:
8-
sources:
9-
- hvr-ghc
10-
packages:
11-
- cabal-install-1.16
12-
- ghc-7.0.4
13-
- env: CABALVER=1.16 GHCVER=7.2.2
14-
addons:
15-
apt:
16-
sources:
17-
- hvr-ghc
18-
packages:
19-
- cabal-install-1.16
20-
- ghc-7.2.2
21-
- env: CABALVER=1.16 GHCVER=7.4.2
22-
addons:
23-
apt:
24-
sources:
25-
- hvr-ghc
26-
packages:
27-
- cabal-install-1.16
28-
- ghc-7.4.2
29-
- env: CABALVER=1.16 GHCVER=7.6.3
30-
addons:
31-
apt:
32-
sources:
33-
- hvr-ghc
34-
packages:
35-
- cabal-install-1.16
36-
- ghc-7.6.3
37-
- env: CABALVER=1.20 GHCVER=7.8.4
38-
addons:
39-
apt:
40-
sources:
41-
- hvr-ghc
42-
packages:
43-
- cabal-install-1.20
44-
- ghc-7.8.4
45-
- env: CABALVER=1.22 GHCVER=7.10.3
46-
addons:
47-
apt:
48-
sources:
49-
- hvr-ghc
50-
packages:
51-
- cabal-install-1.22
52-
- ghc-7.10.3
53-
- env: CABALVER=1.24 GHCVER=8.0.1
54-
addons:
55-
apt:
56-
sources:
57-
- hvr-ghc
58-
packages:
59-
- cabal-install-1.24
60-
- ghc-8.0.1
61-
- env: CABALVER=head GHCVER=head
62-
addons:
63-
apt:
64-
sources:
65-
- hvr-ghc
66-
packages:
67-
- cabal-install-head
68-
- ghc-head
16+
- env: CABALVER=1.16 GHCVER=7.0.4
17+
compiler: ": #GHC 7.0.4"
18+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}}
19+
- env: CABALVER=1.16 GHCVER=7.2.2
20+
compiler: ": #GHC 7.2.2"
21+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2], sources: [hvr-ghc]}}
22+
- env: CABALVER=1.16 GHCVER=7.4.2
23+
compiler: ": #GHC 7.4.2"
24+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
25+
- env: CABALVER=1.16 GHCVER=7.6.3
26+
compiler: ": #GHC 7.6.3"
27+
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
28+
- env: CABALVER=1.18 GHCVER=7.8.4
29+
compiler: ": #GHC 7.8.4"
30+
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
31+
- env: CABALVER=1.22 GHCVER=7.10.3
32+
compiler: ": #GHC 7.10.3"
33+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
34+
- env: CABALVER=1.24 GHCVER=8.0.1
35+
compiler: ": #GHC 8.0.1"
36+
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
37+
- env: CABALVER=head GHCVER=head
38+
compiler: ": #GHC head"
39+
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
40+
6941
allow_failures:
70-
- env: CABALVER=head GHCVER=head
42+
- env: CABALVER=head GHCVER=head
7143

72-
sudo: false
44+
before_install:
45+
- unset CC
46+
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
7347

74-
# The packages from the PPA don't put this into the PATH automatically.
7548
install:
76-
- export PATH="/opt/cabal/$CABALVER/bin:/opt/ghc/$GHCVER/bin:$PATH"
77-
78-
before_script:
7949
- cabal --version
80-
- cabal update
81-
- ghc --version
82-
- ghc-pkg list
50+
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
51+
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
52+
then
53+
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
54+
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
55+
fi
56+
- travis_retry cabal update -v
57+
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
58+
- cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
59+
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
60+
61+
# check whether current requested install-plan matches cached package-db snapshot
62+
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
63+
then
64+
echo "cabal build-cache HIT";
65+
rm -rfv .ghc;
66+
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
67+
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
68+
else
69+
echo "cabal build-cache MISS";
70+
rm -rf $HOME/.cabsnap;
71+
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
72+
cabal install --only-dependencies --enable-tests --enable-benchmarks;
73+
fi
8374

75+
# snapshot package-db on cache miss
76+
- if [ ! -d $HOME/.cabsnap ];
77+
then
78+
echo "snapshotting package-db to build-cache";
79+
mkdir $HOME/.cabsnap;
80+
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
81+
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
82+
fi
83+
84+
# Here starts the actual work to be performed for the package under test;
85+
# any command which exits with a non-zero exit code causes the build to fail.
8486
script:
85-
- cabal install --enable-documentation
86-
- cabal sdist
87+
- if [ -f configure.ac ]; then autoreconf -i; fi
88+
- cabal configure --enable-tests --enable-benchmarks --ghc-options=-Werror -v2 # -v2 provides useful information for debugging
89+
- cabal build # this builds all libraries and executables (including tests/benchmarks)
90+
- cabal test
91+
- cabal check
92+
- cabal haddock # tests that documentation can be generated
93+
- cabal sdist # tests that a source-distribution can be generated
94+
95+
# Check that the resulting source distribution can be built & installed.
96+
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
97+
# `cabal install --force-reinstalls dist/*-*.tar.gz`
98+
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
99+
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
87100

88-
after_script:
89-
- ghc-pkg list
101+
# EOF

StateVar.cabal

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,19 @@ author: Sven Panne and Edward Kmett
1313
maintainer: Sven Panne <[email protected]>
1414
category: Data
1515
build-type: Simple
16-
cabal-version: >=1.10
17-
extra-source-files: README.md CHANGELOG.md
16+
cabal-version: >= 1.10
17+
tested-with:
18+
GHC == 7.0.4
19+
GHC == 7.2.2
20+
GHC == 7.4.2
21+
GHC == 7.6.3
22+
GHC == 7.8.4
23+
GHC == 7.10.3
24+
GHC == 8.0.1
25+
GHC == 8.1
26+
extra-source-files:
27+
README.md
28+
CHANGELOG.md
1829

1930
library
2031
exposed-modules:
@@ -36,7 +47,8 @@ library
3647

3748
hs-source-dirs: src
3849
ghc-options: -Wall
39-
50+
if impl(ghc > 8)
51+
ghc-options: -Wcompat
4052
if impl(ghc>=7.4)
4153
-- other-extensions: DefaultSignatures
4254
cpp-options: -DUSE_DEFAULT_SIGNATURES=1

0 commit comments

Comments
 (0)