grpcio 0.4.2

The rust language implementation of gRPC, base on the gRPC c core library.
dist: trusty
sudo: false
language: rust
cache:
  directories:
    - $HOME/.cargo
    - $HOME/.cache
    - $TRAVIS_BUILD_DIR/target
before_cache:
  - find $TRAVIS_BUILD_DIR/target/debug -maxdepth 1 -type f -delete

env:
  global:
    - RUST_BACKTRACE=1
    - RUSTFLAGS="--deny=warnings"

os:
  - linux
rust:
  - stable
  - beta
  - nightly
matrix:
  include:
  - os: osx
    rust: stable

before_script:
  - export GRPC_VERSION=1.17.2
  - export PATH="$PATH:$HOME/.cache/bin:$HOME/.cargo/bin"
  - GRPC_HEADER="$HOME/.cache/include/grpc/grpc.h"
  - if [[ $TRAVIS_OS_NAME == "osx" ]] && [[ ! -f $GRPC_HEADER ]]; then
      export CC=clang;
      brew update && brew install autoconf libtool shtool;
    fi
  - if [[ $TRAVIS_OS_NAME == "osx" ]]; then
      brew update && brew install openssl;
      export OPENSSL_ROOT_DIR=$(brew --prefix openssl);
    else
      sudo apt-get update && sudo apt-get -y install libssl-dev;
    fi
  - if [[ ! -f "$GRPC_HEADER" ]] ; then
      (
        git clone -b v$GRPC_VERSION https://github.com/grpc/grpc &&
        cd grpc &&
        git submodule update --init &&
        env prefix=$HOME/.cache make install_c
      );
    fi
  - export CPLUS_INCLUDE_PATH="$HOME/.cache/include"
  - export LD_LIBRARY_PATH="$HOME/.cache/lib"
  - export DYLD_LIBRARY_PATH="$HOME/.cache/lib"
  - export LIBRARY_PATH="$HOME/.cache/lib"
  - export PKG_CONFIG_PATH="$HOME/.cache/lib/pkgconfig"

script:
  - if [[ $TRAVIS_RUST_VERSION == "stable" ]]; then rustup component add clippy-preview && cargo clippy --all -- -D clippy::all; fi
  - if [[ $TRAVIS_RUST_VERSION == "stable" ]]; then rustup component add rustfmt-preview && cargo fmt --all -- --check; fi
  - cargo build --no-default-features
  - cargo build --no-default-features --features protobuf-codec
  - cargo build
  - cargo test --all
  - GRPCIO_SYS_USE_PKG_CONFIG=1 cargo test --all
  - cargo test --features "openssl" --all