forked from haskell/directory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
77 lines (73 loc) · 2.6 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# we want to use our custom environment, but the Travis YAML validator
# requires this field to be specified, so we'll just use 'c'
language: c
env:
# we have to use CABALVER=1.16 for GHC<7.6 as well, as there's
# no package for earlier cabal versions in the PPA
- GHCVER=7.4.1 CABALVER=1.16
- GHCVER=7.4.2 CABALVER=1.16
- GHCVER=7.6.3 CABALVER=1.16
- GHCVER=7.8.3 CABALVER=1.18
- GHCVER=7.10.1 CABALVER=1.22
- 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
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- cabal --version
install:
- travis_retry cabal update
- cabal install --enable-tests --only-dependencies
- ghc --version
before_script:
- | # check if 'streaming' is supported (didn't exist until 1.20)
if cabal 2>&1 test --show-details=streaming __dummy |
grep >/dev/null 2>&1 "cabal: --show-details flag expects"
then streaming=always
else streaming=streaming
fi
export streaming
- | # skip cabal test on HEAD due to this bug:
# https://github.com/haskell/cabal/issues/1938
# this is fine as the test will be run during installation anyway
if [ "$CABALVER" = head ]
then def_cabal_test='cabal_test() {
echo "warning: cabal test skipped due to Cabal bug #1938"
}'
else def_cabal_test='cabal_test() {
cabal test "$@"
}'
fi
export def_cabal_test
- | # check if '--run-tests' is supported (didn't exist until 1.20);
# tests must be run prior to install as packages may be broken by install
if cabal 2>&1 install --run-tests __dummy |
grep >/dev/null 2>&1 "cabal: unrecognized option"
then def_cabal_install_run_tests='cabal_install_run_tests() {
tgz=$1
shift
tmp=cabal-install-run-tests.tmp
mkdir -p "$tmp"
( cd "$tmp" && tar xzf - ) <"$tgz"
( cd "$tmp"/* &&
cabal configure --enable-tests &&
cabal build &&
cabal test )
cabal install "$@" "$tgz"
}'
else def_cabal_install_run_tests='cabal_install_run_tests() {
cabal install --run-tests "$@" "$1"
}'
fi
export def_cabal_install_run_tests
script:
- autoreconf -i
- cabal configure -v2 --enable-tests
- cabal build
- cabal check
- cabal sdist
- eval "$def_cabal_test" &&
cabal_test --show-details=$streaming --test-option="+RTS -N2"
- eval "$def_cabal_install_run_tests" &&
cabal_install_run_tests --force-reinstalls dist/*-*.tar.gz