Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce sbtStepPreamble to GHA plugin #64

Merged
merged 11 commits into from
Jan 16, 2022

Conversation

armanbilge
Copy link
Member

@armanbilge armanbilge commented Jan 9, 2022

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.

Copy link
Member

@rossabaker rossabaker left a comment

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
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