Skip to content

feat: add sbt-pre-merge and sbt-post-merge reusable workflows - #21

Open
Tushar-Jupiter wants to merge 1 commit into
mainfrom
feat/sbt-reusable-workflows
Open

feat: add sbt-pre-merge and sbt-post-merge reusable workflows#21
Tushar-Jupiter wants to merge 1 commit into
mainfrom
feat/sbt-reusable-workflows

Conversation

@Tushar-Jupiter

Copy link
Copy Markdown

Summary

  • Adds sbt-pre-merge.yml and sbt-post-merge.yml reusable workflows as SBT equivalents of the existing jvm-pre-merge.yml / jvm-post-merge.yml
  • Scala SBT consumer services (built on money.jupiter.scala-dependency-management) can now delegate CI to two lines, matching the pattern nexus uses
  • Setup steps are inlined (no new composite action — 2 workflows don't warrant it)
  • ECR build/push is inlined since ecr-build-push hard-codes ./gradlew; SBT uses sbt jib

Consumer usage

# .github/workflows/sbt-pre-merge.yml
jobs:
  check:
    uses: jupitermoney/github-workflows/.github/workflows/sbt-pre-merge.yml@main
    with: { java_version: "21" }
    secrets: inherit

# .github/workflows/sbt-post-merge.yml
jobs:
  publish:
    uses: jupitermoney/github-workflows/.github/workflows/sbt-post-merge.yml@main
    with:
      java_version: "21"
      image_name: my-service
    secrets: inherit

Consumer must also set in build.sbt:

jibToImage := s"${sys.env.getOrElse("ECR_REGISTRY", "454518750364.dkr.ecr.ap-south-1.amazonaws.com")}/${name.value}:${sys.env.getOrElse("DOCKER_IMAGE_TAG", version.value)}"

Test plan

  • Open a PR in a test Scala consumer service using sbt-pre-merge.yml — confirm build-test job runs sbt compile test and sbt sonarScanIfEnabled
  • Push to master in that service — confirm build-push job runs sbt jib and image appears in ECR with rc-{sha} tag
  • Confirm is_library: true skips the build-push job

🤖 Generated with Claude Code

Adds SBT equivalents of jvm-pre-merge.yml and jvm-post-merge.yml so
Scala SBT consumer services can delegate CI to a two-line workflow call,
matching the pattern used by Kotlin/Gradle services like nexus.

- sbt-pre-merge: checkout + SBT cache + sbt compile test + sonarScanIfEnabled
- sbt-post-merge: same test job + build-push job (ECR login → sbt jib → Trivy)

Inlines setup steps (no new composite action — 2 workflows don't warrant it).
ECR build-push is inlined since ecr-build-push action hard-codes ./gradlew.
No matrix — SBT Play services are single-module; add input when needed.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@jm-bot-ci

Copy link
Copy Markdown

@Tushar-Jupiter: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jm-bot-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Tushar-Jupiter

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants