diff --git a/.github/workflows/java-cloud-bom-bom-content-test.yaml b/.github/workflows/java-cloud-bom-bom-content-test.yaml deleted file mode 100644 index c95f2c03bf50..000000000000 --- a/.github/workflows/java-cloud-bom-bom-content-test.yaml +++ /dev/null @@ -1,82 +0,0 @@ -permissions: - contents: read - -on: - push: - branches: - - main - pull_request: -name: java-cloud-bom ci -env: - BUILD_SUBDIR: java-cloud-bom -jobs: - filter: - runs-on: ubuntu-latest - outputs: - library: ${{ steps.filter.outputs.library }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3 - id: filter - with: - filters: | - library: - - 'java-cloud-bom/**' - - 'sdk-platform-java/**' - - 'google-auth-library-java/**' - bom-content-test: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - distribution: temurin - java-version: 11 - cache: maven - - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - name: Install BOMs - run: | - mvn -B -V -ntp install -f java-cloud-bom/pom.xml -DskipTests - - name: Ensure the members of the Libraries BOM exist in Maven Central - uses: ./java-cloud-bom/tests/validate-bom - with: - bom-path: java-cloud-bom/libraries-bom/pom.xml - - name: Ensure the BOM has valid content (at releases) - if: github.head_ref == 'release-please--branches--main' - run: | - mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom" - working-directory: java-cloud-bom/tests - - bom-assertion-test: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' }} - name: BomContentAssertionsTest (Test for assertion logic in BomContentTest) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - distribution: zulu - java-version: 11 - - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - name: Install BOMs - run: | - mvn -B -V -ntp install -f java-cloud-bom/pom.xml -DskipTests - - run: | - mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest" - working-directory: java-cloud-bom/tests - diff --git a/.github/workflows/java-cloud-bom-ci-validate-bom.yaml b/.github/workflows/java-cloud-bom-ci-validate-bom.yaml deleted file mode 100644 index 954649ac32c3..000000000000 --- a/.github/workflows/java-cloud-bom-ci-validate-bom.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2023 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. -permissions: - contents: read - -on: - push: - branches: - - main - pull_request: -name: java-cloud-bom test for tests/validate-bom logic -env: - BUILD_SUBDIR: java-cloud-bom -jobs: - filter: - runs-on: ubuntu-latest - outputs: - library: ${{ steps.filter.outputs.library }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3 - id: filter - with: - filters: | - library: - - 'java-cloud-bom/**' - - 'sdk-platform-java/**' - - 'google-auth-library-java/**' - test-invalid-bom: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - name: Fetch the bad protobuf-bom version 3.22.1 - shell: bash - # 3.22.1 had a issue in their pom.xml - # https://github.com/protocolbuffers/protobuf/issues/12170 - run: | - mkdir -p bad-protobuf-bom - curl https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom \ - --output bad-protobuf-bom/pom.xml - - name: Check the bad BOM - uses: ./java-cloud-bom/tests/validate-bom - id: validate-bom - with: - bom-path: bad-protobuf-bom/pom.xml - continue-on-error: true - - name: Ensure the validate-bom invalidated the bad BOM - shell: bash - if: steps.validate-bom.outcome != 'failure' - run: | - echo "The validate-bom check should have invalidated the bad BOM" - exit 1 diff --git a/.github/workflows/java-cloud-bom-ci.yaml b/.github/workflows/java-cloud-bom-ci.yaml index bb5ce1dd05f1..dbfa6940b0ff 100644 --- a/.github/workflows/java-cloud-bom-ci.yaml +++ b/.github/workflows/java-cloud-bom-ci.yaml @@ -42,14 +42,13 @@ jobs: - 'java-cloud-bom/**' - 'sdk-platform-java/**' - 'google-auth-library-java/**' - units: + dependencies: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} runs-on: ubuntu-latest strategy: - fail-fast: false matrix: - java: [11, 17, 21] + java: [17] steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: @@ -60,90 +59,63 @@ jobs: java-version: ${{matrix.java}} cache: 'maven' - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - run: .kokoro/build.sh - env: - JOB_TYPE: test - GH_TOKEN: ${{ github.token }} - units-java8: + - name: Install modules locally + run: mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C + - run: .kokoro/dependencies.sh + + bom-content-test: needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - # Building using Java 17 and run the tests with Java 8 runtime - name: "units (8)" + if: ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - java-version: 8 - distribution: temurin - cache: 'maven' - - name: "Set jvm system property environment variable for surefire plugin (unit tests)" - # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. - # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm - run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV - shell: bash - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - java-version: 17 - distribution: temurin - cache: 'maven' - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - run: .kokoro/build.sh - env: - JOB_TYPE: test - GH_TOKEN: ${{ github.token }} - windows: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - runs-on: windows-latest - steps: - - name: Support longpaths - run: git config --system core.longpaths true - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: persist-credentials: false - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 with: distribution: temurin - java-version: 8 - cache: 'maven' + java-version: 11 + cache: maven - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - run: .kokoro/build.sh - env: - JOB_TYPE: test - GH_TOKEN: ${{ github.token }} - dependencies: + - name: Install modules locally + run: mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C + - name: Install BOMs + run: | + mvn -B -V -ntp install -f java-cloud-bom/pom.xml -DskipTests + - name: Ensure the members of the Libraries BOM exist in Maven Central + uses: ./java-cloud-bom/tests/validate-bom + with: + bom-path: java-cloud-bom/libraries-bom/pom.xml + - name: Ensure the BOM has valid content (at releases) + if: github.head_ref == 'release-please--branches--main' + run: | + mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom" + working-directory: java-cloud-bom/tests + + bom-assertion-test: needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} + if: ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' }} + name: BomContentAssertionsTest (Test for assertion logic in BomContentTest) runs-on: ubuntu-latest - strategy: - matrix: - java: [17] steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: persist-credentials: false - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 with: - distribution: temurin - java-version: ${{matrix.java}} - cache: 'maven' + distribution: zulu + java-version: 11 - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - run: .kokoro/dependencies.sh - javadoc: + - name: Install modules locally + run: mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C + - name: Install BOMs + run: | + mvn -B -V -ntp install -f java-cloud-bom/pom.xml -DskipTests + - run: | + mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest" + working-directory: java-cloud-bom/tests + + test-invalid-bom: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} runs-on: ubuntu-latest @@ -151,44 +123,48 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: persist-credentials: false - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 + - name: Fetch the bad protobuf-bom version 3.22.1 + shell: bash + # 3.22.1 had a issue in their pom.xml + # https://github.com/protocolbuffers/protobuf/issues/12170 + run: | + mkdir -p bad-protobuf-bom + curl https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom \ + --output bad-protobuf-bom/pom.xml + - name: Check the bad BOM + uses: ./java-cloud-bom/tests/validate-bom + id: validate-bom with: - distribution: temurin - java-version: 17 - cache: 'maven' - - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh + bom-path: bad-protobuf-bom/pom.xml + continue-on-error: true + - name: Ensure the validate-bom invalidated the bad BOM shell: bash - - run: .kokoro/build.sh - env: - JOB_TYPE: javadoc - lint: + if: steps.validate-bom.outcome != 'failure' + run: | + echo "The validate-bom check should have invalidated the bad BOM" + exit 1 + + dashboard: needs: filter if: ${{ needs.filter.outputs.library == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: - fetch-depth: 0 persist-credentials: false - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 with: distribution: temurin java-version: 11 - cache: 'maven' + cache: maven - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - run: .kokoro/build.sh + - run: .kokoro/dashboard.sh env: - JOB_TYPE: lint - HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} - clirr: + JOB_TYPE: dashboard-units-check + + shared-dependencies-convergence: needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} + if: ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' && github.head_ref == 'release-please--branches--main' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 @@ -198,12 +174,9 @@ jobs: with: distribution: temurin java-version: 11 - cache: 'maven' + cache: maven - run: java -version - - name: Pre-install all BOM modules to populate local cache - run: bash java-cloud-bom/tests/pre-install.sh - shell: bash - - run: .kokoro/build.sh + - run: .kokoro/dashboard.sh env: - JOB_TYPE: clirr - BUILD_SUBDIR: java-cloud-bom + JOB_TYPE: dependency-convergence-check + diff --git a/.github/workflows/java-cloud-bom-dashboard.yaml b/.github/workflows/java-cloud-bom-dashboard.yaml deleted file mode 100644 index 38aba4630992..000000000000 --- a/.github/workflows/java-cloud-bom-dashboard.yaml +++ /dev/null @@ -1,62 +0,0 @@ -permissions: - contents: read - -on: - push: - branches: - - main - pull_request: -name: java-cloud-bom ci -env: - BUILD_SUBDIR: java-cloud-bom -jobs: - filter: - runs-on: ubuntu-latest - outputs: - library: ${{ steps.filter.outputs.library }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3 - id: filter - with: - filters: | - library: - - 'java-cloud-bom/**' - - 'sdk-platform-java/**' - - 'google-auth-library-java/**' - dashboard: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - distribution: temurin - java-version: 11 - cache: maven - - run: java -version - - run: .kokoro/dashboard.sh - env: - JOB_TYPE: dashboard-units-check - shared-dependencies-convergence: - needs: filter - if: ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' && github.head_ref == 'release-please--branches--main' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - distribution: temurin - java-version: 11 - cache: maven - - run: java -version - - run: .kokoro/dashboard.sh - env: - JOB_TYPE: dependency-convergence-check diff --git a/.github/workflows/java-cloud-bom-release-note-generation.yaml b/.github/workflows/java-cloud-bom-release-note-generation.yaml index 1f1152f995a6..d8ed304490f9 100644 --- a/.github/workflows/java-cloud-bom-release-note-generation.yaml +++ b/.github/workflows/java-cloud-bom-release-note-generation.yaml @@ -34,10 +34,8 @@ jobs: java-version: 11 cache: maven - run: java -version - - name: Pre-install Snapshot Dependencies - run: | - bash java-cloud-bom/tests/pre-install.sh - shell: bash + - name: Install modules locally + run: mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C - name: Pick Libraries BOM version id: pick-version shell: bash diff --git a/java-cloud-bom/pom.xml b/java-cloud-bom/pom.xml index 0f2229b5ee9d..ec55d6f62f09 100644 --- a/java-cloud-bom/pom.xml +++ b/java-cloud-bom/pom.xml @@ -102,6 +102,22 @@ + + + quick-build + + true + true + true + true + true + true + true + true + true + true + + bulkTests diff --git a/java-cloud-bom/tests/pre-install.sh b/java-cloud-bom/tests/pre-install.sh deleted file mode 100755 index 56ab8a7208dd..000000000000 --- a/java-cloud-bom/tests/pre-install.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2026 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. - -set -eo pipefail - -( - for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/" | grep -v "java-cloud-bom"); do - grep -q "pom" "$f" && echo "$f" - done | sed 's|^\./||' | sed 's|/pom.xml$||' - echo "sdk-platform-java/java-shared-dependencies" - echo "sdk-platform-java/java-shared-dependencies/first-party-dependencies" - echo "sdk-platform-java/java-shared-dependencies/third-party-dependencies" - echo "sdk-platform-java/java-core" - echo "sdk-platform-java/java-core/google-cloud-core" - echo "sdk-platform-java/java-core/google-cloud-core-http" - echo "sdk-platform-java/java-core/google-cloud-core-grpc" - echo "google-auth-library-java" - echo "grpc-gcp-java" - for f in $(find . -maxdepth 1 -name "java-*" | grep -v "java-cloud-bom" | grep -v "java-shared-config" | grep -v "java-showcase" | grep -v "java-samples"); do - echo "$f" | sed 's|^\./||' - done -) | tr -d '\r' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt - -if ! mvn install -pl $(cat bom_projects.txt) -am -amd -DskipTests=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Denforcer.skip=true -Danimal.sniffer.skip=true -Dclirr.skip=true -Dgcloud.download.skip=true -B -V -T 1C -l java-cloud-bom/tests/mvn-install.log; then - echo "========================================================================" - echo "mvn install failed! Printing mvn-install.log:" - echo "========================================================================" - cat java-cloud-bom/tests/mvn-install.log - exit 1 -fi -rm bom_projects.txt