Skip to content

Commit e8f051e

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

3 files changed

Lines changed: 17 additions & 8 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: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
Static-Checks:
18+
Bazel-Build-Java8:
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 30
2121
steps:
2222
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
2323
- run: echo "🐧 Job is running on a ${{ runner.os }} server!"
24-
- run: echo "🔎 The name of your branch is ${GITHUB_REF} and your repository is ${{ github.repository }}."
24+
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
2525
- name: Check out repository code
2626
uses: actions/checkout@v6
2727
- name: Setup Bazel
@@ -33,13 +33,18 @@ jobs:
3333
disk-cache: ${{ github.workflow }}
3434
# Share repository cache between workflows.
3535
repository-cache: true
36-
# Never write to the cache, strictly read-only
37-
cache-save: false
36+
# Prevent PRs from polluting cache
37+
cache-save: ${{ github.event_name != 'pull_request' }}
38+
- name: Bazel Output Version
39+
run: bazelisk --version
40+
- name: Java 8 Build
41+
run: bazel build ... --java_language_version=8 --java_runtime_version=8 --build_tag_filters=-conformance_maven
3842
- name: Unwanted Dependencies
3943
run: .github/workflows/unwanted_deps.sh
4044
- name: Cross-artifact Duplicate Classes Check
4145
run: .github/workflows/cross_artifact_dependencies_check.sh
4246
- run: echo "🍏 This job's status is ${{ job.status }}."
47+
4348
Bazel-Tests:
4449
runs-on: ubuntu-latest
4550
timeout-minutes: 30
@@ -62,8 +67,6 @@ jobs:
6267
cache-save: ${{ github.event_name != 'pull_request' }}
6368
- name: Bazel Output Version
6469
run: bazelisk --version
65-
- name: Java 8 Build
66-
run: bazel build ... --java_language_version=8 --java_runtime_version=8 --build_tag_filters=-conformance_maven
6770
- name: Bazel Test
6871
# Exclude codelab exercises as they are intentionally made to fail
6972
# 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/common:proto_info.bzl", "ProtoInfo")
2424

2525
def java_lite_proto_cel_library_impl(
2626
name,

0 commit comments

Comments
 (0)