diff --git a/.travis.yml b/.travis.yml index 2500db428d2..f9775899da6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,23 +19,30 @@ before_install: - go get github.com/dghubble/sling - go get github.com/go-resty/resty install: + # Make sure externally referenced packages are go-gettable. - go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway + - go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger - go get github.com/grpc-ecosystem/grpc-gateway/runtime - - go get github.com/grpc-ecosystem/grpc-gateway/examples - - go get github.com/grpc-ecosystem/grpc-gateway/examples/server + - go get github.com/grpc-ecosystem/grpc-gateway/examples/cmd/example-grpc-server + - go get github.com/grpc-ecosystem/grpc-gateway/examples/cmd/example-gateway-server before_script: - sh -c 'cd examples/browser && npm install' script: - if [ "${USE_BAZEL}" = true ]; then ./.travis/bazel-build.sh; fi - if [ "${USE_BAZEL}" = true ]; then ./.travis/bazel-test.sh; fi + + # Make sure examples of generated files are up-to-date - if [ -z "${USE_BAZEL}" ]; then make realclean && make examples SWAGGER_CODEGEN="java -jar $HOME/local/swagger-codegen-cli.jar"; fi - if [ -z "${USE_BAZEL}" ] && (go version | grep -q "${GO_VERSION_TO_DIFF_TEST}") && [ -z "${GATEWAY_PLUGIN_FLAGS}" ]; then test -z "$(git status --porcelain)" || (git status; git diff; exit 1); fi + + # Unit tests, integration tests and code health checks - if [ -z "${USE_BAZEL}" ]; then env GLOG_logtostderr=1 go test -race -v github.com/grpc-ecosystem/grpc-gateway/...; fi - if [ -z "${USE_BAZEL}" ]; then make lint; fi - if [ -z "${USE_BAZEL}" ]; then sh -c 'cd examples/browser && node ./node_modules/gulp/bin/gulp'; fi - if (go version | grep -q "${GO_VERSION_TO_DIFF_TEST}") && [ -z "${GATEWAY_PLUGIN_FLAGS}" ]; then env GLOG_logtostderr=1 ./bin/coverage; fi after_success: - bash <(curl -s https://codecov.io/bash) + env: global: - "PATH=$PATH:$HOME/local/bin"