Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions actions/OpenSourceActions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'Invoke-RunPesterTests'
'Invoke-RunUnitTests'
'Invoke-SetDevelopmentMode'
'Invoke-ViaLvDocker'
)

PrivateData = @{
Expand Down
30 changes: 30 additions & 0 deletions actions/OpenSourceActions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,33 @@ function Invoke-SetDevelopmentMode {
$args = @{ RelativePath = $RelativePath }
return Invoke-OpenSourceActionScript -ScriptSegments @('set-development-mode','Set_Development_Mode.ps1') -Arguments $args -DryRun:$DryRun -gcliPath $gcliPath
}

# Runs VI Analyzer tests using LabVIEW Docker container.
# ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files.
# TemplatePath: Path to .viancfg template (required when generating config dynamically).
# BaseBranch: Branch to compare against for changed files (used when generating config).
# LabviewVersion: LabVIEW Docker image version tag.
# DockerImage: Full Docker image name.
# DryRun: If set, prints the command instead of executing it.
# gcliPath: Optional path prepended to PATH for locating the g CLI.
function Invoke-ViaLvDocker {
[CmdletBinding()]
param(
[Parameter()] [string] $ConfigPath = '',
[Parameter()] [string] $TemplatePath = '',
[Parameter()] [string] $BaseBranch = 'origin/develop',
[Parameter()] [string] $LabviewVersion = '2026q1-linux',
[Parameter()] [string] $DockerImage = 'nationalinstruments/labview',
[Parameter()] [switch] $DryRun,
[Parameter()] [string] $gcliPath
)
Write-Information "Executing ViaLvDocker (DryRun=$DryRun)"
$args = @{
ConfigPath = $ConfigPath
TemplatePath = $TemplatePath
BaseBranch = $BaseBranch
LabviewVersion = $LabviewVersion
DockerImage = $DockerImage
}
return Invoke-OpenSourceActionScript -ScriptSegments @('via-lv-docker','RunViaLvDocker.ps1') -Arguments $args -DryRun:$DryRun -gcliPath $gcliPath
}
105 changes: 104 additions & 1 deletion artifacts/linux/action-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,51 @@
}
}
},
"Invoke-ViaLvDocker": {
"description": "Runs VI Analyzer tests using LabVIEW Docker container. ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files. TemplatePath: Path to .viancfg template (required when generating config dynamically). BaseBranch: Branch to compare against for changed files (used when generating config). LabviewVersion: LabVIEW Docker image version tag. DockerImage: Full Docker image name. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.",
"parameters": {
"BaseBranch": {
"type": "string",
"required": false,
"default": "origin/develop",
"description": "Branch to compare against for changed files (used when generating config)"
},
"ConfigPath": {
"type": "string",
"required": false,
"default": "",
"description": "Path to VI Analyzer configuration file ("
},
"DockerImage": {
"type": "string",
"required": false,
"default": "nationalinstruments/labview",
"description": "Full Docker image name"
},
"DryRun": {
"type": "boolean",
"required": false,
"description": "If set, prints the command instead of executing it"
},
"gcliPath": {
"type": "string",
"required": false,
"description": "Optional path prepended to PATH for locating the g CLI"
},
"LabviewVersion": {
"type": "string",
"required": false,
"default": "2026q1-linux",
"description": "LabVIEW Docker image version tag"
},
"TemplatePath": {
"type": "string",
"required": false,
"default": "",
"description": "Path to"
}
}
},
"Normalize-RelativePath": {
"description": "Normalizes a RelativePath value against an optional base directory. RelativePath: Path to normalize. BaseDirectory: Directory used to resolve the relative path. Defaults to the current location.",
"parameters": {
Expand Down Expand Up @@ -1623,6 +1668,64 @@
"type": "string"
}
],
"setup-mkdocs": []
"setup-mkdocs": [],
"via-lv-docker": [
{
"name": "config_path",
"description": "Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb)",
"required": false,
"default": "",
"type": "string"
},
{
"name": "template_path",
"description": "Path to .viancfg template (required to generate config file dynamically)",
"required": false,
"default": "",
"type": "string"
},
{
"name": "base_branch",
"description": "Branch to compare against for changed files (used when generating config)",
"required": false,
"default": "origin/develop",
"type": "string"
},
{
"name": "labview_version",
"description": "LabVIEW Docker image version tag",
"required": false,
"default": "2026q1-linux",
"type": "string"
},
{
"name": "docker_image",
"description": "Full Docker image name",
"required": false,
"default": "nationalinstruments/labview",
"type": "string"
},
{
"name": "working_directory",
"description": "Working directory where the action will run.",
"required": false,
"default": "",
"type": "string"
},
{
"name": "log_level",
"description": "Verbosity level (ERROR|WARN|INFO|DEBUG).",
"required": false,
"default": "INFO",
"type": "string"
},
{
"name": "dry_run",
"description": "If true, simulate the action without side effects.",
"required": false,
"default": false,
"type": "string"
}
]
}
}
30 changes: 29 additions & 1 deletion artifacts/linux/action-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,22 @@ Configures the repository for development mode. RelativePath: Normalized path to
pwsh ./actions/Invoke-OSAction.ps1 -ActionName Invoke-SetDevelopmentMode -ArgsJson '{}'
```

#### Invoke-ViaLvDocker
Runs VI Analyzer tests using LabVIEW Docker container. ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files. TemplatePath: Path to .viancfg template (required when generating config dynamically). BaseBranch: Branch to compare against for changed files (used when generating config). LabviewVersion: LabVIEW Docker image version tag. DockerImage: Full Docker image name. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.
| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| BaseBranch | string | false | origin/develop | Branch to compare against for changed files (used when generating config) |
| ConfigPath | string | false | | Path to VI Analyzer configuration file ( |
| DockerImage | string | false | nationalinstruments/labview | Full Docker image name |
| DryRun | boolean | false | | If set, prints the command instead of executing it |
| LabviewVersion | string | false | 2026q1-linux | LabVIEW Docker image version tag |
| TemplatePath | string | false | | Path to |
| gcliPath | string | false | | Optional path prepended to PATH for locating the g CLI |

```powershell
pwsh ./actions/Invoke-OSAction.ps1 -ActionName Invoke-ViaLvDocker -ArgsJson '{}'
```

#### Normalize-RelativePath
Normalizes a RelativePath value against an optional base directory. RelativePath: Path to normalize. BaseDirectory: Directory used to resolve the relative path. Defaults to the current location.
| Parameter | Type | Required | Default | Description |
Expand Down Expand Up @@ -479,4 +495,16 @@ pwsh ./actions/Invoke-OSAction.ps1 -ActionName Set-LogLevel -ArgsJson '{}'

#### setup-mkdocs
| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| --- | --- | --- | --- | --- |

#### via-lv-docker
| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| config_path | string | false | | Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb) |
| template_path | string | false | | Path to .viancfg template (required to generate config file dynamically) |
| base_branch | string | false | origin/develop | Branch to compare against for changed files (used when generating config) |
| labview_version | string | false | 2026q1-linux | LabVIEW Docker image version tag |
| docker_image | string | false | nationalinstruments/labview | Full Docker image name |
| working_directory | string | false | | Working directory where the action will run. |
| log_level | string | false | INFO | Verbosity level (ERROR|WARN|INFO|DEBUG). |
| dry_run | string | false | false | If true, simulate the action without side effects. |
45 changes: 45 additions & 0 deletions dispatchers.json
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,51 @@
}
}
},
"Invoke-ViaLvDocker": {
"description": "Runs VI Analyzer tests using LabVIEW Docker container. ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files. TemplatePath: Path to .viancfg template (required when generating config dynamically). BaseBranch: Branch to compare against for changed files (used when generating config). LabviewVersion: LabVIEW Docker image version tag. DockerImage: Full Docker image name. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.",
"parameters": {
"BaseBranch": {
"type": "string",
"required": false,
"default": "origin/develop",
"description": "Branch to compare against for changed files (used when generating config)"
},
"ConfigPath": {
"type": "string",
"required": false,
"default": "",
"description": "Path to VI Analyzer configuration file ("
},
"DockerImage": {
"type": "string",
"required": false,
"default": "nationalinstruments/labview",
"description": "Full Docker image name"
},
"DryRun": {
"type": "boolean",
"required": false,
"description": "If set, prints the command instead of executing it"
},
"gcliPath": {
"type": "string",
"required": false,
"description": "Optional path prepended to PATH for locating the g CLI"
},
"LabviewVersion": {
"type": "string",
"required": false,
"default": "2026q1-linux",
"description": "LabVIEW Docker image version tag"
},
"TemplatePath": {
"type": "string",
"required": false,
"default": "",
"description": "Path to"
}
}
},
"Normalize-RelativePath": {
"description": "Normalizes a RelativePath value against an optional base directory. RelativePath: Path to normalize. BaseDirectory: Directory used to resolve the relative path. Defaults to the current location.",
"parameters": {
Expand Down
88 changes: 88 additions & 0 deletions docs/actions/via-lv-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# via-lv-docker

## Purpose

Execute LabVIEW VI Analyzer tests using a Docker container and parse results. Supports both static configuration files and dynamic config generation based on changed files in pull requests.

## Parameters

Common parameters are described in [Common parameters](../common-parameters.md).

### Required

None. All parameters have default values.

### Optional

- **ConfigPath** (`string`): Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi/ .ctl/ .llb). If empty, generates config from changed files.
- **TemplatePath** (`string`): Path to .viancfg template (required when generating config dynamically).
- **BaseBranch** (`string`): Branch to compare against for changed files (used when generating config). Default: `origin/develop`.
- **LabviewVersion** (`string`): LabVIEW Docker image version tag. Default: `2026q1-linux`.
- **DockerImage** (`string`): Full Docker image name. Default: `nationalinstruments/labview`.

### GitHub Action inputs

GitHub Action inputs are provided in `snake_case`, while CLI parameters use `PascalCase`. The table below maps each input to its corresponding CLI parameter. For details on shared CLI flags, see [Common parameters](../common-parameters.md).

| Input | CLI parameter | Description |
| --- | --- | --- |
| `config_path` | `ConfigPath` | Path to VI Analyzer configuration file (.viancfg). |
| `template_path` | `TemplatePath` | Path to .viancfg template. |
| `base_branch` | `BaseBranch` | Branch to compare against for changed files. |
| `labview_version` | `LabviewVersion` | LabVIEW Docker image version tag. |
| `docker_image` | `DockerImage` | Full Docker image name. |
| `working_directory` | `WorkingDirectory` | Directory where the action runs. |
| `log_level` | `LogLevel` | Verbosity level (ERROR\|WARN\|INFO\|DEBUG). |
| `dry_run` | `DryRun` | If true, simulate the action without side effects. |

## Examples

### CLI

```powershell
pwsh -File actions/Invoke-OSAction.ps1 -ActionName via-lv-docker -ArgsJson '{
"ConfigPath": "my-config.viancfg",
"LabviewVersion": "2026q1-linux"
}'
```

### GitHub Action - Static Config

```yaml
- name: Run VI Analyzer
uses: ni/open-source/via-lv-docker@v1
with:
config_path: '.github/via-config.viancfg'
labview_version: '2026q1-linux'
```

### GitHub Action - Dynamic Config from Changed Files

This is useful to have for PR checks.

```yaml
- name: Run VI Analyzer on Changed Files
uses: ni/open-source/via-lv-docker@v1
with:
base_branch: 'origin/${{ github.event.pull_request.base.ref }}'
template_path: '.github/via_template.viancfg'
```

## Outputs

- **vi-analyzer-report.htm**: HTML report generated by VI Analyzer
- Console output with parsed test results showing passes, failures, and errors

## Return Codes

- `0` – all VI Analyzer tests passed
- non‑zero – tests failed or analyzer error

See [via-lv-docker/action.yml](../../via-lv-docker/action.yml) and [scripts/via-lv-docker/RunViaLvDocker.ps1](../../scripts/via-lv-docker/RunViaLvDocker.ps1) for implementation details.

For troubleshooting tips, see the [troubleshooting guide](../troubleshooting.md).

## See also

- [Workflow documentation](../workflows/via-lv-docker.md)
- [scripts/via-lv-docker/README.md](../../scripts/via-lv-docker/README.md)
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Open Source LabVIEW Actions unifies LabVIEW [CI/CD](glossary.md#ci-cd) scripts b
| [run-unit-tests](actions/run-unit-tests.md) | Run LabVIEW unit tests via the LabVIEW Unit Test Framework CLI and report pass/fail/error using standard exit codes. |
| [set-development-mode](actions/set-development-mode.md) | Configure the repository for development mode by removing packed libraries, adding tokens, preparing sources, and closing LabVIEW. |
| [setup-mkdocs](actions/setup-mkdocs.md) | Install a pinned MkDocs with caching. |
| [via-lv-docker](actions/via-lv-docker.md) | Execute LabVIEW VI Analyzer tests using a Docker container and parse results. |

## Workflow Examples

Expand All @@ -59,3 +60,4 @@ Open Source LabVIEW Actions unifies LabVIEW [CI/CD](glossary.md#ci-cd) scripts b
| [run-unit-tests](workflows/run-unit-tests.md) | Run LabVIEW unit tests via the LabVIEW Unit Test Framework CLI and report pass/fail/error using standard exit codes. |
| [set-development-mode](workflows/set-development-mode.md) | Configure the repository for development mode by removing packed libraries, adding tokens, preparing sources, and closing LabVIEW. |
| [setup-mkdocs](workflows/setup-mkdocs.md) | Install a pinned MkDocs with caching. |
| [via-lv-docker](workflows/via-lv-docker.md) | Execute LabVIEW VI Analyzer tests using a Docker container and parse results. |
Loading
Loading