File tree Expand file tree Collapse file tree 5 files changed +65
-4
lines changed Expand file tree Collapse file tree 5 files changed +65
-4
lines changed Original file line number Diff line number Diff line change 25
25
strategy :
26
26
fail-fast : false
27
27
matrix :
28
- java : [8, 11, 17]
28
+ java : [11, 17]
29
29
steps :
30
30
- uses : actions/checkout@v3
31
31
- uses : actions/setup-java@v3
@@ -36,14 +36,42 @@ jobs:
36
36
- run : .kokoro/build.sh
37
37
env :
38
38
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
+ shell : bash
50
+ - uses : actions/setup-java@v3
51
+ with :
52
+ java-version : 11
53
+ distribution : zulu
54
+ - run : echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
55
+ shell : bash
56
+ - run : .kokoro/build.sh
57
+ env :
58
+ JOB_TYPE : test
39
59
windows :
40
60
runs-on : windows-latest
41
61
steps :
42
62
- uses : actions/checkout@v3
43
63
- uses : actions/setup-java@v3
44
64
with :
45
- distribution : zulu
46
65
java-version : 8
66
+ distribution : zulu
67
+ - run : echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
68
+ shell : bash
69
+ - uses : actions/setup-java@v3
70
+ with :
71
+ java-version : 11
72
+ distribution : zulu
73
+ - run : echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
74
+ shell : bash
47
75
- run : java -version
48
76
- run : .kokoro/build.bat
49
77
env :
Original file line number Diff line number Diff line change @@ -23,6 +23,17 @@ cd ${scriptDir}/..
23
23
# include common functions
24
24
source ${scriptDir} /common.sh
25
25
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
+
26
37
# Print out Maven & Java version
27
38
mvn -version
28
39
echo ${JOB_TYPE}
@@ -42,12 +53,19 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
42
53
export GOOGLE_APPLICATION_CREDENTIALS=$( realpath ${KOKORO_GFILE_DIR} /${GOOGLE_APPLICATION_CREDENTIALS} )
43
54
fi
44
55
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
+ mvn -version
61
+ fi
62
+
45
63
RETURN_CODE=0
46
64
set +e
47
65
48
66
case ${JOB_TYPE} in
49
67
test)
50
- mvn test -B \
68
+ mvn test -B -V \
51
69
-Dclirr.skip=true \
52
70
-Denforcer.skip=true \
53
71
-Djava.net.preferIPv4Stack=true
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ build_file: "java-spanner/.kokoro/trampoline.sh"
9
9
# Configure the docker image for kokoro-trampoline.
10
10
env_vars: {
11
11
key: " TRAMPOLINE_IMAGE"
12
- value: " gcr.io/cloud-devrel-kokoro-resources/java8 "
12
+ value: " gcr.io/cloud-devrel-kokoro-resources/java11 "
13
13
}
14
14
15
15
before_action {
Original file line number Diff line number Diff line change 32
32
".kokoro/presubmit/java8-samples.cfg" ,
33
33
".kokoro/presubmit/java11-samples.cfg" ,
34
34
".kokoro/presubmit/samples.cfg" ,
35
+ ".kokoro/release/common.cfg" ,
35
36
"samples/install-without-bom/pom.xml" ,
36
37
"samples/snapshot/pom.xml" ,
37
38
"samples/snippets/pom.xml" ,
40
41
".github/release-please.yml" ,
41
42
".github/blunderbuss.yml" ,
42
43
".github/workflows/samples.yaml" ,
44
+ ".github/workflows/ci.yaml" ,
43
45
".kokoro/build.sh" ,
44
46
]
45
47
)
Original file line number Diff line number Diff line change 224
224
</plugins >
225
225
</reporting >
226
226
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 >
227
240
</project >
You can’t perform that action at this time.
0 commit comments