Skip to content

Commit

Permalink
use protoc3 binaries if possible, make CI faster
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Jul 17, 2018
1 parent b4b3ba3 commit fac8653
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions test/setup_protoc3.sh
@@ -1,9 +1,26 @@
#! /usr/bin/env bash

PROTO3_ROOT=/proto3
mkdir $PROTO3_ROOT

PROTO3_VER=3.6.0
PROTO3_PATH=$PROTO3_ROOT/protobuf-$PROTO3_VER
PROTO3_SRC=https://github.com/google/protobuf/releases/download/v${PROTO3_VER}/protobuf-cpp-${PROTO3_VER}.tar.gz

curl -s -L ${PROTO3_SRC} | tar -C ${PROTO3_ROOT} -x -z -f -
cd ${PROTO3_PATH} && mkdir install && ./autogen.sh && ./configure --prefix=${PROTO3_PATH}/install && make install
if [[ "$OSTYPE" == "linux-gnu" ]]; then
PROTO3_BIN=https://github.com/google/protobuf/releases/download/v${PROTO3_VER}/protoc-${PROTO3_VER}-linux-x86_64.zip
curl -OL $PROTO3_BIN
mkdir -p ${PROTO3_PATH}/install/bin
unzip protoc-${PROTO3_VER}-linux-x86_64.zip -d ${PROTO3_PATH}/install
rm protoc-${PROTO3_VER}-linux-x86_64.zip
elif [[ "$OSTYPE" == "darwin"* ]]; then
PROTO3_BIN=https://github.com/google/protobuf/releases/download/v${PROTO3_VER}/protoc-${PROTO3_VER}-osx-x86_64.zip
curl -OL $PROTO3_BIN
mkdir -p ${PROTO3_PATH}/install/bin
unzip protoc-${PROTO3_VER}-osx-x86_64.zip -d ${PROTO3_PATH}/install
rm protoc-${PROTO3_VER}-osx-x86_64.zip
else
# compile from source
PROTO3_SRC=https://github.com/google/protobuf/releases/download/v${PROTO3_VER}/protobuf-cpp-${PROTO3_VER}.tar.gz
curl -s -L ${PROTO3_SRC} | tar -C ${PROTO3_ROOT} -x -z -f -
cd ${PROTO3_PATH} && mkdir install && ./autogen.sh && ./configure --prefix=${PROTO3_PATH}/install && make install
fi

0 comments on commit fac8653

Please sign in to comment.