From 3d885bab4e3fd71f682e3d477c4cb07337629681 Mon Sep 17 00:00:00 2001 From: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com> Date: Tue, 26 Dec 2023 20:23:01 +0000 Subject: [PATCH] chore: Update ci.yaml to setup Java 21 CI tests (#2299) * chore: Update ci.yaml to setup Java 21 unit testing --- .bazeliskrc | 3 ++- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.bazeliskrc b/.bazeliskrc index 04cd2fe7ca..6b386cf868 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1,2 +1,3 @@ # See https://github.com/bazelbuild/bazelisk -USE_BAZEL_VERSION=6.0.0 +# As per b/302171264#comment5, 6.4.0 supports Java 21. +USE_BAZEL_VERSION=6.4.0 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b4df8d1670..9a91af401e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - java: [ 11, 17 ] + java: [ 11, 17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -48,7 +48,29 @@ jobs: pushd /tmp/java-compute/google-cloud-compute-small-v1-java ./gradlew clean build publishToMavenLocal sourcesJar allJars popd - + build-java-21: + name: "build(21) except self-service clients" + # Support for Java 21 is available for all use cases except self-service clients. + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 21 + distribution: temurin + cache: maven + - run: java -version + - name: Unit Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage + - run: bazelisk version + - name: Install Maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip + - name: Integration Tests + run: | + bazelisk --batch test //test/integration/... build-java8-except-gapic-generator-java: name: "build(8) except for gapic-generator-java" runs-on: ubuntu-22.04