Skip to content

Commit

Permalink
Merge pull request #92 from djspiewak/bug/graalvm-version-spec
Browse files Browse the repository at this point in the history
Fixed graalvm version specs
  • Loading branch information
djspiewak authored Dec 2, 2021
2 parents 28e92a3 + e3b35ea commit 63147de
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 14 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
scala: [2.12.15]
java: [temurin@11]
java: [temurin@11, graal_20.3.1@11]
runs-on: ${{ matrix.os }}
steps:
- name: Ignore line ending differences in git
Expand All @@ -43,6 +43,13 @@ jobs:
distribution: temurin
java-version: 11

- name: Setup GraalVM (graal_20.3.1@11)
if: matrix.java == 'graal_20.3.1@11'
uses: DeLaGuardo/[email protected]
with:
graalvm: 20.3.1
java: java11

- name: Cache sbt
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -99,6 +106,13 @@ jobs:
distribution: temurin
java-version: 11

- name: Setup GraalVM (graal_20.3.1@11)
if: matrix.java == 'graal_20.3.1@11'
uses: DeLaGuardo/[email protected]
with:
graalvm: 20.3.1
java: java11

- name: Cache sbt
uses: actions/cache@v2
with:
Expand Down
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ThisBuild / crossScalaVersions := Seq("2.12.15")

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

// dummy publication just to test that setup works
ThisBuild / githubWorkflowPublishTargetBranches :=
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtghactions/JavaSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package sbtghactions

final case class JavaSpec(dist: JavaSpec.Distribution, version: String) {
def render: String = dist match {
case JavaSpec.Distribution.GraalVM(gversion) => s"graal:$gversion@$version"
case JavaSpec.Distribution.GraalVM(gversion) => s"graal_$gversion@$version"
case dist => s"${dist.rendering}@$version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtghactions/WorkflowStep.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object WorkflowStep {
cond = Some(s"matrix.java == '${jv.render}'"),
params = Map(
"graalvm" -> graalVersion,
"java" -> version))
"java" -> s"java$version"))

case jv @ JavaSpec(dist, version) =>
WorkflowStep.Use(
Expand Down
14 changes: 7 additions & 7 deletions src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.6, 2.12.15]
java: [temurin@11, 'graal:21.1.0@8']
java: [temurin@11, graal_21.1.0@8]
test: [this, is]
include:
- test: this
Expand All @@ -46,12 +46,12 @@ jobs:
distribution: temurin
java-version: 11

- name: 'Setup GraalVM (graal:21.1.0@8)'
if: 'matrix.java == ''graal:21.1.0@8'''
- name: Setup GraalVM (graal_21.1.0@8)
if: matrix.java == 'graal_21.1.0@8'
uses: DeLaGuardo/[email protected]
with:
graalvm: 21.1.0
java: 8
java: java8

- name: Cache sbt
uses: actions/cache@v2
Expand Down Expand Up @@ -105,12 +105,12 @@ jobs:
distribution: temurin
java-version: 11

- name: 'Setup GraalVM (graal:21.1.0@8)'
if: 'matrix.java == ''graal:21.1.0@8'''
- name: Setup GraalVM (graal_21.1.0@8)
if: matrix.java == 'graal_21.1.0@8'
uses: DeLaGuardo/[email protected]
with:
graalvm: 21.1.0
java: 8
java: java8

- name: Cache sbt
uses: actions/cache@v2
Expand Down
8 changes: 4 additions & 4 deletions src/test/scala/sbtghactions/GenerativePluginSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class GenerativePluginSpec extends Specification {
matrix:
os: [ubuntu-latest]
scala: [2.12.15, 2.13.6]
java: [temurin@11, 'graal:20.0.0@8']
java: [temurin@11, graal_20.0.0@8]
runs-on: $${{ matrix.os }}
steps:
- name: Setup Java (temurin@11)
Expand All @@ -529,12 +529,12 @@ class GenerativePluginSpec extends Specification {
distribution: temurin
java-version: 11

- name: 'Setup GraalVM (graal:20.0.0@8)'
if: 'matrix.java == ''graal:20.0.0@8'''
- name: Setup GraalVM (graal_20.0.0@8)
if: matrix.java == 'graal_20.0.0@8'
uses: DeLaGuardo/[email protected]
with:
graalvm: 20.0.0
java: 8"""
java: java8"""
}

"compile a job with environment variables, conditional, and needs with an sbt step" in {
Expand Down

0 comments on commit 63147de

Please sign in to comment.