-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
58 lines (53 loc) · 1.79 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
env:
- CABALVER=1.24 GHCVER=8.0.2 # Debian 9
- CABALVER=1.24 GHCVER=8.2.2
- CABALVER=2.2 GHCVER=8.4.4 # Debian 10
- CABALVER=2.4 GHCVER=8.6.5
- CABALVER=3.0 GHCVER=8.8.3
- CABALVER=3.2 GHCVER=8.10.1
- CABALVER=head GHCVER=head
language: generic
matrix:
allow_failures:
- env: GHCVER=head CABALVER=head
before_install:
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install "cabal-install-$CABALVER" "ghc-$GHCVER"
- PATH="/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH"
install:
- cabal --version
- ghc --version
- ghc --print-project-git-commit-id 2> /dev/null || true
- travis_retry cabal update
# For pre-3.0, need to install dependencies before configuring
- cabal install --only-dependencies --enable-tests --enable-benchmarks || true
script:
- cabal configure --enable-tests --enable-benchmarks -v2
- |
if [[ $CABALVER = [12]* ]]; then
cabal build --ghc-options=-Werror
else
# https://github.com/haskell/cabal/issues/3883
printf "package Glob\n ghc-options: -Werror\n" >> cabal.project
cabal build
fi
- cabal test
- cabal haddock
- cabal check
- cabal sdist
- |
SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}')
cd dist-newstyle/sdist || cd dist
if [[ -f "$SRC_TGZ" ]]; then
if cabal --version | grep -q 'version 3.[0-3]'; then
# https://github.com/haskell/cabal/issues/6393
echo >&2 "cabal v2-install broke tarball installs, fixed in 3.4"
echo >&2 "Will not test sdist installability"
else
cabal install --force-reinstalls "$SRC_TGZ"
fi
else
echo >&2 "$SRC_TGZ not found"
exit 1
fi