From 6df0109c9a0c141830f5efda2408da55915a5b82 Mon Sep 17 00:00:00 2001 From: chingor13 Date: Mon, 20 Apr 2026 23:50:33 +0000 Subject: [PATCH 1/7] ci: clean up sdk-platform-java test names --- .github/workflows/sdk-platform-java-ci.yaml | 73 ++++++--------------- 1 file changed, 19 insertions(+), 54 deletions(-) diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index 70d28191bc21..02ca17423edc 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -3,7 +3,7 @@ on: branches: - main pull_request: -name: sdk-platform-java-ci +name: sdk-platform-java jobs: filter: runs-on: ubuntu-latest @@ -18,8 +18,8 @@ jobs: library: - 'sdk-platform-java/**' - 'google-auth-library-java/**' - - '.github/workflows/ci.yaml' - build: + - '.github/workflows/sdk-platform-java-ci.yaml' + sdk-platform-java: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} runs-on: ubuntu-22.04 @@ -79,58 +79,20 @@ jobs: pushd /tmp/java-compute/google-cloud-compute-small-v1-java ./gradlew clean build publishToMavenLocal sourcesJar allJars popd - build-java-21: + build-java-21-25: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} - name: "build(21) except self-service clients" + name: "sdk-platform-java except self-service clients" # Support for Java 21 is available for all use cases except self-service clients. runs-on: ubuntu-22.04 + strategy: + matrix: + java: [ 21, 25 ] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - java-version: 21 - distribution: temurin - cache: maven - - run: java -version - - name: Unit Tests - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: test - # The `envVarTest` profile runs tests that require an environment variable - - name: Env Var Tests - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: test - SUREFIRE_JVM_OPT: '-PenvVarTest' - GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com - GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true - GOOGLE_SDK_JAVA_LOGGING: true - - run: bazelisk version - - name: Install all modules using Java 11 - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: install - - name: Integration Tests - run: | - bazelisk --batch test //sdk-platform-java/test/integration/... - build-java-25: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - name: "build(25) except self-service clients" - # Support for Java 25 is available for all use cases except self-service clients. - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 25 + java-version: ${{ matrix.java }} distribution: temurin cache: maven - run: java -version @@ -152,20 +114,23 @@ jobs: GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true GOOGLE_SDK_JAVA_LOGGING: true - run: bazelisk version - - name: Install all modules using Java 11 + - name: Install all modules shell: bash run: .kokoro/build.sh env: BUILD_SUBDIR: sdk-platform-java JOB_TYPE: install + - name: Conditionally set jvmopts + if: ${{ matrix.java == 25 }} + run: echo "EXTRA_BAZEL_ARGS='--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false'" >> $GITHUB_ENV - name: Integration Tests - # note need to set shouldInstallTestSecurityManager=false due to https://github.com/bazelbuild/bazel/issues/24354 run: | - bazelisk --batch test //sdk-platform-java/test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false - build-java8-except-gapic-generator-java: + bazelisk --batch test //sdk-platform-java/test/integration/... ${EXTRA_BAZEL_ARGS} + + sdk-platform-java-8: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} - name: "build(8) except for gapic-generator-java" + name: "sdk-platform-java except gapic-generator-java (8)" runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -217,10 +182,10 @@ jobs: GOOGLE_SDK_JAVA_LOGGING: true working-directory: sdk-platform-java - build-java8-gapic-generator-java: + gapic-generator-java: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} - name: "build(8) for gapic-generator-java" + name: "gapic-generator-java (8)" runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 0349fd68062e80e755e942753ec8b8aa7295e38a Mon Sep 17 00:00:00 2001 From: chingor13 Date: Tue, 21 Apr 2026 00:02:28 +0000 Subject: [PATCH 2/7] more renames --- .github/workflows/sdk-platform-java-ci.yaml | 36 +++++++++- .../sdk-platform-java-downstream.yaml | 1 + ...latform-java-java_compatibility_check.yaml | 66 ------------------- 3 files changed, 36 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/sdk-platform-java-java_compatibility_check.yaml diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index 02ca17423edc..1a3e630746fc 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -122,7 +122,7 @@ jobs: JOB_TYPE: install - name: Conditionally set jvmopts if: ${{ matrix.java == 25 }} - run: echo "EXTRA_BAZEL_ARGS='--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false'" >> $GITHUB_ENV + run: echo 'EXTRA_BAZEL_ARGS="--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false"' >> $GITHUB_ENV - name: Integration Tests run: | bazelisk --batch test //sdk-platform-java/test/integration/... ${EXTRA_BAZEL_ARGS} @@ -232,6 +232,40 @@ jobs: pushd /tmp/java-compute/google-cloud-compute-small-v1-java ./gradlew clean build publishToMavenLocal sourcesJar allJars popd + + java8-compatibility: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: maven + - name: Install sdk-platform-modules to local Maven repository + shell: bash + run: .kokoro/build.sh + env: + BUILD_SUBDIR: sdk-platform-java + JOB_TYPE: install + - name: Check Java 8 compatibility for class files + shell: bash + run: | + find . -type f -name "*.class" -path "*/classes/*" \ + -not -path "*/grpc-*/*" \ + -not -path "*/proto-*/*" \ + -not -path "*/gapic-generator-java/*" -print |\ + while IFS= read -r class_file; do + version=$(javap -v "${class_file}" | grep "major version" | cut -d ' ' -f 5) + if [[ "${version}" != "52" ]]; then + echo "${class_file} is not compatible with Java 8." + exit 1 + fi + done + echo "All class files are compatible with Java 8." + working-directory: sdk-platform-java build-java8-showcase: needs: filter diff --git a/.github/workflows/sdk-platform-java-downstream.yaml b/.github/workflows/sdk-platform-java-downstream.yaml index 6fb3b4aa2fea..99c1864d2f6c 100644 --- a/.github/workflows/sdk-platform-java-downstream.yaml +++ b/.github/workflows/sdk-platform-java-downstream.yaml @@ -54,6 +54,7 @@ jobs: downstream-compatibility-spring-generator: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} + name: "downstream-compatibility (spring-cloud-gcp)" runs-on: ubuntu-22.04 strategy: fail-fast: false diff --git a/.github/workflows/sdk-platform-java-java_compatibility_check.yaml b/.github/workflows/sdk-platform-java-java_compatibility_check.yaml deleted file mode 100644 index cdbc2d3820c9..000000000000 --- a/.github/workflows/sdk-platform-java-java_compatibility_check.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: - pull_request: -name: sdk-platform-java Java 8 compatibility check -env: - BUILD_SUBDIR: sdk-platform-java -jobs: - filter: - runs-on: ubuntu-latest - outputs: - library: ${{ steps.filter.outputs.library }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: filter - with: - filters: | - library: - - 'sdk-platform-java/**' - java8-compatibility-check: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: temurin - cache: maven - - name: Install sdk-platform-modules to local Maven repository - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: install - - name: Check Java 8 compatibility for class files - shell: bash - run: | - find . -type f -name "*.class" -path "*/classes/*" \ - -not -path "*/grpc-*/*" \ - -not -path "*/proto-*/*" \ - -not -path "*/gapic-generator-java/*" -print |\ - while IFS= read -r class_file; do - version=$(javap -v "${class_file}" | grep "major version" | cut -d ' ' -f 5) - if [[ "${version}" != "52" ]]; then - echo "${class_file} is not compatible with Java 8." - exit 1 - fi - done - echo "All class files are compatible with Java 8." - working-directory: sdk-platform-java From e33b3f8a4f57bea758301173295dd2509a532a1c Mon Sep 17 00:00:00 2001 From: chingor13 Date: Tue, 21 Apr 2026 00:13:34 +0000 Subject: [PATCH 3/7] fix bazelisk arg syntax --- .github/workflows/sdk-platform-java-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index 1a3e630746fc..b192b74ec7c5 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -125,7 +125,7 @@ jobs: run: echo 'EXTRA_BAZEL_ARGS="--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false"' >> $GITHUB_ENV - name: Integration Tests run: | - bazelisk --batch test //sdk-platform-java/test/integration/... ${EXTRA_BAZEL_ARGS} + bazelisk --batch ${EXTRA_BAZEL_ARGS} test //sdk-platform-java/test/integration/... sdk-platform-java-8: needs: filter From bade60beb39d9fef4544ea412c97126462cc7295 Mon Sep 17 00:00:00 2001 From: chingor13 Date: Tue, 21 Apr 2026 00:28:42 +0000 Subject: [PATCH 4/7] try at for bash variable --- .github/workflows/sdk-platform-java-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index b192b74ec7c5..841e9c48ccab 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -125,7 +125,7 @@ jobs: run: echo 'EXTRA_BAZEL_ARGS="--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false"' >> $GITHUB_ENV - name: Integration Tests run: | - bazelisk --batch ${EXTRA_BAZEL_ARGS} test //sdk-platform-java/test/integration/... + bazelisk --batch test //sdk-platform-java/test/integration/... "${EXTRA_BAZEL_ARGS[@]} " sdk-platform-java-8: needs: filter From 0d693846efcb7b4ac612aa51b25727b016a37095 Mon Sep 17 00:00:00 2001 From: chingor13 Date: Tue, 21 Apr 2026 00:38:29 +0000 Subject: [PATCH 5/7] fix extra space --- .github/workflows/sdk-platform-java-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index 841e9c48ccab..e55df5185a8d 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -125,7 +125,7 @@ jobs: run: echo 'EXTRA_BAZEL_ARGS="--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false"' >> $GITHUB_ENV - name: Integration Tests run: | - bazelisk --batch test //sdk-platform-java/test/integration/... "${EXTRA_BAZEL_ARGS[@]} " + bazelisk --batch test //sdk-platform-java/test/integration/... "${EXTRA_BAZEL_ARGS[@]}" sdk-platform-java-8: needs: filter From 6b8e3ca8ce17fec72d4030bd340cf5e5517c4126 Mon Sep 17 00:00:00 2001 From: chingor13 Date: Tue, 21 Apr 2026 00:50:12 +0000 Subject: [PATCH 6/7] regroup sdk-platform-java tests --- .github/workflows/sdk-platform-java-ci.yaml | 155 ++++++++++---------- 1 file changed, 77 insertions(+), 78 deletions(-) diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index e55df5185a8d..6c5e41cbb2dd 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -19,13 +19,14 @@ jobs: - 'sdk-platform-java/**' - 'google-auth-library-java/**' - '.github/workflows/sdk-platform-java-ci.yaml' - sdk-platform-java: + units: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} runs-on: ubuntu-22.04 + name: sdk-platform-java units strategy: matrix: - java: [ 11, 17 ] + java: [ 11, 17, 21, 25 ] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -51,86 +52,11 @@ jobs: GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true GOOGLE_SDK_JAVA_LOGGING: true working-directory: sdk-platform-java - - run: bazelisk version - - name: Install all modules using Java 11 - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: install - - name: Integration Tests - run: | - bazelisk --batch test //sdk-platform-java/test/integration/... - - name: Gradle Build Generated Storage Client Library - run: | - echo "Building Storage lib from generated source..." - mkdir /tmp/java-storage - bazelisk --batch build @com_google_googleapis//google/storage/v2:google-cloud-storage-v2-java - tar zxvf bazel-bin/external/com_google_googleapis/google/storage/v2/google-cloud-storage-v2-java.tar.gz -C /tmp/java-storage - pushd /tmp/java-storage/google-cloud-storage-v2-java - ./gradlew clean build publishToMavenLocal sourcesJar allJars - popd - - name: Gradle Build Generated Compute Client Library - run: | - echo "Building Compute lib from generated source..." - mkdir /tmp/java-compute - bazelisk --batch build @com_google_googleapis//google/cloud/compute/v1small:google-cloud-compute-small-v1-java - tar zxvf bazel-bin/external/com_google_googleapis/google/cloud/compute/v1small/google-cloud-compute-small-v1-java.tar.gz -C /tmp/java-compute - pushd /tmp/java-compute/google-cloud-compute-small-v1-java - ./gradlew clean build publishToMavenLocal sourcesJar allJars - popd - build-java-21-25: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - name: "sdk-platform-java except self-service clients" - # Support for Java 21 is available for all use cases except self-service clients. - runs-on: ubuntu-22.04 - strategy: - matrix: - java: [ 21, 25 ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java }} - distribution: temurin - cache: maven - - run: java -version - - name: Unit Tests - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: test - # The `envVarTest` profile runs tests that require an environment variable - - name: Env Var Tests - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: test - SUREFIRE_JVM_OPT: '-PenvVarTest' - GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com - GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true - GOOGLE_SDK_JAVA_LOGGING: true - - run: bazelisk version - - name: Install all modules - shell: bash - run: .kokoro/build.sh - env: - BUILD_SUBDIR: sdk-platform-java - JOB_TYPE: install - - name: Conditionally set jvmopts - if: ${{ matrix.java == 25 }} - run: echo 'EXTRA_BAZEL_ARGS="--jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false"' >> $GITHUB_ENV - - name: Integration Tests - run: | - bazelisk --batch test //sdk-platform-java/test/integration/... "${EXTRA_BAZEL_ARGS[@]}" sdk-platform-java-8: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} - name: "sdk-platform-java except gapic-generator-java (8)" + name: "sdk-platform-java units (8)" runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -182,6 +108,79 @@ jobs: GOOGLE_SDK_JAVA_LOGGING: true working-directory: sdk-platform-java + bazel: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-22.04 + name: sdk-platform-java integration + strategy: + matrix: + java: [ 11, 17, 21 ] + steps: + - run: bazelisk version + - name: Install all modules using Java 11 + shell: bash + run: .kokoro/build.sh + env: + BUILD_SUBDIR: sdk-platform-java + JOB_TYPE: install + - name: Integration Tests + run: | + bazelisk --batch test //sdk-platform-java/test/integration/... + + bazel-25: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-22.04 + name: sdk-platform-java integration (25) + steps: + - run: bazelisk version + - name: Install all modules using Java 11 + shell: bash + run: .kokoro/build.sh + env: + BUILD_SUBDIR: sdk-platform-java + JOB_TYPE: install + - name: Integration Tests + run: | + bazelisk --batch test //sdk-platform-java/test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false + + self-service: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-22.04 + name: sdk-platform-java integration + strategy: + matrix: + java: [ 11, 17 ] + steps: + - run: bazelisk version + - name: Install all modules using Java 11 + shell: bash + run: .kokoro/build.sh + env: + BUILD_SUBDIR: sdk-platform-java + JOB_TYPE: install + - name: Gradle Build Generated Storage Client Library + run: | + echo "Building Storage lib from generated source..." + mkdir /tmp/java-storage + bazelisk --batch build @com_google_googleapis//google/storage/v2:google-cloud-storage-v2-java + tar zxvf bazel-bin/external/com_google_googleapis/google/storage/v2/google-cloud-storage-v2-java.tar.gz -C /tmp/java-storage + pushd /tmp/java-storage/google-cloud-storage-v2-java + ./gradlew clean build publishToMavenLocal sourcesJar allJars + popd + - name: Gradle Build Generated Compute Client Library + run: | + echo "Building Compute lib from generated source..." + mkdir /tmp/java-compute + bazelisk --batch build @com_google_googleapis//google/cloud/compute/v1small:google-cloud-compute-small-v1-java + tar zxvf bazel-bin/external/com_google_googleapis/google/cloud/compute/v1small/google-cloud-compute-small-v1-java.tar.gz -C /tmp/java-compute + pushd /tmp/java-compute/google-cloud-compute-small-v1-java + ./gradlew clean build publishToMavenLocal sourcesJar allJars + popd + + gapic-generator-java: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} From b164c673156f81a5449ae2164a956ad5b68d8dd2 Mon Sep 17 00:00:00 2001 From: chingor13 Date: Tue, 21 Apr 2026 00:54:20 +0000 Subject: [PATCH 7/7] ensure checkout --- .github/workflows/sdk-platform-java-ci.yaml | 24 ++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sdk-platform-java-ci.yaml b/.github/workflows/sdk-platform-java-ci.yaml index 6c5e41cbb2dd..bfd07bfa7475 100644 --- a/.github/workflows/sdk-platform-java-ci.yaml +++ b/.github/workflows/sdk-platform-java-ci.yaml @@ -117,8 +117,14 @@ jobs: matrix: java: [ 11, 17, 21 ] steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: temurin + cache: maven - run: bazelisk version - - name: Install all modules using Java 11 + - name: Install all modules shell: bash run: .kokoro/build.sh env: @@ -134,8 +140,14 @@ jobs: runs-on: ubuntu-22.04 name: sdk-platform-java integration (25) steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 25 + distribution: temurin + cache: maven - run: bazelisk version - - name: Install all modules using Java 11 + - name: Install all modules shell: bash run: .kokoro/build.sh env: @@ -149,11 +161,17 @@ jobs: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} runs-on: ubuntu-22.04 - name: sdk-platform-java integration + name: sdk-platform-java self-service clients strategy: matrix: java: [ 11, 17 ] steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: temurin + cache: maven - run: bazelisk version - name: Install all modules using Java 11 shell: bash