Skip to content

Commit 37ef0d5

Browse files
authoredFeb 10, 2023
Add Java 17 to GHA setup (#4659)
1 parent 6c1495b commit 37ef0d5

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed
 

‎.github/workflows/it-tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
java:
3232
- 8
3333
- 11
34+
- 17
3435
scala:
3536
- 2.12.17
3637
- 2.13.8

‎.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
fetch-depth: 0
1313
- name: cache SBT
1414
uses: coursier/cache-action@v6
15-
- name: Java 11 setup
15+
- name: Java 17 setup
1616
uses: actions/setup-java@v3
1717
with:
1818
distribution: temurin
19-
java-version: 11
19+
java-version: 17
2020
- uses: olafurpg/setup-gpg@v3
2121
- name: Publish ${{ github.ref }}
2222
run: sbt ci-release

‎.github/workflows/tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
java:
3030
- 8
3131
- 11
32+
- 17
3233
scala:
3334
- 2.12.17
3435
- 2.13.8

‎build.sbt

+16-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ val commonSettings = Def
306306
)
307307
),
308308
mimaSettings,
309-
formatSettings
309+
formatSettings,
310+
java17Settings
310311
)
311312

312313
lazy val publishSettings = Def.settings(
@@ -452,6 +453,20 @@ def splitTests(tests: Seq[TestDefinition], filter: Seq[String], forkOptions: For
452453
}
453454
}
454455

456+
lazy val java17Settings = sys.props("java.version") match {
457+
case v if v.startsWith("17.") =>
458+
Seq(
459+
Test / fork := true,
460+
Test / javaOptions ++= Seq(
461+
"--add-opens",
462+
"java.base/java.util=ALL-UNNAMED",
463+
"--add-opens",
464+
"java.base/java.lang.invoke=ALL-UNNAMED"
465+
)
466+
)
467+
case _ => Seq()
468+
}
469+
455470
lazy val root: Project = Project("scio", file("."))
456471
.settings(commonSettings)
457472
.settings(

‎scio-test/src/test/scala/com/spotify/scio/coders/CoderTest.scala

+3-4
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,9 @@ final class CoderTest extends AnyFlatSpec with Matchers {
211211
cw.runWithImplicit
212212
throw new Throwable("Is expected to throw when passing implicit from outer class")
213213
} catch {
214-
case e: NullPointerException =>
215-
// In this case outer field is called "$cw" and it is hard to wrap it with proper exception
216-
// so we allow it to fail with NullPointerException
217-
e.getMessage should be(null)
214+
case _: NullPointerException =>
215+
// In this case outer field is called "$cw" and it is hard to wrap it with proper exception
216+
// so we allow it to fail with NullPointerException
218217
}
219218

220219
{

0 commit comments

Comments
 (0)
Please sign in to comment.