-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
82 lines (72 loc) · 2.79 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
# See https://github.com/hvr/multi-ghc-travis for more information
language: c
dist: trusty
sudo: false
addons:
apt:
sources: &apt_sources
- hvr-ghc
packages: &apt_packages
- build-essential
- autoconf
- libtool
- libgflags-dev
- libgtest-dev
- libc++-dev
# for c2hs
- alex-3.1.7
- happy-1.19.5
cache:
directories:
- $HOME/.cabal/lib
- $HOME/.cabal/packages
- $HOME/.cabal/share
- $HOME/.cabal/store
matrix:
include:
- env: CABALVER=1.24 GHCVER=7.10.3
addons: {apt: {packages: [*apt_packages, cabal-install-1.24, ghc-7.10.3], sources: [*apt_sources]}}
- env: CABALVER=1.24 GHCVER=8.0.2
addons: {apt: {packages: [*apt_packages, cabal-install-1.24, ghc-8.0.2], sources: [*apt_sources]}}
- env: CABALVER=head GHCVER=head
addons: {apt: {packages: [*apt_packages, cabal-install-head, ghc-head], sources: [*apt_sources]}}
allow_failures:
- env: CABALVER=head GHCVER=head
before_install:
- export PATH=/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- (which alex; which happy; which ghc; which cabal)
- (ghc --version; cabal --version)
- travis_retry cabal update
# Unfortunately it seems we have to fetch the full repository to be able to
# clone it to create our workspace. We would be OK with a shallow repository
# if we could make git to clone it.
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
install:
- mkdir workspace
- envsubst < cabal.project.travis > workspace/cabal.project
- cd workspace
- git clone --depth=1 .. grpc-haskell
- git clone --depth=1 https://github.com/haskell/c2hs
- (cd c2hs; git log -1; cabal install --prefix=$TRAVIS_BUILD_DIR/workspace/local)
- export PATH=$TRAVIS_BUILD_DIR/workspace/local/bin:$PATH
- which c2hs
- git clone --depth=1 --recursive https://github.com/grpc/grpc grpc
# reduce memory footprint with -jN. Using more memory may cause failures.
- (cd grpc; git log -1; make shared_c static_c -j2)
# build haskell library/executables as early as we can
- cabal new-build --only-dependencies grpc
# only then build the time consuming interop_server.
# reduce memory footprint with -jN. Using more memory may cause failures.
- (cd grpc; make interop_server -j2)
# launch interop_server in the background
- (grpc/bins/opt/interop_server --port=5050 &)
script:
- cabal new-build -v grpc
# run the haskell interop client against the C++ server.
# cabal-install doesn't yet have nix-style 'cabal run', find executable by hand.
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/workspace/grpc/libs/opt:LD_LIBRARY_PATH
- dist-newstyle/build/grpc-*/build/interop_client/interop_client --server_host=localhost --server_port=5050 --test_case=all
notifications:
email:
- kolmodin@google.com