Skip to content

Commit

Permalink
Fixed Java matrix exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
djspiewak committed Dec 1, 2021
1 parent c97496c commit 28e92a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/sbtghactions/GenerativePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ ${indent(rendered.mkString("\n"), 1)}"""
} mkString "\n"

// TODO refactor all of this stuff to use whitelist instead
val whitelist = Map("os" -> job.oses, "scala" -> job.scalas, "java" -> job.javas) ++ job.matrixAdds
val whitelist = Map("os" -> job.oses, "scala" -> job.scalas, "java" -> job.javas.map(_.render)) ++ job.matrixAdds

def checkMatching(matching: Map[String, String]): Unit = {
matching foreach {
Expand Down
13 changes: 13 additions & 0 deletions src/test/scala/sbtghactions/GenerativePluginSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,19 @@ class GenerativePluginSpec extends Specification {
"") must throwA[RuntimeException]
}

"allow a matching JVM exclusion" in {
compileJob(
WorkflowJob(
"bippy",
"Bippity Bop Around the Clock",
List(
WorkflowStep.Run(List("echo ${{ matrix.scala }}"))),
matrixExcs = List(
MatrixExclude(
Map("java" -> JavaSpec.temurin("11").render)))),
"") must not(throwA[RuntimeException])
}

"compile a job with a long list of scala versions" in {
val results = compileJob(
WorkflowJob(
Expand Down

0 comments on commit 28e92a3

Please sign in to comment.