feat(csharp-publish): add working-directory + test-filter inputs - #11
Merged
Conversation
Lets repos whose solution lives below the repo root (e.g. canton-localnet's csharp/) use the reusable publish workflow, and exclude infra-dependent tests via a dotnet test --filter expression. Both inputs default to prior behaviour, so existing callers are bit-for-bit unaffected. Pack output moves to $GITHUB_WORKSPACE/output so the root-level upload/push steps are unaffected by working_directory.
Rename working_directory/test_filter to working-directory/test-filter so the publish workflow's inputs match the hyphenated names already used by csharp-ci.yaml, scala-ci.yaml and terraform-ci.yaml. Also harden the Test step with set -euo pipefail to match the other multi-line steps.
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.
Pre-open
Multi-agent pre-open review (thorough). Addressed before review:
working_directory/test_filter→working-directory/test-filterto match the hyphenated input convention already used bycsharp-ci.yaml,scala-ci.yaml, andterraform-ci.yaml.Teststep withset -euo pipefailto match the other multi-line steps.Verified by reviewers: pack output (
$GITHUB_WORKSPACE/output/nuget) lines up with the root-level upload + nuget.org push steps for both.and a sub-path; test failures still fail the job; existing callers remain bit-for-bit unaffected.What
Two backward-compatible inputs on the reusable
csharp-publish-public.yaml:working-directory(default.) — runs the restore/build/test/pack steps from a sub-path so a repo whose solution lives below the root (e.g.canton-localnet'scsharp/) can consume this workflow. Pack output moves to$GITHUB_WORKSPACE/output/nugetso the root-level upload + nuget.org push steps are unaffected.test-filter(default empty) — passes adotnet test --filterexpression (e.g.Category!=Integration) to exclude tests that need live infrastructure.Why
Wiring
canton-localnet's public mirror to publishPeaceful.Canton.Localnet.Testingto nuget.org via this shared workflow. Its C# project lives incsharp/and its integration tests (Category=Integration) need a running LocalNet, so the root-only / unfiltered assumptions didn't fit.Compatibility
Both inputs default to prior behaviour —
dotnet-extensionsand any other caller are bit-for-bit unaffected. Requires the usual governed@v1retag after merge.