-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
89 lines (82 loc) · 3.07 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
78
79
80
81
82
83
84
85
86
87
88
89
sudo: false
language: haskell
before_install:
- if [ $STACK ]; then 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';
else export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH;
fi
install:
- $STACK || if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; then zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz
> $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; ls -l $HOME/.cabal/packages/hackage.haskell.org/;
fi; cabal update; sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config; if [ -n "$CABALCONFIG"
]; then cp $CABALCONFIG cabal.config; fi; if [ -n "$STACKAGESNAPSHOT" ]; then curl
--silent https://www.stackage.org/$STACKAGESNAPSHOT/cabal.config | grep -v "$(cabal
info . -v0 | head -n 1 | awk '{ print $2 }' | sed -E 's/-[0-9]+(\.[0-9]+)+//') =="
> cabal.config; fi; cabal install --only-dependencies $CABALCONFOPTS --dry -v >
installplan.txt; sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt;
if diff -u $HOME/.cabsnap/installplan.txt installplan.txt; then echo "cabal build-cache
HIT"; rm -rfv .ghc; cp -av $HOME/.cabsnap/ghc $HOME/.ghc; cp -av $HOME/.cabsnap/lib
$HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; else echo "cabal build-cache
MISS"; rm -rf $HOME/.cabsnap; mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share
$HOME/.cabal/bin; cabal install --only-dependencies $CABALCONFOPTS; fi; if [ ! -d
$HOME/.cabsnap ]; then echo "snapshotting package-db to build-cache"; mkdir $HOME/.cabsnap;
cp -av $HOME/.ghc $HOME/.cabsnap/ghc; cp -av $HOME/.cabal/lib $HOME/.cabal/share
$HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; fi;
script:
- if [ $STACK ]; then stack -j2 --no-terminal --install-ghc test;
else cabal configure $CABALCONFOPTS -v2 && cabal build $CABALBUILDOPTS && cabal test;
fi
matrix:
fast_finish: true
include:
- env: GHCVER=7.10.3 CABALVER=1.22
addons:
apt:
sources:
- hvr-ghc
packages:
- cabal-install-1.22
- ghc-7.10.3
- libgmp-dev
compiler: ! ': # ghc-7.10.3 cabal-1.22'
- env: GHCVER=8.0.1 CABALVER=1.24
addons:
apt:
sources:
- hvr-ghc
packages:
- cabal-install-1.24
- ghc-8.0.1
- libgmp-dev
compiler: ! ': # ghc-8.0.1 cabal-1.24'
- env: GHCVER=head CABALVER=1.24
addons:
apt:
sources:
- hvr-ghc
packages:
- cabal-install-1.24
- ghc-head
- libgmp-dev
compiler: ! ': # ghc-head cabal-1.24'
- env: STACK=YES
addons:
apt:
sources:
- hvr-ghc
packages:
- libgmp-dev
compiler: ! ': # Stack LTS'
allow_failures:
- env: GHCVER=head CABALVER=1.24
branches:
only:
- master
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
cache:
directories:
- $HOME/.stack
- $HOME/.cabsnap
- $HOME/.cabal/packages