feat(scala-ci): add reusable sbt/Scala CI workflow#2
Merged
Conversation
a5c21a4 to
ecb047c
Compare
monsieurleberre
added a commit
that referenced
this pull request
May 27, 2026
* Tighten coverage-pr-comment-header description: this is a hidden HTML-comment dedup key for marocchino/sticky-pull-request-comment, not the visible header; redirect callers to coverage-title for the H2. Also flag that it shares the default string 'jvm-coverage' with coverage-artifact-name but the two are unrelated knobs. * Tighten coverage-artifact-name description: explicit that it names the actions/upload-artifact target and shares (but does not unify with) coverage-pr-comment-header's default. * Tighten coverage-title description: note that coverage-pr-comment-header is HTML-comment-only so the rendered comment shows ONLY the H2, no doubling. * sbt-command description: warn that the step runs `eval "sbt $SBT_COMMAND"` to preserve embedded quoting, so the input must come from a trusted caller — workflow_dispatch would violate the precondition. * Loud-fail "Prepend coverage title" if code-coverage-results.md is missing, matching the csharp-ci pattern. * Loud-fail "Write to Job Summary" on the same missing file, matching csharp-ci's loud-fail shape. * Bump actions/upload-artifact v5.0.0 -> v7.0.1 to match csharp-ci's pin.
4 tasks
monsieurleberre
added a commit
that referenced
this pull request
May 27, 2026
Brings go-ci.yaml onto the same shape as csharp-ci (PR #1) and scala-ci (PR #2): a visible H2 heading is prepended to the rendered coverage markdown before the sticky-comment step picks it up, so a reader can tell the language at a glance when multiple coverage sticky comments coexist on the same PR. Default `coverage-title` is "Go coverage". The new "Prepend coverage title" step runs after the existing "Augment coverage report with cyclomatic complexity" step (which mutates `code-coverage-results.md` in place) so the H2 ends up at the top of the final file, and loud- fails if `code-coverage-results.md` is missing — mirroring the pattern landed in csharp-ci / scala-ci. terraform-ci.yaml is intentionally NOT changed: it has no coverage chain (no `irongut/CodeCoverageSummary` step, no `code-coverage-results.md`), only a separate `test-summary.md` sticky comment. Adding `coverage-title` there would mean fabricating a coverage chain, which is out of scope for this PR. PR #1 (csharp-ci) and PR #2 (scala-ci) are still open. README updates documenting `coverage-title` will follow once those land, to avoid three-way conflicts on README.md.
JVM analogue of csharp-ci.yaml. Extracts the build/test/coverage flow from daml-codegen-csharp's inline `jvm-helper-ci` job (checkout, JDK setup, sbt cache, sbt build+coverage, Cobertura staging, summary, sticky PR comment, job summary, artifact upload) into a `workflow_call`-only reusable workflow. The workflow is named `jvm-ci` (not `jvm-helper-ci`) — it is reusable across any sbt/Scala workspace; the "helper" suffix would leak the only-current-caller's name into the contract. Sticky PR coverage comment is language-labelled via a new `coverage-title` input (default `'JVM coverage'`), prepended to the rendered report so a reader can tell which language each sticky note covers when csharp-ci and jvm-ci comment on the same PR. No `pack:` job — JVM helper is internal-only today (tracer-bullet rule).
* Tighten coverage-pr-comment-header description: this is a hidden HTML-comment dedup key for marocchino/sticky-pull-request-comment, not the visible header; redirect callers to coverage-title for the H2. Also flag that it shares the default string 'jvm-coverage' with coverage-artifact-name but the two are unrelated knobs. * Tighten coverage-artifact-name description: explicit that it names the actions/upload-artifact target and shares (but does not unify with) coverage-pr-comment-header's default. * Tighten coverage-title description: note that coverage-pr-comment-header is HTML-comment-only so the rendered comment shows ONLY the H2, no doubling. * sbt-command description: warn that the step runs `eval "sbt $SBT_COMMAND"` to preserve embedded quoting, so the input must come from a trusted caller — workflow_dispatch would violate the precondition. * Loud-fail "Prepend coverage title" if code-coverage-results.md is missing, matching the csharp-ci pattern. * Loud-fail "Write to Job Summary" on the same missing file, matching csharp-ci's loud-fail shape. * Bump actions/upload-artifact v5.0.0 -> v7.0.1 to match csharp-ci's pin.
Aligns the workflow on the language axis (csharp-ci + scala-ci, C# coverage + Scala coverage) instead of the mixed language-vs-runtime axis. Default strings shift jvm-coverage to scala-coverage and JVM coverage to Scala coverage; references to JDK / java-version stay where they genuinely denote the Java runtime. Pin updates: - actions/setup-java v5.0.0 -> v5.2.0 (additive + dep updates) - actions/cache v4.2.3 -> v5.0.5 (Node 24 runtime; runner already meets the 2.327.1 minimum; with: keys path/key/restore-keys unchanged)
7 tasks
Adds an entry for `scala-ci.yaml` mirroring the `csharp-ci.yaml` section shape (overview, uses snippet, input table, caller prerequisites) so consumers get the same documentation footing across languages.
scala-ci has no BOT_GITHUB_TOKEN wiring and the only sbt resolver in the canonical caller (peacefulstudio/daml-codegen-csharp jvm-helper) is Maven Central. The packages:read grant was cargo-culted from csharp-ci, where it is actually load-bearing for private NuGet feeds. Least-privilege: drop it from the job's permissions block and from the README's required-perms listing. Also bring the README's scala-ci consumer snippet to structural parity with the csharp-ci snippet — add the missing name: and on: trigger block so copy-paste users get a complete workflow.
96fd4f5 to
2a550f0
Compare
peaceful-bot
approved these changes
May 27, 2026
monsieurleberre
added a commit
that referenced
this pull request
May 27, 2026
Brings terraform-ci.yaml onto the same shape as csharp-ci (PR #1), scala-ci (PR #2), and go-ci (PR #3): a visible H2 heading is prepended to the rendered test-summary markdown before the sticky-comment step picks it up, so a reader can tell which workspace each sticky comment covers at a glance when multiple sticky comments coexist on the same PR. The input name, env-var name, step name, and description wording mirror csharp-ci / scala-ci / go-ci verbatim — coverage-title / COVERAGE_TITLE / "Prepend coverage title" — for cross-workflow consistency. The default is 'Terraform coverage'. The new "Prepend coverage title" step runs immediately after "Build test summary", gates on the same condition the surrounding test-summary chain uses (always() && steps.tests.outputs.ran == 'true'), and loud-fails (::error:: + exit 1) if test-summary.md is missing — mirroring the pattern landed in csharp-ci / scala-ci / go-ci. coverage-title flows into the shell via env: indirection, not direct ${{ }} interpolation in run:.
monsieurleberre
added a commit
that referenced
this pull request
May 27, 2026
…ng (#4) Brings terraform-ci.yaml onto the same shape as csharp-ci (PR #1), scala-ci (PR #2), and go-ci (PR #3): a visible H2 heading is prepended to the rendered test-summary markdown before the sticky-comment step picks it up, so a reader can tell which workspace each sticky comment covers at a glance when multiple sticky comments coexist on the same PR. The input name, env-var name, step name, and description wording mirror csharp-ci / scala-ci / go-ci verbatim — coverage-title / COVERAGE_TITLE / "Prepend coverage title" — for cross-workflow consistency. The default is 'Terraform coverage'. The new "Prepend coverage title" step runs immediately after "Build test summary", gates on the same condition the surrounding test-summary chain uses (always() && steps.tests.outputs.ran == 'true'), and loud-fails (::error:: + exit 1) if test-summary.md is missing — mirroring the pattern landed in csharp-ci / scala-ci / go-ci. coverage-title flows into the shell via env: indirection, not direct ${{ }} interpolation in run:.
monsieurleberre
added a commit
that referenced
this pull request
May 27, 2026
Promote four merged feature PRs into a tagged 1.1.0 section: - #2 scala-ci.yaml — new reusable sbt/Scala workflow - #1 csharp-ci.yaml — migrated to xUnit v3 + Microsoft.Testing.Platform - #3 go-ci.yaml — new coverage-title input - #4 terraform-ci.yaml — new coverage-title input Tagging (v1.1.0 + floating v1) follows on the merge commit per CONTRIBUTING.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scala-ci.yaml, the Scala analogue ofcsharp-ci.yaml— aworkflow_call-only reusable workflow that runs sbt build/test/coverage and emits a Cobertura summary + sticky PR comment + job-summary + artifact upload, mirroring the csharp-ci pattern step-for-step (minus thepack:job; jvm-helper is internal-only today).jvm-helper-cijob inpeacefulstudio/daml-codegen-csharp(.github/workflows/ci.yamllines 31-100); step SHAs are copied across verbatim.scala-ci, notjvm-helper-ci— it is reusable across any sbt/Scala workspace; the "helper" suffix would leak the only-current-caller's name into the contract. Renamed fromjvm-cito align on a language axis withcsharp-ci(mixed language-vs-runtime axis was confusing).coverage-titleinput (default'Scala coverage') prepends a markdown H2 to the rendered coverage report so a reader can tell which language each sticky PR comment covers when csharp-ci and scala-ci comment on the same PR.actions/setup-javav5.0.0 -> v5.2.0 andactions/cachev4.2.3 -> v5.0.5 (cache v5 moves to Node 24; GitHub-hosted runners already meet the 2.327.1 minimum and thewith:keys we set are unchanged).Test plan
peacefulstudio/daml-codegen-csharp#164(branchci/test-csharp-ci-pr1) is updated to pin itsjvm-helper-cijob to this PR's head SHA, point atscala-ci.yaml, and replace its inline steps with auses:call.jvm-helper/coverage/merged/Cobertura.xml, the sticky comment posts with headerscala-coverageand a visible## Scala coverageheading, and the artifact uploads under namescala-coverage.actionlint v1.7.7(the same version used by this repo'sbuild-and-testworkflow) passes cleanly on the new file.