Skip to content

Commit

Permalink
Install protobuf on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Sep 10, 2018
1 parent b6dca43 commit 98f0f82
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
language: rust
cache: cargo # https://docs.travis-ci.com/user/caching/#Rust-Cargo-cache

cache:
directories:
- $HOME/.cargo
- $HOME/protobuf
- $TRAVIS_BUILD_DIR/target

rust:
- stable
Expand Down Expand Up @@ -54,3 +59,8 @@ script:
- cargo build --verbose --all-features
- cargo test --verbose --all-features
- cargo doc --verbose --all-features --no-deps

before_install:
- export PATH=$PATH:$HOME/protobuf/bin
- export PROTOC_VERSION=$(cat PROTOC_VERSION)
- bash install_protobuf.sh
1 change: 1 addition & 0 deletions PROTOC_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.5.1
18 changes: 18 additions & 0 deletions install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e

PROTOC_VERSION=$(cat PROTOC_VERSION)

check_protoc_version () {
this_version=`protoc --version`
return `[ "libprotoc $PROTOC_VERSION" = "$this_version" ]`
}

if check_protoc_version; then
echo $PROTOC_VERSION detected.
exit
fi

wget https://github.com/google/protobuf/archive/v$PROTOC_VERSION.tar.gz
tar -xzvf v$PROTOC_VERSION.tar.gz
cd protobuf-$PROTOC_VERSION && ./autogen.sh && ./configure --prefix=$HOME/protobuf && make && make install

0 comments on commit 98f0f82

Please sign in to comment.