Skip to content

Commit 61fb53c

Browse files
authored
chore: Update ci.yaml to setup Java 21 unit testing. (#1910)
* chore: Update ci.yaml to setup Java 21 unit testing.
1 parent eece941 commit 61fb53c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/ci.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,27 @@ jobs:
8787
- run: .kokoro/build.sh
8888
env:
8989
JOB_TYPE: clirr
90+
# 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)
91+
# Hence compile in Java 8 and test in Java 21.
92+
units-java21:
93+
# Building using Java 8 and run the tests with Java 21 runtime
94+
name: "units (21)"
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v3
98+
- uses: actions/setup-java@v3
99+
with:
100+
java-version: 21
101+
distribution: temurin
102+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
103+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
104+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
105+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
106+
shell: bash
107+
- uses: actions/setup-java@v3
108+
with:
109+
java-version: 8
110+
distribution: temurin
111+
- run: .kokoro/build.sh
112+
env:
113+
JOB_TYPE: test

0 commit comments

Comments
 (0)