Skip to content

Commit e5d6442

Browse files
l46kokcopybara-github
authored andcommitted
Parallelize github actions workflow for Java8 builds
PiperOrigin-RevId: 933307920
1 parent 54acafe commit e5d6442

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

.bazelrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
common --enable_bzlmod
22
# Use built-in protoc
3-
common --incompatible_enable_proto_toolchain_resolution --@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc
3+
common --incompatible_enable_proto_toolchain_resolution
4+
common --@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc=true
45

6+
# Ensure that we don't accidentally build protobuf or gRPC
7+
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
8+
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
9+
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
10+
common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
511
build --java_runtime_version=remotejdk_11
612
build --java_language_version=11
713

.github/workflows/workflow.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ jobs:
4040
- name: Cross-artifact Duplicate Classes Check
4141
run: .github/workflows/cross_artifact_dependencies_check.sh
4242
- run: echo "🍏 This job's status is ${{ job.status }}."
43-
Bazel-Tests:
43+
44+
Bazel-Build-Java8:
4445
runs-on: ubuntu-latest
4546
timeout-minutes: 30
4647
steps:
@@ -64,6 +65,30 @@ jobs:
6465
run: bazelisk --version
6566
- name: Java 8 Build
6667
run: bazel build ... --java_language_version=8 --java_runtime_version=8 --build_tag_filters=-conformance_maven
68+
- run: echo "🍏 This job's status is ${{ job.status }}."
69+
70+
Bazel-Tests:
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 30
73+
steps:
74+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
75+
- run: echo "🐧 Job is running on a ${{ runner.os }} server!"
76+
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
77+
- name: Check out repository code
78+
uses: actions/checkout@v6
79+
- name: Setup Bazel
80+
uses: bazel-contrib/setup-bazel@0.18.0
81+
with:
82+
# Avoid downloading Bazel every time.
83+
bazelisk-cache: true
84+
# Store build cache per workflow.
85+
disk-cache: ${{ github.workflow }}
86+
# Share repository cache between workflows.
87+
repository-cache: true
88+
# Prevent PRs from polluting cache
89+
cache-save: ${{ github.event_name != 'pull_request' }}
90+
- name: Bazel Output Version
91+
run: bazelisk --version
6792
- name: Bazel Test
6893
# Exclude codelab exercises as they are intentionally made to fail
6994
# Exclude maven conformance tests. They are only executed when there's version change.

java_lite_proto_cel_library_impl.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This is an implementation detail. Clients should use 'java_lite_proto_cel_librar
2020
load("@rules_java//java:defs.bzl", "java_library")
2121
load("//publish:cel_version.bzl", "CEL_VERSION")
2222
load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
23-
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
23+
load("@com_google_protobuf//bazel:proto_info.bzl", "ProtoInfo")
2424

2525
def java_lite_proto_cel_library_impl(
2626
name,

0 commit comments

Comments
 (0)