-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.travis.yml
54 lines (52 loc) · 1.55 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
env:
- ghc=7.6.1 cabal=1.18 lower_bound_dependencies=1
- ghc=7.8.1 cabal=1.18
- ghc=7.10.1 cabal=1.22
- ghc=8.0.1 cabal=1.24 benchmarks=1 tests=1
install:
# Set up the Shell to treat the semicolon as &&
- set -o pipefail && set -e
# Install GHC and Cabal
-
ghc=${ghc=7.10.1};
cabal=${cabal=1.22};
travis_retry sudo add-apt-repository -y ppa:hvr/ghc;
travis_retry sudo apt-get update;
travis_retry sudo apt-get install cabal-install-$cabal ghc-$ghc;
export PATH=/opt/ghc/$ghc/bin:/opt/cabal/$cabal/bin:$PATH;
# Update the Cabal database
- cabal update
# Switch to the distro:
-
export pkg_name=$(cabal info . | awk '{print $2;exit}');
cabal sdist;
cd dist;
tar xzvf $pkg_name.tar.gz;
cd $pkg_name;
# Install the lower bound dependencies
-
if [ "$lower_bound_dependencies" = "1" ];
then
constraint_options=(
"--constraint=transformers==0.2.*"
);
fi;
# Install the library dependencies
- cabal install --only-dependencies --reorder-goals --force-reinstalls
${constraint_options[@]}
$([ "$tests" = "1" ] && echo "--enable-tests")
$([ "$benchmarks" = "1" ] && echo "--enable-benchmarks")
# Build the library
- travis_wait cabal build
# Configure and build the remaining stuff
- cabal configure
$([ "$tests" = "1" ] && echo "--enable-tests")
$([ "$benchmarks" = "1" ] && echo "--enable-benchmarks")
-f doctest
- cabal build
script:
- |
if [ "$tests" = "1" ];
then
travis_wait cabal test --show-details=always;
fi;