Skip to content

Commit

Permalink
Merge pull request #38 from amesgen/fail-fast-setting
Browse files Browse the repository at this point in the history
add a setting to configure the fail-fast strategy for the build job
  • Loading branch information
djspiewak authored Nov 18, 2020
2 parents 4a45b10 + d35bab8 commit dd16af1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Any and all settings which affect the behavior of the generative plugin should b

#### `build` Job

- `githubWorkflowBuildMatrixFailFast` : `Option[Boolean]` – Whether or not to enable the `fail-fast` strategy for the `build` job. By default, no strategy option is written to the build configuration (`None`), which means that the `fail-fast` strategy *is* used.
- `githubWorkflowBuildMatrixAdditions` : `Map[String, List[String]]` – Contains a map of additional `matrix:` dimensions which will be added to the `build` job (on top of the auto-generated ones for Scala/Java/JVM version). As an example, this can be used to manually achieve additional matrix expansion for ScalaJS compilation. Matrix variables can be referenced in the conventional way within steps by using the `${{ matrix.keynamehere }}` syntax. Defaults to empty.
- `githubWorkflowBuildMatrixInclusions` : `Seq[MatrixInclude]` – A list of [matrix *inclusions*](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations). This is useful for when you have a specific matrix job which needs to do extra work, or wish to add an individual matrix job to the configuration set. The matching keys and values are verified against the known matrix configuration. Defaults to empty.
- `githubWorkflowBuildMatrixExclusions` : `Seq[MatrixExclude]` – A list of [matrix *exclusions*](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-excluding-configurations-from-a-matrix). This is useful for when there is a matrix expansion (or set of expansions) which you wish to filter out of the set. Note that exclusions are applied *before* inclusions, allowing you to subtract jobs before re-adding them. Also – and the documentation isn't clear on this point – it is possible that the matching must cover the full set of matrix keys and cannot contain partial values. Defaults to empty.
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/sbtghactions/GenerativeKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ trait GenerativeKeys {

lazy val githubWorkflowSbtCommand = settingKey[String]("The command which invokes sbt (default: sbt")

lazy val githubWorkflowBuildMatrixFailFast = settingKey[Option[Boolean]]("Whether or not to enable the fail-fast strategy (default: None/Enabled)")
lazy val githubWorkflowBuildMatrixAdditions = settingKey[Map[String, List[String]]]("A map of additional matrix dimensions for the build job. Each list should be non-empty. (default: {})")
lazy val githubWorkflowBuildMatrixInclusions = settingKey[Seq[MatrixInclude]]("A list of matrix inclusions (default: [])")
lazy val githubWorkflowBuildMatrixExclusions = settingKey[Seq[MatrixExclude]]("A list of matrix exclusions (default: [])")
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/sbtghactions/GenerativePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}"""
val settingDefaults = Seq(
githubWorkflowSbtCommand := "sbt",

githubWorkflowBuildMatrixFailFast := None,
githubWorkflowBuildMatrixAdditions := Map(),
githubWorkflowBuildMatrixInclusions := Seq(),
githubWorkflowBuildMatrixExclusions := Seq(),
Expand Down Expand Up @@ -557,6 +558,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}"""
oses = githubWorkflowOSes.value.toList,
scalas = githubWorkflowScalaVersions.value.toList,
javas = githubWorkflowJavaVersions.value.toList,
matrixFailFast = githubWorkflowBuildMatrixFailFast.value,
matrixAdds = githubWorkflowBuildMatrixAdditions.value,
matrixIncs = githubWorkflowBuildMatrixInclusions.value.toList,
matrixExcs = githubWorkflowBuildMatrixExclusions.value.toList,
Expand Down

0 comments on commit dd16af1

Please sign in to comment.