Skip to content

Commit 20f2fa4

Browse files
authored
ci: Use Java 8 for Linkage Checker (#3716)
Manual invocation: https://github.com/googleapis/sdk-platform-java/actions/runs/14038997003
1 parent a2ba9a8 commit 20f2fa4

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ jobs:
4747
uses: actions/checkout@v4
4848
- uses: actions/setup-java@v4
4949
with:
50-
# Use Java 11 for this as Linkage Checker is only compatible with Java 11 or below
50+
java-version: 8
51+
distribution: temurin
52+
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
53+
# Java Client Libraries are compiled with Java 11 and target Java 8. Java 11 is required because GraalVM
54+
# minimum support is for Java 11.
55+
- uses: actions/setup-java@v4
56+
with:
5157
java-version: 11
5258
distribution: temurin
5359
- name: Print Protobuf-Java testing version

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function build_program_arguments() {
6262
done
6363
}
6464

65+
# TODO(https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/2395): Java 17+ support for Linkage Checker
6566
# cloud-opensource-java contains the Linkage Checker tool
6667
git clone https://github.com/GoogleCloudPlatform/cloud-opensource-java.git
6768
pushd cloud-opensource-java

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@ 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
33+
34+
export JAVA_HOME="${JAVA8_HOME}"
35+
export PATH=$JAVA_HOME/bin:$PATH
36+
3137
# Compile the Handwritten Library with the Protobuf-Java version to test source compatibility
3238
# Run unit tests to help check for any behavior differences (dependant on coverage)
3339
if [ "${repo}" == "google-cloud-java" ]; then
3440
# The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules)
35-
mvn clean test -B -V -ntp \
41+
mvn test -B -V -ntp \
3642
-Dclirr.skip \
3743
-Denforcer.skip \
3844
-Dmaven.javadoc.skip \
@@ -41,7 +47,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4147
-pl "${google_cloud_java_handwritten_maven_args}" -am \
4248
-T 1C
4349
else
44-
mvn clean test -B -V -ntp \
50+
mvn test -B -V -ntp \
4551
-Dclirr.skip \
4652
-Denforcer.skip \
4753
-Dmaven.javadoc.skip \

0 commit comments

Comments
 (0)