This repository was archived by the owner on Apr 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 strategy :
2626 fail-fast : false
2727 matrix :
28- java : [8, 11, 17]
28+ java : [11, 17]
2929 steps :
3030 - uses : actions/checkout@v3
3131 - uses : actions/setup-java@v3
3636 - run : .kokoro/build.sh
3737 env :
3838 JOB_TYPE : test
39+ units-java8 :
40+ name : " units (8)"
41+ runs-on : ubuntu-latest
42+ steps :
43+ - uses : actions/checkout@v3
44+ - uses : actions/setup-java@v3
45+ with :
46+ java-version : 8
47+ distribution : zulu
48+ - run : echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
49+ - uses : actions/setup-java@v3
50+ with :
51+ java-version : 11
52+ distribution : zulu
53+ - run : echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
54+ - run : .kokoro/build.sh
55+ env :
56+ JOB_TYPE : test
3957 windows :
4058 runs-on : windows-latest
4159 steps :
Original file line number Diff line number Diff line change @@ -23,6 +23,17 @@ cd ${scriptDir}/..
2323# include common functions
2424source ${scriptDir} /common.sh
2525
26+ function setJava() {
27+ export JAVA_HOME=$1
28+ export PATH=${JAVA_HOME} /bin:$PATH
29+ }
30+
31+ # units-java8 uses both JDK 11 and JDK 8. GraalVM dependencies require JDK 11 to
32+ # compile the classes touching GraalVM classes.
33+ if [ ! -z " ${JAVA11_HOME} " ]; then
34+ setJava " ${JAVA11_HOME} "
35+ fi
36+
2637# Print out Maven & Java version
2738mvn -version
2839echo ${JOB_TYPE}
@@ -42,6 +53,12 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
4253 export GOOGLE_APPLICATION_CREDENTIALS=$( realpath ${KOKORO_GFILE_DIR} /${GOOGLE_APPLICATION_CREDENTIALS} )
4354fi
4455
56+ # units-java8 uses both JDK 11 and JDK 8. We ensure the generated class files
57+ # are compatible with Java 8 when running tests.
58+ if [ ! -z " ${JAVA8_HOME} " ]; then
59+ setJava " ${JAVA8_HOME} "
60+ fi
61+
4562RETURN_CODE=0
4663set +e
4764
Original file line number Diff line number Diff line change 224224 </plugins >
225225 </reporting >
226226
227+ <profiles >
228+ <profile >
229+ <!-- JDK 9+ has the "release" option to ensure the generated bytecode is
230+ compatible with Java 8. -->
231+ <id >compiler-release-8</id >
232+ <activation >
233+ <jdk >[9,]</jdk >
234+ </activation >
235+ <properties >
236+ <maven .compiler.release>8</maven .compiler.release>
237+ </properties >
238+ </profile >
239+ </profiles >
227240</project >
You can’t perform that action at this time.
0 commit comments