This repository has been archived by the owner on Apr 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
/
.travis.yml
68 lines (61 loc) · 1.92 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
language: c
sudo: false
cache:
apt: true
directories:
- $HOME/.stack
- $HOME/.ghc-mod
addons:
apt:
packages:
- libfcgi-dev
- libgmp-dev
before_install:
- unset CC
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
- stack --version
install:
# - git clone --depth=1 https://github.com/DanielG/cabal-helper.git
- stack --no-terminal setup --resolver=ghc-$GHCVER
- stack --no-terminal install cabal-install --resolver=$RES
- travis_retry cabal update
- stack --no-terminal install happy --resolver=$RES
- |
resf="ghc-$GHCVER.yaml"
echo "resolver: ghc-$GHCVER" > "$resf"
echo "packages: ['.']" >> "$resf"
stack --no-terminal solver --update-config --stack-yaml="$resf" || exit 101
sed -i 's/^resolver:/compiler:/;s/^extra-deps:/packages:/' "$resf"
echo "resolver: { name: 'ghc-$GHCVER', location: './$resf' }" > stack.yaml
echo "packages: ['.']" >> stack.yaml
ir=$( stack path --snapshot-install-root )
ls -d ${ir%/custom-ghc-*}/custom-ghc-* | grep -v "${ir%/*}" | while read i; do
rm -rfv "$i"
done
script:
- cabal check
- |
case "$TRAVIS_BRANCH" in
"release"*)
touch ChangeLog
sdistdir="$TRAVIS_BUILD_DIR/../sdist-test"
mkdir -p "$sdistdir"
tar zvxf $(stack sdist 2>&1 | tail -n1 | sed 's/.* //') --strip-components=1 -C "$sdistdir"
cp "ghc-$GHCVER.yaml" stack.yaml "$sdistdir"
cd "$sdistdir"
;;
esac
- stack --no-terminal build --test --no-run-tests
- export DOCTEST_DIST_DIR="$(stack path --dist-dir)"
- stack --no-terminal test
matrix:
matrix:
include:
- env: GHCVER=7.8.4 RES=lts-2.22
compiler: ': #GHC 7.8.4'
- env: GHCVER=7.10.3 RES=lts-6.9
compiler: ': #GHC 7.10.3'
- env: GHCVER=8.0.1 RES=nightly-2016-08-01
compiler: ': #GHC 8.0.1'