Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

fix: [gax-java] Add speedy Bazel builds to Travis #1181

Merged
merged 13 commits into from Sep 15, 2020
32 changes: 25 additions & 7 deletions .travis.yml
Expand Up @@ -6,10 +6,28 @@ addons:
hosts:
- fake-hostname-to-work-around-travis-bug
hostname: fake-hostname-to-work-around-travis-bug
jdk:
- openjdk8
- openjdk7
install: ./gradlew assemble
script: ./gradlew build install
after_success:
- bash <(curl -s https://codecov.io/bash)

jobs:
include:
- name: Java 7 Build
jdk: openjdk7
install: ./gradlew assemble
script: ./gradlew build install
after_success:
- bash <(curl -s https://codecov.io/bash)

- name: Java 8 Build
jdk: openjdk8
before_install:
- wget https://github.com/bazelbuild/bazel/releases/download/3.5.0/bazel_3.5.0-linux-x86_64.deb
- wget https://github.com/bazelbuild/bazel/releases/download/3.5.0/bazel_3.5.0-linux-x86_64.deb.sha256
- sha256sum -c bazel_3.5.0-linux-x86_64.deb.sha256
- sudo dpkg -i bazel_3.5.0-linux-x86_64.deb
miraleung marked this conversation as resolved.
Show resolved Hide resolved
install: ./gradlew assemble
script:
- ./gradlew build install
# The Bazel flags below are the best we can do to optimize build speed, since caching on Travis
# is suboptimal for various reasons (see https://kevin.burke.dev/kevin/bazel-tests-on-travis-ci/).
- bazel --batch test //... --noshow_progress --test_output=errors
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 2 additions & 0 deletions dependencies.properties
Expand Up @@ -26,6 +26,7 @@ version.gax_httpjson=0.75.3-SNAPSHOT
version.com_google_protobuf=3.12.2
version.google_java_format=1.1
version.io_grpc=1.30.0
version.bazel_skylib=1.0.3

# Maven artifacts.
# Note, the actual name of each property matters (bazel build scripts depend on it).
Expand All @@ -45,6 +46,7 @@ maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.2
maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.3.4
maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:1.3
maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.4
maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.7.2
maven.com_google_api_api_common=com.google.api:api-common:1.9.3
maven.org_threeten_threetenbp=org.threeten:threetenbp:1.4.1
maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:0.13.0
Expand Down
3 changes: 2 additions & 1 deletion gax-grpc/BUILD.bazel
@@ -1,4 +1,4 @@
load("//:gax_java.bzl", "java_tests", "google_java_format", "google_java_format_verification")
load("//:gax_java.bzl", "google_java_format", "google_java_format_verification", "java_tests")

_JAVA_COPTS = [
"-source",
Expand All @@ -21,6 +21,7 @@ _COMPILE_DEPS = [
"@com_google_api_grpc_proto_google_common_protos//jar",
"@com_google_api_api_common//jar",
"@com_google_auto_value_auto_value//jar",
"@com_google_auto_value_auto_value_annotations//jar",
"@com_google_http_client_google_http_client//jar",
"@io_grpc_grpc_java//context:context",
"@io_grpc_grpc_netty_shaded//jar",
Expand Down
5 changes: 3 additions & 2 deletions gax-httpjson/BUILD.bazel
@@ -1,4 +1,4 @@
load("//:gax_java.bzl", "java_tests", "google_java_format", "google_java_format_verification")
load("//:gax_java.bzl", "google_java_format", "google_java_format_verification", "java_tests")

_JAVA_COPTS = [
"-source",
Expand All @@ -17,6 +17,7 @@ _COMPILE_DEPS = [
"@com_google_auth_google_auth_library_credentials//jar",
"@com_google_api_api_common//jar",
"@com_google_auto_value_auto_value//jar",
"@com_google_auto_value_auto_value_annotations//jar",
"@com_google_http_client_google_http_client_jackson2//jar",
"@javax_annotation_javax_annotation_api//jar",
"//gax:gax",
Expand All @@ -27,7 +28,7 @@ _TEST_COMPILE_DEPS = [
"@org_mockito_mockito_core//jar",
"@com_google_truth_truth//jar",
"//gax:gax_testlib",
"@com_googlecode_java_diff_utils_diffutils//jar",
"@com_googlecode_java_diff_utils_diffutils//jar",
]

java_library(
Expand Down
3 changes: 2 additions & 1 deletion gax/BUILD.bazel
@@ -1,4 +1,4 @@
load("//:gax_java.bzl", "java_tests", "google_java_format", "google_java_format_verification")
load("//:gax_java.bzl", "google_java_format", "google_java_format_verification", "java_tests")

_JAVA_COPTS = [
"-source",
Expand All @@ -12,6 +12,7 @@ _COMPILE_DEPS = [
"@com_google_auth_google_auth_library_credentials//jar",
"@com_google_auth_google_auth_library_oauth2_http//jar",
"@com_google_auto_value_auto_value//jar",
"@com_google_auto_value_auto_value_annotations//jar",
"@com_google_code_findbugs_jsr305//jar",
"@com_google_guava_guava//jar",
"@io_opencensus_opencensus_api//jar",
Expand Down
5 changes: 3 additions & 2 deletions repositories.bzl
Expand Up @@ -64,11 +64,12 @@ def com_google_api_gax_java_repositories():
strip_prefix = "grpc-java-%s" % _grpc_version,
)

_bazel_skylib_version = PROPERTIES["version.bazel_skylib"]
_maybe(
http_archive,
name = "bazel_skylib",
strip_prefix = "bazel-skylib-0.7.0",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.7.0.zip"],
strip_prefix = "bazel-skylib-%s" % _bazel_skylib_version,
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/%s.zip" % _bazel_skylib_version],
)

_maybe(
Expand Down