Skip to content

Commit

Permalink
Configure Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yugui committed Jun 2, 2016
1 parent 0f57083 commit 1532c8c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 14 deletions.
42 changes: 29 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
branches:
only:
- master
language: go
sudo: false
go:
- 1.6.2
- tip
cache:
directories:
- $HOME/local
- /tmp/bazel_travis

matrix:
include:
- language: go
go: 1.6.2
env:
- USE_BAZEL=false
- language: go
go: tip
env:
- USE_BAZEL=false
- language: java
jdk: oraclejdk8
env:
- USE_BAZEL=true

before_install:
- ./.travis.build-protoc.sh 3.0.0-beta-3
- go get github.com/golang/lint/golint
- $USE_BAZEL || .travis/build-protoc.sh 3.0.0-beta-3
- $USE_BAZEL || go get github.com/golang/lint/golint
- $USE_BAZEL && .travis/install-bazel.sh 0.2.3
install:
- go get github.com/gengo/grpc-gateway/protoc-gen-grpc-gateway
- go get github.com/gengo/grpc-gateway/runtime
- go get github.com/gengo/grpc-gateway/examples
- go get github.com/gengo/grpc-gateway/examples/server
- $USE_BAZEL || go get github.com/gengo/grpc-gateway/protoc-gen-grpc-gateway
- $USE_BAZEL || go get github.com/gengo/grpc-gateway/runtime
- $USE_BAZEL || go get github.com/gengo/grpc-gateway/examples
- $USE_BAZEL || go get github.com/gengo/grpc-gateway/examples/server
script:
- if $USE_BAZEL; then bazel test //...; exit $?; fi

- make realclean && make examples
- if ! go version | grep devel; then test -z "$(git status --porcelain)" || (git status; git diff; exit 1); fi
- env GLOG_logtostderr=1 go test -race -v github.com/gengo/grpc-gateway/...
- golint github.com/gengo/grpc-gateway/protoc-gen-grpc-gateway/...
- golint github.com/gengo/grpc-gateway/runtime/...
- golint github.com/gengo/grpc-gateway/utilities/...
- golint -set_exit_status github.com/gengo/grpc-gateway/protoc-gen-grpc-gateway/...
- golint -set_exit_status github.com/gengo/grpc-gateway/runtime/...
- golint -set_exit_status github.com/gengo/grpc-gateway/utilities/...
- go vet github.com/gengo/grpc-gateway/protoc-gen-grpc-gateway/...
- go vet github.com/gengo/grpc-gateway/runtime/... || true
- go vet github.com/gengo/grpc-gateway/utilities/...
Expand Down
2 changes: 1 addition & 1 deletion .travis.build-protoc.sh → .travis/build-protoc.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh -eu
protoc_version=$1
if test -z "${protoc_version}"; then
echo "Usage: .travis.build-protoc.sh protoc-version"
echo "Usage: .travis/build-protoc.sh protoc-version"
exit 1
fi
if ! $HOME/local/bin/protoc-${protoc_version} --version 2>/dev/null; then
Expand Down
15 changes: 15 additions & 0 deletions .travis/install-bazel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -eu
bazel_version=$1
if test -z "${bazel_version}"; then
echo "Usage: .travis/install-bazel.sh bazel-version"
exit 1
fi
if ! $HOME/local/bin/bazel version 2>/dev/null | grep "Build label ${bazel_version}"; then
rm -rf $HOME/local
wget "https://github.com/bazelbuild/bazel/releases/download/${bazel_version}/bazel-${bazel_version}-installer-linux-x86_64.sh"
bash ./bazel-${bazel_version}-installer-linux-x86_64.sh --user --prefix=$HOME/local --bin=$HOME/local/bin
fi

echo \$ $HOME/local/bin/bazel version
$HOME/local/bin/bazel version

0 comments on commit 1532c8c

Please sign in to comment.