sbt / sbt/sbt-github-actions

Dynamically generate the matrix

Open
#99 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
199
Forks
67
Avg merge
6h 24m
Merged PRs (30d)
3

Description

This plugin has three functions:

  1. Make SBT the source of truth for the Github Actions matrix of Scala versions, etc.
  2. A DSL for defining your entire workflow from within your SBT build
  3. A standard set of workflows that works well for most projects, using sbt-ci-release.

If one only needed (3), an SBT plugin would be unnecessary. (2) is very nice for those that are more comfortable doing things that way. And once you're doing things that way, the whole sbt githubWorkflowGenerate / sbt githubWorkflowCheck becomes necessary.

And it is a pain point, because it's too easy to forget to run sbt githubWorkflowGenerate. Fortunately Scala Steward knows to run it.

But the reality is that the value for most people is probably (1). And I think it may be possible to support without the whole sbt githubWorkflowGenerate / sbt githubWorkflowCheck dance.

I found a few articles about how to define a dynamic matrix. Here is one of them: https://brunoscheufler.com/blog/2021-10-09-generating-dynamic-github-actions-workflows-with-the-job-matrix-strategy

The basic idea is that an earlier step can generate output that the next step can parse as its matrix.

So there could be an SBT task to print out the matrix data, and the workflow could be written to use it to define the matrix. Then every time the Scala versions change or you add a subproject, ci.yml doesn't have to change.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing sbt githubWorkflowGenerate and sbt githubWorkflowCheck commands and the ci.yml workflow. Compare the proposed dynamic matrix approach with the current workflow-generation process, using the linked article as background. Done means Scala version and subproject changes can update the matrix without manually changing ci.yml.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, scala
Domain
build-system, ci-cd
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.