forked from google/proto-lens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (68 loc) · 2.88 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
# Use a lightweight base image; we provide our own build tools.
language: c
# Docker builds make GHC much slower for some reason:
# https://github.com/travis-ci/travis-ci/issues/5623
sudo: true
cache:
timeout: 600 # 10 minutes
directories:
- $HOME/.ghc
- $HOME/.stack
- $HOME/.cabal
matrix:
include:
- env: BUILD=cabal GHCVER=8.4.4 CABALVER=2.2
addons: {apt: {packages: [cabal-install-2.2, ghc-8.4.4], sources: [hvr-ghc]}}
- env: BUILD=cabal GHCVER=8.6.5 CABALVER=2.4
addons: {apt: {packages: [cabal-install-2.4, ghc-8.6.5], sources: [hvr-ghc]}}
# TODO: switch everything to cabal new-build
- env: BUILD=cabal-new GHCVER=8.6.5 CABALVER=2.4
addons: {apt: {packages: [cabal-install-2.4, ghc-8.6.5], sources: [hvr-ghc]}}
- env: BUILD=stack STACK='stack --resolver=lts-12.26'
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack STACK='stack' # Use the resolver in stack.yaml
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack STACK='stack --stack-yaml=stack-8.8.yaml'
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack STACK='stack --stack-yaml=stack-8.10.yaml'
addons: {apt: {packages: [libgmp-dev]}}
before_install:
- mkdir -p $HOME/.local/bin
- case "$BUILD" in
stack)
export PATH=/opt/ghc/$GHCVER/bin:$HOME/.local/bin:$PATH;;
cabal)
export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH;;
cabal-new)
export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH;;
esac
- curl -L https://github.com/commercialhaskell/stack/releases/download/v2.3.1/stack-2.3.1-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C $HOME/.local/bin '*/stack'
- curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip > protoc-release.zip
- unzip -p protoc-release.zip bin/protoc > $HOME/.local/bin/protoc
- chmod a+x $HOME/.local/bin/protoc
- rm protoc-release.zip
install:
- case "$BUILD" in
stack)
$STACK setup --no-terminal;
$STACK build --no-terminal happy;
$STACK build --only-dependencies --no-terminal;;
cabal)
cabal update;;
esac
script:
# Separate stack's build and test commands, since build by itself hits some
# edge cases around custom Setup.hs script dependencies.
# Also build the tutorial, with proto-lens-* as extra-deps. Note that
# since stack is not hermetic, the extra-deps for the tutorial reuse some
# build outputs from the regular build.
- case "$BUILD" in
stack)
STACK_ARGS=(--haddock --no-haddock-deps);
$STACK build --bench --no-run-benchmarks "${STACK_ARGS[@]}" && $STACK test "${STACK_ARGS[@]}" &&
(cd proto-lens-tutorial && $STACK build "${STACK_ARGS[@]}");;
cabal)
./travis-cabal.sh;;
cabal-new)
./travis-cabal-new.sh;;
esac