Skip to content

Commit

Permalink
chore: Update ci.yaml to setup Java 21 unit testing. (googleapis#1910)
Browse files Browse the repository at this point in the history
* chore: Update ci.yaml to setup Java 21 unit testing.
  • Loading branch information
ddixit14 committed Dec 11, 2023
1 parent eece941 commit 61fb53c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,27 @@ jobs:
- run: .kokoro/build.sh
env:
JOB_TYPE: clirr
# compilation failure for sub-modules using source and target options 7 (this setting cannot be upgraded to Java 21 because some modules support max of Java 8)
# Hence compile in Java 8 and test in Java 21.
units-java21:
# Building using Java 8 and run the tests with Java 21 runtime
name: "units (21)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- 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" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
- run: .kokoro/build.sh
env:
JOB_TYPE: test

0 comments on commit 61fb53c

Please sign in to comment.