Add unit-tests as composite action - #39
Open
antsundq wants to merge 6 commits into
Open
Conversation
Add a new, distributable composite GitHub Action that lets any consumer repo run a LabVIEW unit-test framework (Caraya, VI Tester, NI UTF, or Astemes LUnit) inside a container in one step and publish an HTML report, without needing their own copy of the scripts or a labview-ci.yml config.
…e shared LabVIEW worker image
…ithub/labview/vipm/ path
…ile inside context
… calls The 'not found' case from crane digest is how create/update is detected, but it left $LASTEXITCODE non-zero through Write-Host/Out-File (which don't touch it), so GitHub Actions' pwsh wrapper failed the step on every single create/update run before Build and push ever executed.
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.
Hi,
As discussed during our call, the idiomatic way to call 3rd party action from within a workflow is using the
useskeyword and the action lives as a composite action in an external repository.The benefits is that nothing needs to be added into the .github folder of the client repo, except the reference in the workflow yml file. This makes it cleaner to pick and choose which actions to run from this repo and integrate it into existing pipelines, which is the use case that is most appealing to myself.
This PR adds actions/unit-tests, a composite GitHub Action that lets any consumer repo run a LabVIEW unit-test framework (Caraya, VI Tester, NI UTF, or LUnit) inside a container and publish an HTML report with a single uses: step and no vendored scripts or .github/labview-ci.yml config required in the consumer repo.
To support this, .github/labview/run-unit-tests.ps1 gains an optional single-framework mode (-Framework/-TestDir/-Command, with LVCI_FRAMEWORK/LVCI_TEST_DIR/LVCI_COMMAND env-var fallbacks) so the same script serves both the existing config-file-driven vendored workflow and the new action's input-driven mode. Behavior is unchanged when -Framework isn't set.
Two PS1 scripts are copied into the new location. This is because a composite action can only mount its own directory into the container, not other paths in the consumer's checkout. Kept in sync by copy, per the sync note in action.yml's header.
Testing:
I run a full end-to-end test with results available here:
https://github.com/antsundq/lunit-integration-test/actions/runs/30298572439
Note that the only thing that needs to be in the client repos workflow yaml file is something like this:
Now, this requires that the container image already exists and is baked with correct tooling. I think we need to add another composite action for doing this. I'll have a look into this.
/Anton