Skip to content

Commit 27fda8d

Browse files
committed
ci: Compile with Java 11 and run tests with Java 8
1 parent 1db9b69 commit 27fda8d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ jobs:
5050
# TODO(https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/2395): Java 17+ support for Linkage Checker
5151
java-version: 8
5252
distribution: temurin
53+
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
54+
- uses: actions/setup-java@v4
55+
with:
56+
java-version: 11
57+
distribution: temurin
58+
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
5359
- name: Print Protobuf-Java testing version
5460
run: echo "Testing with Protobuf-Java v${{ matrix.protobuf-version }}"
5561
- name: Perform downstream source compatibility testing

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

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

65+
java -version
66+
6567
# cloud-opensource-java contains the Linkage Checker tool
6668
git clone https://github.com/GoogleCloudPlatform/cloud-opensource-java.git
6769
pushd cloud-opensource-java

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ source "${scriptDir}/common.sh"
2020

2121
validate_protobuf_compatibility_script_inputs
2222

23+
24+
java -version
25+
# Compile the repos with Java 11
26+
mvn clean compile -T 1C
27+
28+
export JAVA_HOME="${JAVA8_HOME}"
29+
java -version
30+
2331
# REPOS_UNDER_TEST Env Var accepts a comma separated list of googleapis repos to test. For Github CI,
2432
# this will be a single repo as Github will build a matrix of repos with each repo being tested in parallel.
2533
# For local invocation, you can pass a list of repos to test multiple repos together.
@@ -32,7 +40,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
3240
# Run unit tests to help check for any behavior differences (dependant on coverage)
3341
if [ "${repo}" == "google-cloud-java" ]; then
3442
# The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules)
35-
mvn clean test -B -V -ntp \
43+
mvn test -B -V -ntp \
3644
-Dclirr.skip \
3745
-Denforcer.skip \
3846
-Dmaven.javadoc.skip \
@@ -41,7 +49,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4149
-pl "${google_cloud_java_handwritten_maven_args}" -am \
4250
-T 1C
4351
else
44-
mvn clean test -B -V -ntp \
52+
mvn test -B -V -ntp \
4553
-Dclirr.skip \
4654
-Denforcer.skip \
4755
-Dmaven.javadoc.skip \

0 commit comments

Comments
 (0)