diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..395a7a5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +env: + - PROTOBUF_VERSION=3.0.0-beta-2 + +before_install: + - ./install-protobuf.sh + - PATH=/home/travis/bin:$PATH protoc --version + +script: + - PATH=/home/travis/bin:$PATH make buildserverall + - echo $TRAVIS_GO_VERSION + - if [ "$TRAVIS_GO_VERSION" == 1.6 ] && [[ "$PROTOBUF_VERSION" == 3.0.0* ]]; then ! git status --porcelain | read || (git status; git diff; exit 1); fi + +language: go + +go: + - 1.6 diff --git a/install-protobuf.sh b/install-protobuf.sh new file mode 100755 index 0000000..10c9320 --- /dev/null +++ b/install-protobuf.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +die() { + echo "$@" >&2 + exit 1 +} + +case "$PROTOBUF_VERSION" in +2*) + basename=protobuf-$PROTOBUF_VERSION + ;; +3*) + basename=protobuf-cpp-$PROTOBUF_VERSION + ;; +*) + die "unknown protobuf version: $PROTOBUF_VERSION" + ;; +esac + +cd /home/travis + +wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.tar.gz +tar xzf $basename.tar.gz + +cd protobuf-$PROTOBUF_VERSION + +./configure --prefix=/home/travis && make -j2 && make install