Skip to content

Introduce sbtStepPreamble to GHA plugin#64

Merged
armanbilge merged 11 commits into
typelevel:mainfrom
armanbilge:feature/gha-flexible-crossing
Jan 16, 2022
Merged

Introduce sbtStepPreamble to GHA plugin#64
armanbilge merged 11 commits into
typelevel:mainfrom
armanbilge:feature/gha-flexible-crossing

Conversation

@armanbilge

@armanbilge armanbilge commented Jan 9, 2022

Copy link
Copy Markdown
Member

Based on #62. Fixes #61.

With all modesty 😁 I think this is a simple and very powerful idea.

Currently, when sbt-gh-actions generates a WorkflowStep.Sbt, it always prepends the user commands with ++${{ matrix.scala }}. So, the steps run with the Scala version set in the matrix. This is fantastic when your matrix is crossed on Scala versions.

However, our matrices are now often crossed on other things as well that are controlled via sbt, such as JVM/JS, or in JS projects, the JS runtime used (Node.js, browsers, etc.).

This PR exposes these "preamble commands" as a new githubWorkflowBuildSbtStepPreamble that defaults to ++${{ matrix.scala }}. Some useful adjustments of this setting may be to:

  1. add e.g. project ${{ matrix.project }} command, to select a rootJVM or rootJS project
  2. add e.g. set Global / useJSEnv := ${{ matrix.jsenv }}, to change the runtime used for JS tests
  3. remove ++${{ matrix.scala }} altogether, for projects using sbt-projectmatrix to manage their builds

In general, I think this introduces a lot of flexibility, that will make it easier to implement #60.

@rossabaker rossabaker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable.

@armanbilge

Copy link
Copy Markdown
Member Author

Since this depends on #62 I'll wait on approval there before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Platform-cross-aware GHA steps

2 participants