Skip to content

Commit 460fac5

Browse files
committed
ci: Run all downstream protobuf CI checks with Java 8 JVM
1 parent 64ac2c1 commit 460fac5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.kokoro/nightly/downstream-protobuf-source-compatibility.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
2828
git clone "https://github.com/googleapis/$repo.git" --depth=1
2929
pushd "$repo"
3030

31-
# Compile with Java 11 and run the tests with Java 8
32-
mvn clean compile -T 1C
31+
# Compile with Java 11 and run the tests with Java 8 JVM
32+
mvn compile -T 1C
3333

34-
export JAVA_HOME="${JAVA8_HOME}"
35-
export PATH=$JAVA_HOME/bin:$PATH
34+
# JAVA8_HOME is set by the GH Actions CI
35+
if [ -n "${JAVA8_HOME}" ]; then
36+
surefire_opt="-Djvm=${JAVA8_HOME}/bin/java"
37+
else
38+
# Provide a default value for local executions that don't configure JAVA8_HOME
39+
surefire_opt="-Djvm=${JAVA_HOME}/bin/java"
40+
fi
3641

3742
# Compile the Handwritten Library with the Protobuf-Java version to test source compatibility
3843
# Run unit tests to help check for any behavior differences (dependant on coverage)
@@ -45,6 +50,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4550
-Denforcer.skip \
4651
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
4752
-pl "${google_cloud_java_handwritten_maven_args}" -am \
53+
"${surefire_opt}" \
4854
-T 1C
4955
else
5056
mvn test -B -V -ntp \
@@ -53,6 +59,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
5359
-Dmaven.javadoc.skip \
5460
-Denforcer.skip \
5561
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
62+
"${surefire_opt}" \
5663
-T 1C
5764
fi
5865

0 commit comments

Comments
 (0)