Skip to content

Commit

Permalink
Merge pull request #176 from mdedetrich/add-corretto-distribution
Browse files Browse the repository at this point in the history
Add Corretto distribution
  • Loading branch information
eed3si9n authored Dec 20, 2023
2 parents 6f3cda3 + 2fbeeaf commit bc75b11
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
scala: [2.12.18]
java: [temurin@8, graal_graalvm@17]
java: [temurin@8, graal_graalvm@17, corretto@17]
runs-on: ${{ matrix.os }}
steps:
- name: Ignore line ending differences in git
Expand Down Expand Up @@ -62,6 +62,14 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: sbt

- name: Setup Java (corretto@17)
if: matrix.java == 'corretto@17'
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
cache: sbt

- name: Check that workflows are up to date
shell: bash
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
Expand Down Expand Up @@ -124,6 +132,14 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: sbt

- name: Setup Java (corretto@17)
if: matrix.java == 'corretto@17'
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
cache: sbt

- name: Download target directories (2.12.18)
uses: actions/download-artifact@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ ThisBuild / scalaVersion := scala212

ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest", "windows-latest")
ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted")))
ThisBuild / githubWorkflowJavaVersions += JavaSpec.graalvm(Graalvm.Distribution("graalvm"), "17")
ThisBuild / githubWorkflowJavaVersions ++= Seq(
JavaSpec.graalvm(Graalvm.Distribution("graalvm"), "17"),
JavaSpec.corretto("17")
)

ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/sbtghactions/JavaSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ object JavaSpec {

def temurin(version: String): JavaSpec = JavaSpec(Distribution.Temurin, version)

def corretto(version: String): JavaSpec = JavaSpec(Distribution.Corretto, version)

private[sbtghactions] object JavaVersionExtractor {
def unapply(version: String): Option[Int] =
version.split("\\.").headOption.map(_.toInt)
Expand Down Expand Up @@ -83,6 +85,7 @@ object JavaSpec {
case object Adopt extends Distribution("adopt-hotspot")
case object OpenJ9 extends Distribution("adopt-openj9")
case object Liberica extends Distribution("liberica")
case object Corretto extends Distribution("corretto")
final case class GraalVM(graalvm: Graalvm) extends Distribution(graalvm.compile)
}
}

0 comments on commit bc75b11

Please sign in to comment.