Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Java 17 to GHA setup #4659

Merged
merged 12 commits into from
Feb 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Keep it simple, fork tests for java 17
clairemcginty committed Feb 6, 2023
commit 31eb3b446c71753a72ce311c4657e58e71ae01b6
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@ jobs:
fetch-depth: 0
- name: cache SBT
uses: coursier/cache-action@v6
- name: Java 11 setup
- name: Java 17 setup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also save this for 0.13 milestone

uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17
- uses: olafurpg/setup-gpg@v3
- name: Publish ${{ github.ref }}
run: sbt ci-release
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@ jobs:
with:
distribution: temurin
java-version: ${{matrix.java}}
- if: ${{ matrix.java == 17 }}
run: scripts/set_java_17_opts.sh
- if: ${{ !matrix.coverage }}
run: sbt "++${{matrix.scala}} test"
- if: ${{ matrix.coverage }}
19 changes: 12 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -215,6 +215,7 @@ val commonSettings = Def
// this setting is not derived in sbt-tpolecat
// https://github.com/typelevel/sbt-tpolecat/issues/36
inTask(doc)(TpolecatPlugin.projectSettings),
scalacOptions ++= Seq("-release", "8"),
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint:unchecked"),
Compile / doc / javacOptions := Seq("-source", "1.8"),
excludeDependencies ++= Seq(
@@ -453,16 +454,20 @@ def splitTests(tests: Seq[TestDefinition], filter: Seq[String], forkOptions: For
}
}

lazy val java17Settings = Seq(Test / javaOptions ++= (sys.props("java.version") match {
lazy val java17Settings = sys.props("java.version") match {
case v if v.startsWith("17.") =>
println("Setting java 17 opts")
Seq(
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.invoke=ALL-UNNAMED"
Test / fork := true,
Test / javaOptions ++= Seq(
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.invoke=ALL-UNNAMED"
)
)
case _ => Seq.empty
}))
case _ => Seq()
}

lazy val root: Project = Project("scio", file("."))
.settings(commonSettings)
8 changes: 0 additions & 8 deletions scripts/set_java_17_opts.sh

This file was deleted.