Skip to content

Add unit-tests as composite action - #39

Open
antsundq wants to merge 6 commits into
elijah286:mainfrom
antsundq:main
Open

Add unit-tests as composite action#39
antsundq wants to merge 6 commits into
elijah286:mainfrom
antsundq:main

Conversation

@antsundq

Copy link
Copy Markdown
Contributor

Hi,

As discussed during our call, the idiomatic way to call 3rd party action from within a workflow is using the uses keyword 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:

jobs:
  unit-tests:
    runs-on: windows-2022
    steps:
      - uses: actions/checkout@v6

      - uses: antsundq/LabVIEW-CI-with-Containers/actions/unit-tests@main
        with:
          image: ghcr.io/antsundq/lunit-integration-test-labview:2026
          framework: lunit
          test-dir: tests
          labview-version: '2026'

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

antsundq added 6 commits July 28, 2026 03:58
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.
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant