Skip to content

Commit

Permalink
test against JDK21 (LTS)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed Feb 24, 2024
1 parent a7ec035 commit c65bcdb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
with:
java-version: 8
- run: sbt test scripted
jdk11:
name: JDK11 tests
Expand All @@ -19,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
with:
java-version: adopt@1.11
java-version: 11
- run: sbt test scripted
jdk17:
name: JDK17 tests
Expand All @@ -30,6 +32,15 @@ jobs:
with:
java-version: 17
- run: sbt "test; scripted sbt-scalafix/*"
jdk21:
name: JDK21 tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
with:
java-version: 21
- run: sbt "test; scripted sbt-scalafix/*"
windows:
name: Windows tests
runs-on: windows-latest
Expand Down
10 changes: 7 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ scalaVersion := "2.12.19"
pluginCrossBuild / sbtVersion := "1.3.1"

scriptedSbt := {
if (System.getProperty("java.specification.version").toDouble < 17)
"1.3.0"
else
val jdk = System.getProperty("java.specification.version").toDouble

if (jdk >= 21)
"1.9.0" // first release that supports JDK21
else if (jdk >= 17)
"1.5.5" // first release that supports JDK17
else
"1.3.0"
}

libraryDependencies += compilerPlugin(scalafixSemanticdb)
Expand Down

0 comments on commit c65bcdb

Please sign in to comment.