diff --git a/actions/Invoke-OSAction.ps1 b/actions/Invoke-OSAction.ps1 index 5785670a..388ee1e2 100644 --- a/actions/Invoke-OSAction.ps1 +++ b/actions/Invoke-OSAction.ps1 @@ -20,22 +20,25 @@ Import-Module (Join-Path $PSScriptRoot 'OpenSourceActions.psm1') -Force # Attempt to build registry from generated dispatcher metadata; fall back to # a static map only if loading fails or produces no entries. $FallbackRegistry = [ordered]@{ - 'add-token-to-labview' = 'Invoke-AddTokenToLabVIEW' - 'apply-vipc' = 'Invoke-ApplyVIPC' - 'build' = 'Invoke-Build' - 'build-lvlibp' = 'Invoke-BuildLvlibp' - 'build-vi-package' = 'Invoke-BuildViPackage' - 'close-labview' = 'Invoke-CloseLabVIEW' - 'generate-release-notes' = 'Invoke-GenerateReleaseNotes' - 'missing-in-project' = 'Invoke-MissingInProject' - 'modify-vipb-display-info' = 'Invoke-ModifyVIPBDisplayInfo' - 'prepare-labview-source' = 'Invoke-PrepareLabVIEWSource' - 'rename-file' = 'Invoke-RenameFile' - 'restore-setup-lv-source' = 'Invoke-RestoreSetupLVSource' - 'revert-development-mode' = 'Invoke-RevertDevelopmentMode' - 'run-pester-tests' = 'Invoke-RunPesterTests' - 'run-unit-tests' = 'Invoke-RunUnitTests' - 'set-development-mode' = 'Invoke-SetDevelopmentMode' + 'add-token-to-labview' = 'Invoke-AddTokenToLabVIEW' + 'apply-vipc' = 'Invoke-ApplyVIPC' + 'build' = 'Invoke-Build' + 'build-lvlibp' = 'Invoke-BuildLvlibp' + 'build-lvlibp-docker-linux' = 'Invoke-BuildLvlibpDockerLinux' + 'build-lvlibp-docker-windows' = 'Invoke-BuildLvlibpDockerWindows' + 'build-lvlibp-github-hosted-windows' = 'Invoke-BuildLvlibpGithubHostedWindows' + 'build-vi-package' = 'Invoke-BuildViPackage' + 'close-labview' = 'Invoke-CloseLabVIEW' + 'generate-release-notes' = 'Invoke-GenerateReleaseNotes' + 'missing-in-project' = 'Invoke-MissingInProject' + 'modify-vipb-display-info' = 'Invoke-ModifyVIPBDisplayInfo' + 'prepare-labview-source' = 'Invoke-PrepareLabVIEWSource' + 'rename-file' = 'Invoke-RenameFile' + 'restore-setup-lv-source' = 'Invoke-RestoreSetupLVSource' + 'revert-development-mode' = 'Invoke-RevertDevelopmentMode' + 'run-pester-tests' = 'Invoke-RunPesterTests' + 'run-unit-tests' = 'Invoke-RunUnitTests' + 'set-development-mode' = 'Invoke-SetDevelopmentMode' } $Registry = $null diff --git a/actions/OpenSourceActions.psd1 b/actions/OpenSourceActions.psd1 index 9af292f6..d5ef1a88 100644 --- a/actions/OpenSourceActions.psd1 +++ b/actions/OpenSourceActions.psd1 @@ -15,6 +15,9 @@ 'Invoke-ApplyVIPC' 'Invoke-Build' 'Invoke-BuildLvlibp' + 'Invoke-BuildLvlibpDockerLinux' + 'Invoke-BuildLvlibpDockerWindows' + 'Invoke-BuildLvlibpGithubHostedWindows' 'Invoke-BuildViPackage' 'Invoke-CloseLabVIEW' 'Invoke-ConfigureLabview' diff --git a/actions/OpenSourceActions.psm1 b/actions/OpenSourceActions.psm1 index 0b014aed..99ee69de 100644 --- a/actions/OpenSourceActions.psm1 +++ b/actions/OpenSourceActions.psm1 @@ -228,6 +228,171 @@ function Invoke-BuildLvlibp { return Invoke-OpenSourceActionScript -ScriptSegments @('build-lvlibp','Build_lvlibp.ps1') -Arguments $args -DryRun:$DryRun -gcliPath $gcliPath } +# Builds LabVIEW Packed Project Library (.lvlibp) using Linux Docker container. +# MinimumSupportedLVVersion: LabVIEW version for the build (e.g., "2021", "2026"). +# SupportedBitness: Bitness of the LabVIEW environment ("32" or "64"). +# ProjectPath: Path to the LabVIEW project .lvproj file. +# TargetName: Target that contains the build specification (optional, defaults to "My Computer"). +# BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). +# Major: Major version component (optional, skips version setting if < 0). +# Minor: Minor version component (optional, skips version setting if < 0). +# Patch: Patch version component (optional, skips version setting if < 0). +# Build: Build number component (optional, skips version setting if < 0). +# Commit: Commit hash or identifier (optional). +# DockerImage: Docker image name (default: "nationalinstruments/labview"). +# ImageTag: Docker image tag (defaults to "2026q1-linux"). +# DryRun: If set, prints the command instead of executing it. +# gcliPath: Optional path prepended to PATH for locating the g CLI. +function Invoke-BuildLvlibpDockerLinux { + [CmdletBinding()] + param( + [Parameter(Mandatory)] [string] $MinimumSupportedLVVersion, + [Parameter(Mandatory)] [string] $SupportedBitness, + [Parameter(Mandatory)] [string] $ProjectPath, + [Parameter()] [string] $TargetName = "", + [Parameter()] [string] $BuildSpecName = "", + [Parameter()] [int] $Major = -1, + [Parameter()] [int] $Minor = -1, + [Parameter()] [int] $Patch = -1, + [Parameter()] [int] $Build = -1, + [Parameter()] [string] $Commit = "", + [Parameter()] [string] $DockerImage = "nationalinstruments/labview", + [Parameter()] [string] $ImageTag = "2026q1-linux", + [switch] $DryRun, + [string] $gcliPath + ) + Write-Information "Invoking BuildLvlibpDockerLinux" -InformationAction Continue + + $result = Invoke-OpenSourceActionScript ` + -ScriptSegments @('build-lvlibp-docker-linux', 'BuildLvlibpDockerLinux.ps1') ` + -Arguments @{ + MinimumSupportedLVVersion = $MinimumSupportedLVVersion + SupportedBitness = $SupportedBitness + ProjectPath = $ProjectPath + TargetName = $TargetName + BuildSpecName = $BuildSpecName + Major = $Major + Minor = $Minor + Patch = $Patch + Build = $Build + Commit = $Commit + DockerImage = $DockerImage + ImageTag = $ImageTag + } ` + -DryRun:$DryRun ` + -gcliPath $gcliPath + + return $result +} + +# Builds LabVIEW Packed Project Library (.lvlibp) using Windows Docker container. +# MinimumSupportedLVVersion: LabVIEW version for the build (e.g., "2021", "2026"). +# SupportedBitness: Bitness of the LabVIEW environment ("32" or "64"). +# ProjectPath: Path to the LabVIEW project .lvproj file. +# TargetName: Target that contains the build specification (optional, defaults to "My Computer"). +# BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). +# Major: Major version component (optional, skips version setting if < 0). +# Minor: Minor version component (optional, skips version setting if < 0). +# Patch: Patch version component (optional, skips version setting if < 0). +# Build: Build number component (optional, skips version setting if < 0). +# Commit: Commit hash or identifier (optional). +# DockerImage: Docker image name (default: "nationalinstruments/labview"). +# ImageTag: Docker image tag (defaults to "2026q1-windows"). +# DryRun: If set, prints the command instead of executing it. +# gcliPath: Optional path prepended to PATH for locating the g CLI. +function Invoke-BuildLvlibpDockerWindows { + [CmdletBinding()] + param( + [Parameter(Mandatory)] [string] $MinimumSupportedLVVersion, + [Parameter(Mandatory)] [string] $SupportedBitness, + [Parameter(Mandatory)] [string] $ProjectPath, + [Parameter()] [string] $TargetName = "", + [Parameter()] [string] $BuildSpecName = "", + [Parameter()] [int] $Major = -1, + [Parameter()] [int] $Minor = -1, + [Parameter()] [int] $Patch = -1, + [Parameter()] [int] $Build = -1, + [Parameter()] [string] $Commit = "", + [Parameter()] [string] $DockerImage = "nationalinstruments/labview", + [Parameter()] [string] $ImageTag = "2026q1-windows", + [switch] $DryRun, + [string] $gcliPath + ) + Write-Information "Invoking BuildLvlibpDockerWindows" -InformationAction Continue + + $result = Invoke-OpenSourceActionScript ` + -ScriptSegments @('build-lvlibp-docker-windows', 'BuildLvlibpDockerWindows.ps1') ` + -Arguments @{ + MinimumSupportedLVVersion = $MinimumSupportedLVVersion + SupportedBitness = $SupportedBitness + ProjectPath = $ProjectPath + TargetName = $TargetName + BuildSpecName = $BuildSpecName + Major = $Major + Minor = $Minor + Patch = $Patch + Build = $Build + Commit = $Commit + DockerImage = $DockerImage + ImageTag = $ImageTag + } ` + -DryRun:$DryRun ` + -gcliPath $gcliPath + + return $result +} + +# Builds LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner. +# MinimumSupportedLVVersion: LabVIEW version for the build (e.g., "2021", "2026"). +# SupportedBitness: Bitness of the LabVIEW environment ("32" or "64"). +# ProjectPath: Path to the LabVIEW project .lvproj file. +# TargetName: Target that contains the build specification (optional, defaults to "My Computer"). +# BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). +# Major: Major version component (optional, skips version setting if < 0). +# Minor: Minor version component (optional, skips version setting if < 0). +# Patch: Patch version component (optional, skips version setting if < 0). +# Build: Build number component (optional, skips version setting if < 0). +# Commit: Commit hash or identifier (optional). +# DryRun: If set, prints the command instead of executing it. +# gcliPath: Optional path prepended to PATH for locating the g CLI. +function Invoke-BuildLvlibpGithubHostedWindows { + [CmdletBinding()] + param( + [Parameter(Mandatory)] [string] $MinimumSupportedLVVersion, + [Parameter(Mandatory)] [string] $SupportedBitness, + [Parameter(Mandatory)] [string] $ProjectPath, + [Parameter()] [string] $TargetName = "", + [Parameter()] [string] $BuildSpecName = "", + [Parameter()] [int] $Major = -1, + [Parameter()] [int] $Minor = -1, + [Parameter()] [int] $Patch = -1, + [Parameter()] [int] $Build = -1, + [Parameter()] [string] $Commit = "", + [switch] $DryRun, + [string] $gcliPath + ) + Write-Information "Invoking BuildLvlibpGithubHostedWindows" -InformationAction Continue + + $result = Invoke-OpenSourceActionScript ` + -ScriptSegments @('build-lvlibp-github-hosted-windows', 'BuildLvlibpGithubHostedWindows.ps1') ` + -Arguments @{ + MinimumSupportedLVVersion = $MinimumSupportedLVVersion + SupportedBitness = $SupportedBitness + ProjectPath = $ProjectPath + TargetName = $TargetName + BuildSpecName = $BuildSpecName + Major = $Major + Minor = $Minor + Patch = $Patch + Build = $Build + Commit = $Commit + } ` + -DryRun:$DryRun ` + -gcliPath $gcliPath + + return $result +} + # Closes any running instance of LabVIEW. # MinimumSupportedLVVersion: Minimum LabVIEW version that the project supports. # SupportedBitness: Target LabVIEW bitness (32- or 64-bit). diff --git a/artifacts/linux/action-docs.json b/artifacts/linux/action-docs.json index 7ac875de..2caf2774 100644 --- a/artifacts/linux/action-docs.json +++ b/artifacts/linux/action-docs.json @@ -196,6 +196,246 @@ } } }, + "Invoke-BuildLvlibpDockerLinux": { + "description": "Builds LabVIEW Packed Project Library (.lvlibp) using Linux Docker container. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., \"2021\", \"2026\"). SupportedBitness: Bitness of the LabVIEW environment (\"32\" or \"64\"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to \"My Computer\"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (defaults to \"2026q1-linux\"). DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", + "parameters": { + "Build": { + "type": "number", + "required": false, + "default": "-1", + "description": "Build number component (optional, skips version setting if < 0)" + }, + "BuildSpecName": { + "type": "string", + "required": false, + "default": "", + "description": "Name of the LabVIEW build specification (optional, builds all if empty)" + }, + "Commit": { + "type": "string", + "required": false, + "default": "", + "description": "Commit hash or identifier (optional)" + }, + "DockerImage": { + "type": "string", + "required": false, + "default": "nationalinstruments/labview", + "description": "Docker image name (default: \"nationalinstruments/labview\")" + }, + "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" + }, + "ImageTag": { + "type": "string", + "required": false, + "default": "2026q1-linux", + "description": "Docker image tag (defaults to \"2026q1-linux\")" + }, + "Major": { + "type": "number", + "required": false, + "default": "-1", + "description": "Major version component (optional, skips version setting if < 0)" + }, + "MinimumSupportedLVVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version for the build (e" + }, + "Minor": { + "type": "number", + "required": false, + "default": "-1", + "description": "Minor version component (optional, skips version setting if < 0)" + }, + "Patch": { + "type": "number", + "required": false, + "default": "-1", + "description": "Patch version component (optional, skips version setting if < 0)" + }, + "ProjectPath": { + "type": "string", + "required": true, + "description": "Path to the LabVIEW project" + }, + "SupportedBitness": { + "type": "string", + "required": true, + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\")" + }, + "TargetName": { + "type": "string", + "required": false, + "default": "", + "description": "Target that contains the build specification (optional, defaults to \"My Computer\")" + } + } + }, + "Invoke-BuildLvlibpDockerWindows": { + "description": "Builds LabVIEW Packed Project Library (.lvlibp) using Windows Docker container. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., \"2021\", \"2026\"). SupportedBitness: Bitness of the LabVIEW environment (\"32\" or \"64\"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to \"My Computer\"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (defaults to \"2026q1-windows\"). DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", + "parameters": { + "Build": { + "type": "number", + "required": false, + "default": "-1", + "description": "Build number component (optional, skips version setting if < 0)" + }, + "BuildSpecName": { + "type": "string", + "required": false, + "default": "", + "description": "Name of the LabVIEW build specification (optional, builds all if empty)" + }, + "Commit": { + "type": "string", + "required": false, + "default": "", + "description": "Commit hash or identifier (optional)" + }, + "DockerImage": { + "type": "string", + "required": false, + "default": "nationalinstruments/labview", + "description": "Docker image name (default: \"nationalinstruments/labview\")" + }, + "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" + }, + "ImageTag": { + "type": "string", + "required": false, + "default": "2026q1-windows", + "description": "Docker image tag (defaults to \"2026q1-windows\")" + }, + "Major": { + "type": "number", + "required": false, + "default": "-1", + "description": "Major version component (optional, skips version setting if < 0)" + }, + "MinimumSupportedLVVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version for the build (e" + }, + "Minor": { + "type": "number", + "required": false, + "default": "-1", + "description": "Minor version component (optional, skips version setting if < 0)" + }, + "Patch": { + "type": "number", + "required": false, + "default": "-1", + "description": "Patch version component (optional, skips version setting if < 0)" + }, + "ProjectPath": { + "type": "string", + "required": true, + "description": "Path to the LabVIEW project" + }, + "SupportedBitness": { + "type": "string", + "required": true, + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\")" + }, + "TargetName": { + "type": "string", + "required": false, + "default": "", + "description": "Target that contains the build specification (optional, defaults to \"My Computer\")" + } + } + }, + "Invoke-BuildLvlibpGithubHostedWindows": { + "description": "Builds LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., \"2021\", \"2026\"). SupportedBitness: Bitness of the LabVIEW environment (\"32\" or \"64\"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to \"My Computer\"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", + "parameters": { + "Build": { + "type": "number", + "required": false, + "default": "-1", + "description": "Build number component (optional, skips version setting if < 0)" + }, + "BuildSpecName": { + "type": "string", + "required": false, + "default": "", + "description": "Name of the LabVIEW build specification (optional, builds all if empty)" + }, + "Commit": { + "type": "string", + "required": false, + "default": "", + "description": "Commit hash or identifier (optional)" + }, + "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" + }, + "Major": { + "type": "number", + "required": false, + "default": "-1", + "description": "Major version component (optional, skips version setting if < 0)" + }, + "MinimumSupportedLVVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version for the build (e" + }, + "Minor": { + "type": "number", + "required": false, + "default": "-1", + "description": "Minor version component (optional, skips version setting if < 0)" + }, + "Patch": { + "type": "number", + "required": false, + "default": "-1", + "description": "Patch version component (optional, skips version setting if < 0)" + }, + "ProjectPath": { + "type": "string", + "required": true, + "description": "Path to the LabVIEW project" + }, + "SupportedBitness": { + "type": "string", + "required": true, + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\")" + }, + "TargetName": { + "type": "string", + "required": false, + "default": "", + "description": "Target that contains the build specification (optional, defaults to \"My Computer\")" + } + } + }, "Invoke-BuildViPackage": { "description": "Builds a VI Package using the provided VIPB file and version metadata. MinimumSupportedLVVersion: Minimum LabVIEW version that the package supports. SupportedBitness: Target LabVIEW bitness (32- or 64-bit). LabVIEWMinorRevision: Minor revision of LabVIEW used to build the package. RelativePath: Normalized path to the project root relative to the working directory. VIPBPath: Path to the VIPB build specification file. Major: Major version component. Minor: Minor version component. Patch: Patch version component. Build: Build number component. Commit: Commit identifier used for the build metadata. DisplayInformationJSON: JSON string containing display information for the package. ReleaseNotesFile: Optional path to a release notes file. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", "parameters": { @@ -797,43 +1037,6 @@ } }, "wrappers": { - "activate-labview": [ - { - "name": "serial_number", - "description": "LabVIEW serial number for activation.", - "required": true, - "default": "", - "type": "string" - }, - { - "name": "package_id", - "description": "LabVIEW package ID to activate.", - "required": false, - "default": "LabVIEW_COM_PKG 25.0300", - "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" - } - ], "add-token-to-labview": [ { "name": "minimum_supported_lv_version", @@ -1143,6 +1346,313 @@ "type": "string" } ], + "build-lvlibp-docker-linux": [ + { + "name": "minimum_supported_lv_version", + "description": "LabVIEW version year for the build (e.g., \"2021\", \"2026\").", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "supported_bitness", + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\").", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "project_path", + "description": "Path to the LabVIEW project .lvproj file.", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "target_name", + "description": "Target that contains the build specification. Defaults to \"My Computer\" in helper VI.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "build_spec_name", + "description": "Name of the build specification. If empty, builds all specifications in the target.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "major", + "description": "Major version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "minor", + "description": "Minor version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "patch", + "description": "Patch version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "build", + "description": "Build number component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "commit", + "description": "Commit hash or identifier recorded in the build.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "docker_image", + "description": "Docker image name.", + "required": false, + "default": "nationalinstruments/labview", + "type": "string" + }, + { + "name": "image_tag", + "description": "Docker image tag.", + "required": false, + "default": "2026q1-linux", + "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" + } + ], + "build-lvlibp-docker-windows": [ + { + "name": "minimum_supported_lv_version", + "description": "LabVIEW version year for the build (e.g., \"2021\", \"2026\").", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "supported_bitness", + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\").", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "project_path", + "description": "Path to the LabVIEW project .lvproj file.", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "target_name", + "description": "Target that contains the build specification. Defaults to \"My Computer\" in helper VI.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "build_spec_name", + "description": "Name of the build specification. If empty, builds all specifications in the target.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "major", + "description": "Major version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "minor", + "description": "Minor version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "patch", + "description": "Patch version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "build", + "description": "Build number component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "commit", + "description": "Commit hash or identifier recorded in the build.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "docker_image", + "description": "Docker image name.", + "required": false, + "default": "nationalinstruments/labview", + "type": "string" + }, + { + "name": "image_tag", + "description": "Docker image tag.", + "required": false, + "default": "2026q1-windows", + "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" + } + ], + "build-lvlibp-github-hosted-windows": [ + { + "name": "minimum_supported_lv_version", + "description": "LabVIEW version year for the build (e.g., \"2021\", \"2026\").", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "supported_bitness", + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\").", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "project_path", + "description": "Path to the LabVIEW project .lvproj file.", + "required": true, + "default": "", + "type": "string" + }, + { + "name": "target_name", + "description": "Target that contains the build specification. Defaults to \"My Computer\" in helper VI.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "build_spec_name", + "description": "Name of the build specification. If empty, builds all specifications in the target.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "major", + "description": "Major version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "minor", + "description": "Minor version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "patch", + "description": "Patch version component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "build", + "description": "Build number component for the PPL. Omit to skip version setting.", + "required": false, + "default": "", + "type": "string" + }, + { + "name": "commit", + "description": "Commit hash or identifier recorded in the build.", + "required": false, + "default": "", + "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" + } + ], "build-vi-package": [ { "name": "minimum_supported_lv_version", diff --git a/artifacts/linux/action-docs.md b/artifacts/linux/action-docs.md index b3827aa9..3b315766 100644 --- a/artifacts/linux/action-docs.md +++ b/artifacts/linux/action-docs.md @@ -75,6 +75,73 @@ Builds a LabVIEW Packed Library using a project and build spec. MinimumSupported pwsh ./actions/Invoke-OSAction.ps1 -ActionName Invoke-BuildLvlibp -ArgsJson '{}' ``` +#### Invoke-BuildLvlibpDockerLinux +Builds LabVIEW Packed Project Library (.lvlibp) using Linux Docker container. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., "2021", "2026"). SupportedBitness: Bitness of the LabVIEW environment ("32" or "64"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to "My Computer"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DockerImage: Docker image name (default: "nationalinstruments/labview"). ImageTag: Docker image tag (defaults to "2026q1-linux"). 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 | +| --- | --- | --- | --- | --- | +| Build | number | false | -1 | Build number component (optional, skips version setting if < 0) | +| BuildSpecName | string | false | | Name of the LabVIEW build specification (optional, builds all if empty) | +| Commit | string | false | | Commit hash or identifier (optional) | +| DockerImage | string | false | nationalinstruments/labview | Docker image name (default: "nationalinstruments/labview") | +| DryRun | boolean | false | | If set, prints the command instead of executing it | +| ImageTag | string | false | 2026q1-linux | Docker image tag (defaults to "2026q1-linux") | +| Major | number | false | -1 | Major version component (optional, skips version setting if < 0) | +| MinimumSupportedLVVersion | string | true | | LabVIEW version for the build (e | +| Minor | number | false | -1 | Minor version component (optional, skips version setting if < 0) | +| Patch | number | false | -1 | Patch version component (optional, skips version setting if < 0) | +| ProjectPath | string | true | | Path to the LabVIEW project | +| SupportedBitness | string | true | | Bitness of the LabVIEW environment ("32" or "64") | +| TargetName | string | false | | Target that contains the build specification (optional, defaults to "My Computer") | +| gcliPath | string | false | | Optional path prepended to PATH for locating the g CLI | + +```powershell +pwsh ./actions/Invoke-OSAction.ps1 -ActionName Invoke-BuildLvlibpDockerLinux -ArgsJson '{}' +``` + +#### Invoke-BuildLvlibpDockerWindows +Builds LabVIEW Packed Project Library (.lvlibp) using Windows Docker container. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., "2021", "2026"). SupportedBitness: Bitness of the LabVIEW environment ("32" or "64"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to "My Computer"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DockerImage: Docker image name (default: "nationalinstruments/labview"). ImageTag: Docker image tag (defaults to "2026q1-windows"). 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 | +| --- | --- | --- | --- | --- | +| Build | number | false | -1 | Build number component (optional, skips version setting if < 0) | +| BuildSpecName | string | false | | Name of the LabVIEW build specification (optional, builds all if empty) | +| Commit | string | false | | Commit hash or identifier (optional) | +| DockerImage | string | false | nationalinstruments/labview | Docker image name (default: "nationalinstruments/labview") | +| DryRun | boolean | false | | If set, prints the command instead of executing it | +| ImageTag | string | false | 2026q1-windows | Docker image tag (defaults to "2026q1-windows") | +| Major | number | false | -1 | Major version component (optional, skips version setting if < 0) | +| MinimumSupportedLVVersion | string | true | | LabVIEW version for the build (e | +| Minor | number | false | -1 | Minor version component (optional, skips version setting if < 0) | +| Patch | number | false | -1 | Patch version component (optional, skips version setting if < 0) | +| ProjectPath | string | true | | Path to the LabVIEW project | +| SupportedBitness | string | true | | Bitness of the LabVIEW environment ("32" or "64") | +| TargetName | string | false | | Target that contains the build specification (optional, defaults to "My Computer") | +| gcliPath | string | false | | Optional path prepended to PATH for locating the g CLI | + +```powershell +pwsh ./actions/Invoke-OSAction.ps1 -ActionName Invoke-BuildLvlibpDockerWindows -ArgsJson '{}' +``` + +#### Invoke-BuildLvlibpGithubHostedWindows +Builds LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., "2021", "2026"). SupportedBitness: Bitness of the LabVIEW environment ("32" or "64"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to "My Computer"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). 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 | +| --- | --- | --- | --- | --- | +| Build | number | false | -1 | Build number component (optional, skips version setting if < 0) | +| BuildSpecName | string | false | | Name of the LabVIEW build specification (optional, builds all if empty) | +| Commit | string | false | | Commit hash or identifier (optional) | +| DryRun | boolean | false | | If set, prints the command instead of executing it | +| Major | number | false | -1 | Major version component (optional, skips version setting if < 0) | +| MinimumSupportedLVVersion | string | true | | LabVIEW version for the build (e | +| Minor | number | false | -1 | Minor version component (optional, skips version setting if < 0) | +| Patch | number | false | -1 | Patch version component (optional, skips version setting if < 0) | +| ProjectPath | string | true | | Path to the LabVIEW project | +| SupportedBitness | string | true | | Bitness of the LabVIEW environment ("32" or "64") | +| TargetName | string | false | | Target that contains the build specification (optional, defaults to "My Computer") | +| gcliPath | string | false | | Optional path prepended to PATH for locating the g CLI | + +```powershell +pwsh ./actions/Invoke-OSAction.ps1 -ActionName Invoke-BuildLvlibpGithubHostedWindows -ArgsJson '{}' +``` + #### Invoke-BuildViPackage Builds a VI Package using the provided VIPB file and version metadata. MinimumSupportedLVVersion: Minimum LabVIEW version that the package supports. SupportedBitness: Target LabVIEW bitness (32- or 64-bit). LabVIEWMinorRevision: Minor revision of LabVIEW used to build the package. RelativePath: Normalized path to the project root relative to the working directory. VIPBPath: Path to the VIPB build specification file. Major: Major version component. Minor: Minor version component. Patch: Patch version component. Build: Build number component. Commit: Commit identifier used for the build metadata. DisplayInformationJSON: JSON string containing display information for the package. ReleaseNotesFile: Optional path to a release notes file. 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 | @@ -346,15 +413,6 @@ pwsh ./actions/Invoke-OSAction.ps1 -ActionName Set-LogLevel -ArgsJson '{}' ### Wrapper Actions -#### activate-labview -| Name | Type | Required | Default | Description | -| --- | --- | --- | --- | --- | -| serial_number | string | true | | LabVIEW serial number for activation. | -| package_id | string | false | LabVIEW_COM_PKG 25.0300 | LabVIEW package ID to activate. | -| 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. | - #### add-token-to-labview | Name | Type | Required | Default | Description | | --- | --- | --- | --- | --- | @@ -414,6 +472,61 @@ pwsh ./actions/Invoke-OSAction.ps1 -ActionName Set-LogLevel -ArgsJson '{}' | log_level | string | false | INFO | Verbosity level (ERROR|WARN|INFO|DEBUG). | | dry_run | string | false | false | If true, simulate the action without side effects. | +#### build-lvlibp-docker-linux +| Name | Type | Required | Default | Description | +| --- | --- | --- | --- | --- | +| minimum_supported_lv_version | string | true | | LabVIEW version year for the build (e.g., "2021", "2026"). | +| supported_bitness | string | true | | Bitness of the LabVIEW environment ("32" or "64"). | +| project_path | string | true | | Path to the LabVIEW project .lvproj file. | +| target_name | string | false | | Target that contains the build specification. Defaults to "My Computer" in helper VI. | +| build_spec_name | string | false | | Name of the build specification. If empty, builds all specifications in the target. | +| major | string | false | | Major version component for the PPL. Omit to skip version setting. | +| minor | string | false | | Minor version component for the PPL. Omit to skip version setting. | +| patch | string | false | | Patch version component for the PPL. Omit to skip version setting. | +| build | string | false | | Build number component for the PPL. Omit to skip version setting. | +| commit | string | false | | Commit hash or identifier recorded in the build. | +| docker_image | string | false | nationalinstruments/labview | Docker image name. | +| image_tag | string | false | 2026q1-linux | Docker image tag. | +| 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. | + +#### build-lvlibp-docker-windows +| Name | Type | Required | Default | Description | +| --- | --- | --- | --- | --- | +| minimum_supported_lv_version | string | true | | LabVIEW version year for the build (e.g., "2021", "2026"). | +| supported_bitness | string | true | | Bitness of the LabVIEW environment ("32" or "64"). | +| project_path | string | true | | Path to the LabVIEW project .lvproj file. | +| target_name | string | false | | Target that contains the build specification. Defaults to "My Computer" in helper VI. | +| build_spec_name | string | false | | Name of the build specification. If empty, builds all specifications in the target. | +| major | string | false | | Major version component for the PPL. Omit to skip version setting. | +| minor | string | false | | Minor version component for the PPL. Omit to skip version setting. | +| patch | string | false | | Patch version component for the PPL. Omit to skip version setting. | +| build | string | false | | Build number component for the PPL. Omit to skip version setting. | +| commit | string | false | | Commit hash or identifier recorded in the build. | +| docker_image | string | false | nationalinstruments/labview | Docker image name. | +| image_tag | string | false | 2026q1-windows | Docker image tag. | +| 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. | + +#### build-lvlibp-github-hosted-windows +| Name | Type | Required | Default | Description | +| --- | --- | --- | --- | --- | +| minimum_supported_lv_version | string | true | | LabVIEW version year for the build (e.g., "2021", "2026"). | +| supported_bitness | string | true | | Bitness of the LabVIEW environment ("32" or "64"). | +| project_path | string | true | | Path to the LabVIEW project .lvproj file. | +| target_name | string | false | | Target that contains the build specification. Defaults to "My Computer" in helper VI. | +| build_spec_name | string | false | | Name of the build specification. If empty, builds all specifications in the target. | +| major | string | false | | Major version component for the PPL. Omit to skip version setting. | +| minor | string | false | | Minor version component for the PPL. Omit to skip version setting. | +| patch | string | false | | Patch version component for the PPL. Omit to skip version setting. | +| build | string | false | | Build number component for the PPL. Omit to skip version setting. | +| commit | string | false | | Commit hash or identifier recorded in the build. | +| 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. | + #### build-vi-package | Name | Type | Required | Default | Description | | --- | --- | --- | --- | --- | diff --git a/build-lvlibp-docker-linux/action.yml b/build-lvlibp-docker-linux/action.yml new file mode 100644 index 00000000..355fa64e --- /dev/null +++ b/build-lvlibp-docker-linux/action.yml @@ -0,0 +1,90 @@ +name: 'Build LVLIBP Docker Linux' +description: 'Builds LabVIEW Packed Project Library (.lvlibp) using Linux Docker container' +inputs: + minimum_supported_lv_version: + description: 'LabVIEW version year for the build (e.g., "2021", "2026").' + required: true + supported_bitness: + description: 'Bitness of the LabVIEW environment ("32" or "64").' + required: true + project_path: + description: 'Path to the LabVIEW project .lvproj file.' + required: true + target_name: + description: 'Target that contains the build specification. Defaults to "My Computer" in helper VI.' + required: false + default: '' + build_spec_name: + description: 'Name of the build specification. If empty, builds all specifications in the target.' + required: false + default: '' + major: + description: 'Major version component for the PPL. Omit to skip version setting.' + required: false + minor: + description: 'Minor version component for the PPL. Omit to skip version setting.' + required: false + patch: + description: 'Patch version component for the PPL. Omit to skip version setting.' + required: false + build: + description: 'Build number component for the PPL. Omit to skip version setting.' + required: false + commit: + description: 'Commit hash or identifier recorded in the build.' + required: false + default: '' + docker_image: + description: 'Docker image name.' + required: false + default: 'nationalinstruments/labview' + image_tag: + description: 'Docker image tag.' + required: false + default: '2026q1-linux' + working_directory: + description: 'Working directory where the action will run.' + required: false + log_level: + description: 'Verbosity level (ERROR|WARN|INFO|DEBUG).' + default: 'INFO' + required: false + dry_run: + description: 'If true, simulate the action without side effects.' + default: 'false' + required: false + +runs: + using: 'composite' + steps: + - name: Dispatch build-lvlibp-docker-linux + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + $args = @{ + MinimumSupportedLVVersion = '${{ inputs.minimum_supported_lv_version }}' + SupportedBitness = '${{ inputs.supported_bitness }}' + ProjectPath = '${{ inputs.project_path }}' + TargetName = '${{ inputs.target_name }}' + BuildSpecName = '${{ inputs.build_spec_name }}' + Commit = '${{ inputs.commit }}' + DockerImage = '${{ inputs.docker_image }}' + ImageTag = '${{ inputs.image_tag }}' + } + + # Only add version parameters if they are provided + if ('${{ inputs.major }}') { $args['Major'] = [int]'${{ inputs.major }}' } + if ('${{ inputs.minor }}') { $args['Minor'] = [int]'${{ inputs.minor }}' } + if ('${{ inputs.patch }}') { $args['Patch'] = [int]'${{ inputs.patch }}' } + if ('${{ inputs.build }}') { $args['Build'] = [int]'${{ inputs.build }}' } + + $params = @{ + ActionName = 'build-lvlibp-docker-linux' + ArgsJson = ($args | ConvertTo-Json -Compress) + LogLevel = '${{ inputs.log_level }}' + } + if ('${{ inputs.dry_run }}' -eq 'true') { $params['DryRun'] = $true } + if ('${{ inputs.working_directory }}') { $params['WorkingDirectory'] = '${{ inputs.working_directory }}' } + + & '${{ github.action_path }}/../actions/Invoke-OSAction.ps1' @params + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } \ No newline at end of file diff --git a/build-lvlibp-docker-windows/action.yml b/build-lvlibp-docker-windows/action.yml new file mode 100644 index 00000000..c5bcd308 --- /dev/null +++ b/build-lvlibp-docker-windows/action.yml @@ -0,0 +1,90 @@ +name: 'Build LVLIBP Docker Windows' +description: 'Builds LabVIEW Packed Project Library (.lvlibp) using Windows Docker container' +inputs: + minimum_supported_lv_version: + description: 'LabVIEW version year for the build (e.g., "2021", "2026").' + required: true + supported_bitness: + description: 'Bitness of the LabVIEW environment ("32" or "64").' + required: true + project_path: + description: 'Path to the LabVIEW project .lvproj file.' + required: true + target_name: + description: 'Target that contains the build specification. Defaults to "My Computer" in helper VI.' + required: false + default: '' + build_spec_name: + description: 'Name of the build specification. If empty, builds all specifications in the target.' + required: false + default: '' + major: + description: 'Major version component for the PPL. Omit to skip version setting.' + required: false + minor: + description: 'Minor version component for the PPL. Omit to skip version setting.' + required: false + patch: + description: 'Patch version component for the PPL. Omit to skip version setting.' + required: false + build: + description: 'Build number component for the PPL. Omit to skip version setting.' + required: false + commit: + description: 'Commit hash or identifier recorded in the build.' + required: false + default: '' + docker_image: + description: 'Docker image name.' + required: false + default: 'nationalinstruments/labview' + image_tag: + description: 'Docker image tag.' + required: false + default: '2026q1-windows' + working_directory: + description: 'Working directory where the action will run.' + required: false + log_level: + description: 'Verbosity level (ERROR|WARN|INFO|DEBUG).' + default: 'INFO' + required: false + dry_run: + description: 'If true, simulate the action without side effects.' + default: false + required: false + +runs: + using: 'composite' + steps: + - name: Dispatch build-lvlibp-docker-windows + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + $args = @{ + MinimumSupportedLVVersion = '${{ inputs.minimum_supported_lv_version }}' + SupportedBitness = '${{ inputs.supported_bitness }}' + ProjectPath = '${{ inputs.project_path }}' + TargetName = '${{ inputs.target_name }}' + BuildSpecName = '${{ inputs.build_spec_name }}' + Commit = '${{ inputs.commit }}' + DockerImage = '${{ inputs.docker_image }}' + ImageTag = '${{ inputs.image_tag }}' + } + + # Only add version parameters if they are provided + if ('${{ inputs.major }}') { $args['Major'] = [int]'${{ inputs.major }}' } + if ('${{ inputs.minor }}') { $args['Minor'] = [int]'${{ inputs.minor }}' } + if ('${{ inputs.patch }}') { $args['Patch'] = [int]'${{ inputs.patch }}' } + if ('${{ inputs.build }}') { $args['Build'] = [int]'${{ inputs.build }}' } + + $params = @{ + ActionName = 'build-lvlibp-docker-windows' + ArgsJson = ($args | ConvertTo-Json -Compress) + LogLevel = '${{ inputs.log_level }}' + } + if ('${{ inputs.dry_run }}' -eq 'true') { $params['DryRun'] = $true } + if ('${{ inputs.working_directory }}') { $params['WorkingDirectory'] = '${{ inputs.working_directory }}' } + + & '${{ github.action_path }}/../actions/Invoke-OSAction.ps1' @params + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } \ No newline at end of file diff --git a/build-lvlibp-github-hosted-windows/action.yml b/build-lvlibp-github-hosted-windows/action.yml new file mode 100644 index 00000000..95db66e3 --- /dev/null +++ b/build-lvlibp-github-hosted-windows/action.yml @@ -0,0 +1,80 @@ +name: 'Build LVLIBP GitHub Hosted Windows' +description: 'Builds LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner' +inputs: + minimum_supported_lv_version: + description: 'LabVIEW version year for the build (e.g., "2021", "2026").' + required: true + supported_bitness: + description: 'Bitness of the LabVIEW environment ("32" or "64").' + required: true + project_path: + description: 'Path to the LabVIEW project .lvproj file.' + required: true + target_name: + description: 'Target that contains the build specification. Defaults to "My Computer" in helper VI.' + required: false + default: '' + build_spec_name: + description: 'Name of the build specification. If empty, builds all specifications in the target.' + required: false + default: '' + major: + description: 'Major version component for the PPL. Omit to skip version setting.' + required: false + minor: + description: 'Minor version component for the PPL. Omit to skip version setting.' + required: false + patch: + description: 'Patch version component for the PPL. Omit to skip version setting.' + required: false + build: + description: 'Build number component for the PPL. Omit to skip version setting.' + required: false + commit: + description: 'Commit hash or identifier recorded in the build.' + required: false + default: '' + working_directory: + description: 'Working directory where the action will run.' + required: false + log_level: + description: 'Verbosity level (ERROR|WARN|INFO|DEBUG).' + default: 'INFO' + required: false + dry_run: + description: 'If true, simulate the action without side effects.' + default: 'false' + required: false + +runs: + using: 'composite' + steps: + - name: Dispatch build-lvlibp-github-hosted-windows + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + $args = @{ + MinimumSupportedLVVersion = '${{ inputs.minimum_supported_lv_version }}' + SupportedBitness = '${{ inputs.supported_bitness }}' + ProjectPath = '${{ inputs.project_path }}' + TargetName = '${{ inputs.target_name }}' + BuildSpecName = '${{ inputs.build_spec_name }}' + Commit = '${{ inputs.commit }}' + } + + # Only add version parameters if they are provided + if ('${{ inputs.major }}') { $args['Major'] = [int]'${{ inputs.major }}' } + if ('${{ inputs.minor }}') { $args['Minor'] = [int]'${{ inputs.minor }}' } + if ('${{ inputs.patch }}') { $args['Patch'] = [int]'${{ inputs.patch }}' } + if ('${{ inputs.build }}') { $args['Build'] = [int]'${{ inputs.build }}' } + + $params = @{ + ActionName = 'build-lvlibp-github-hosted-windows' + ArgsJson = ($args | ConvertTo-Json -Compress) + LogLevel = '${{ inputs.log_level }}' + } + if ('${{ inputs.dry_run }}' -eq 'true') { $params['DryRun'] = $true } + if ('${{ inputs.working_directory }}') { $params['WorkingDirectory'] = '${{ inputs.working_directory }}' } + + & '${{ github.action_path }}/../actions/Invoke-OSAction.ps1' @params + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } \ No newline at end of file diff --git a/ci_evidence.txt b/ci_evidence.txt index 89156c1b..c2a1b504 100644 --- a/ci_evidence.txt +++ b/ci_evidence.txt @@ -1 +1 @@ -{"pipeline":"Unknown","git_sha":"644b1a1ca5e8d9223a50ef4fc6ff3902f51274cf","req_status":{"REQ-023":"PASS","REQ-024":"PASS","REQ-025":"PASS","REQ-026":"PASS","REQ-027":"PASS","REQ-028":"PASS","REQ-029":"PASS","REQ-030":"PASS","REQ-031":"PASS","REQ-032":"PASS","REQ-033":"PASS"}} \ No newline at end of file +{"pipeline":"Unknown","git_sha":"ca2e2799dc4ab919b029800520cee7124d7a3d7a","req_status":{"REQ-023":"PASS","REQ-024":"PASS","REQ-025":"PASS","REQ-026":"PASS","REQ-027":"PASS","REQ-028":"PASS","REQ-029":"PASS","REQ-030":"PASS","REQ-031":"PASS","REQ-032":"PASS","REQ-033":"PASS"}} \ No newline at end of file diff --git a/dispatchers.json b/dispatchers.json index ffe8f834..e833f877 100644 --- a/dispatchers.json +++ b/dispatchers.json @@ -194,6 +194,246 @@ } } }, + "Invoke-BuildLvlibpDockerLinux": { + "description": "Builds LabVIEW Packed Project Library (.lvlibp) using Linux Docker container. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., \"2021\", \"2026\"). SupportedBitness: Bitness of the LabVIEW environment (\"32\" or \"64\"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to \"My Computer\"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (defaults to \"2026q1-linux\"). DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", + "parameters": { + "Build": { + "type": "number", + "required": false, + "default": "-1", + "description": "Build number component (optional, skips version setting if < 0)" + }, + "BuildSpecName": { + "type": "string", + "required": false, + "default": "", + "description": "Name of the LabVIEW build specification (optional, builds all if empty)" + }, + "Commit": { + "type": "string", + "required": false, + "default": "", + "description": "Commit hash or identifier (optional)" + }, + "DockerImage": { + "type": "string", + "required": false, + "default": "nationalinstruments/labview", + "description": "Docker image name (default: \"nationalinstruments/labview\")" + }, + "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" + }, + "ImageTag": { + "type": "string", + "required": false, + "default": "2026q1-linux", + "description": "Docker image tag (defaults to \"2026q1-linux\")" + }, + "Major": { + "type": "number", + "required": false, + "default": "-1", + "description": "Major version component (optional, skips version setting if < 0)" + }, + "MinimumSupportedLVVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version for the build (e" + }, + "Minor": { + "type": "number", + "required": false, + "default": "-1", + "description": "Minor version component (optional, skips version setting if < 0)" + }, + "Patch": { + "type": "number", + "required": false, + "default": "-1", + "description": "Patch version component (optional, skips version setting if < 0)" + }, + "ProjectPath": { + "type": "string", + "required": true, + "description": "Path to the LabVIEW project" + }, + "SupportedBitness": { + "type": "string", + "required": true, + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\")" + }, + "TargetName": { + "type": "string", + "required": false, + "default": "", + "description": "Target that contains the build specification (optional, defaults to \"My Computer\")" + } + } + }, + "Invoke-BuildLvlibpDockerWindows": { + "description": "Builds LabVIEW Packed Project Library (.lvlibp) using Windows Docker container. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., \"2021\", \"2026\"). SupportedBitness: Bitness of the LabVIEW environment (\"32\" or \"64\"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to \"My Computer\"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (defaults to \"2026q1-windows\"). DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", + "parameters": { + "Build": { + "type": "number", + "required": false, + "default": "-1", + "description": "Build number component (optional, skips version setting if < 0)" + }, + "BuildSpecName": { + "type": "string", + "required": false, + "default": "", + "description": "Name of the LabVIEW build specification (optional, builds all if empty)" + }, + "Commit": { + "type": "string", + "required": false, + "default": "", + "description": "Commit hash or identifier (optional)" + }, + "DockerImage": { + "type": "string", + "required": false, + "default": "nationalinstruments/labview", + "description": "Docker image name (default: \"nationalinstruments/labview\")" + }, + "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" + }, + "ImageTag": { + "type": "string", + "required": false, + "default": "2026q1-windows", + "description": "Docker image tag (defaults to \"2026q1-windows\")" + }, + "Major": { + "type": "number", + "required": false, + "default": "-1", + "description": "Major version component (optional, skips version setting if < 0)" + }, + "MinimumSupportedLVVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version for the build (e" + }, + "Minor": { + "type": "number", + "required": false, + "default": "-1", + "description": "Minor version component (optional, skips version setting if < 0)" + }, + "Patch": { + "type": "number", + "required": false, + "default": "-1", + "description": "Patch version component (optional, skips version setting if < 0)" + }, + "ProjectPath": { + "type": "string", + "required": true, + "description": "Path to the LabVIEW project" + }, + "SupportedBitness": { + "type": "string", + "required": true, + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\")" + }, + "TargetName": { + "type": "string", + "required": false, + "default": "", + "description": "Target that contains the build specification (optional, defaults to \"My Computer\")" + } + } + }, + "Invoke-BuildLvlibpGithubHostedWindows": { + "description": "Builds LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner. MinimumSupportedLVVersion: LabVIEW version for the build (e.g., \"2021\", \"2026\"). SupportedBitness: Bitness of the LabVIEW environment (\"32\" or \"64\"). ProjectPath: Path to the LabVIEW project .lvproj file. TargetName: Target that contains the build specification (optional, defaults to \"My Computer\"). BuildSpecName: Name of the LabVIEW build specification (optional, builds all if empty). Major: Major version component (optional, skips version setting if < 0). Minor: Minor version component (optional, skips version setting if < 0). Patch: Patch version component (optional, skips version setting if < 0). Build: Build number component (optional, skips version setting if < 0). Commit: Commit hash or identifier (optional). DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", + "parameters": { + "Build": { + "type": "number", + "required": false, + "default": "-1", + "description": "Build number component (optional, skips version setting if < 0)" + }, + "BuildSpecName": { + "type": "string", + "required": false, + "default": "", + "description": "Name of the LabVIEW build specification (optional, builds all if empty)" + }, + "Commit": { + "type": "string", + "required": false, + "default": "", + "description": "Commit hash or identifier (optional)" + }, + "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" + }, + "Major": { + "type": "number", + "required": false, + "default": "-1", + "description": "Major version component (optional, skips version setting if < 0)" + }, + "MinimumSupportedLVVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version for the build (e" + }, + "Minor": { + "type": "number", + "required": false, + "default": "-1", + "description": "Minor version component (optional, skips version setting if < 0)" + }, + "Patch": { + "type": "number", + "required": false, + "default": "-1", + "description": "Patch version component (optional, skips version setting if < 0)" + }, + "ProjectPath": { + "type": "string", + "required": true, + "description": "Path to the LabVIEW project" + }, + "SupportedBitness": { + "type": "string", + "required": true, + "description": "Bitness of the LabVIEW environment (\"32\" or \"64\")" + }, + "TargetName": { + "type": "string", + "required": false, + "default": "", + "description": "Target that contains the build specification (optional, defaults to \"My Computer\")" + } + } + }, "Invoke-BuildViPackage": { "description": "Builds a VI Package using the provided VIPB file and version metadata. MinimumSupportedLVVersion: Minimum LabVIEW version that the package supports. SupportedBitness: Target LabVIEW bitness (32- or 64-bit). LabVIEWMinorRevision: Minor revision of LabVIEW used to build the package. RelativePath: Normalized path to the project root relative to the working directory. VIPBPath: Path to the VIPB build specification file. Major: Major version component. Minor: Minor version component. Patch: Patch version component. Build: Build number component. Commit: Commit identifier used for the build metadata. DisplayInformationJSON: JSON string containing display information for the package. ReleaseNotesFile: Optional path to a release notes file. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", "parameters": { diff --git a/docs/actions/build-lvlibp-docker-linux.md b/docs/actions/build-lvlibp-docker-linux.md new file mode 100644 index 00000000..18ba0dea --- /dev/null +++ b/docs/actions/build-lvlibp-docker-linux.md @@ -0,0 +1,161 @@ +# build-lvlibp-docker-linux + +## Purpose + +Builds LabVIEW Packed Project Library (.lvlibp) files using a Linux LabVIEW Docker container. This action executes the LabVIEW build specification through LabVIEWCLI inside a containerized Linux environment, optionally embedding version information and commit metadata. + +Use this action when you need to build PPL files in a Linux Docker container, ensuring a consistent and isolated build environment. + +## Parameters + +Common parameters are described in [Common parameters](../common-parameters.md). + +### Required + +- **MinimumSupportedLVVersion** (`string`): LabVIEW version year for the build (e.g., `"2021"`, `"2023"`, `"2026"`). +- **SupportedBitness** (`string`): Bitness of the LabVIEW environment (`"32"` or `"64"`). +- **ProjectPath** (`string`): Path to the LabVIEW project `.lvproj` file that contains the build specification. + +### Optional + +- **TargetName** (`string`): Target that contains the build specification. Defaults to `"My Computer"` in helper VI if not provided. +- **BuildSpecName** (`string`): Name of the build specification to execute. If empty, builds all build specifications in the project. +- **Major** (`int`): Major version component for the PPL. If not provided (or < 0), version setting is skipped. +- **Minor** (`int`): Minor version component for the PPL. If not provided (or < 0), version setting is skipped. +- **Patch** (`int`): Patch version component for the PPL. If not provided (or < 0), version setting is skipped. +- **Build** (`int`): Build number component for the PPL. If not provided (or < 0), version setting is skipped. +- **Commit** (`string`): Commit hash or identifier recorded in the build (for documentation purposes). +- **DockerImage** (`string`): Docker image name. Default: `"nationalinstruments/labview"`. +- **ImageTag** (`string`): Docker image tag. Default: `"2026q1-linux"`. + +### GitHub Action inputs + +| Input | CLI parameter | Description | +| --- | --- | --- | +| `minimum_supported_lv_version` | `MinimumSupportedLVVersion` | LabVIEW version year for the build. | +| `supported_bitness` | `SupportedBitness` | Bitness (`"32"` or `"64"`). | +| `project_path` | `ProjectPath` | Path to the LabVIEW project `.lvproj` file. | +| `target_name` | `TargetName` | Target that contains the build specification (optional). | +| `build_spec_name` | `BuildSpecName` | Name of the build specification (optional). | +| `major` | `Major` | Major version component (optional). | +| `minor` | `Minor` | Minor version component (optional). | +| `patch` | `Patch` | Patch version component (optional). | +| `build` | `Build` | Build number component (optional). | +| `commit` | `Commit` | Commit hash or identifier (optional). | +| `docker_image` | `DockerImage` | Docker image name (optional). | +| `image_tag` | `ImageTag` | Docker image tag (optional). | +| `working_directory` | `WorkingDirectory` | Base directory for the action. | +| `log_level` | `LogLevel` | Verbosity level (ERROR\|WARN\|INFO\|DEBUG). | +| `dry_run` | `DryRun` | If true, simulate without side effects. | + +## Examples + +### CLI + +```powershell +pwsh -File actions/Invoke-OSAction.ps1 -ActionName build-lvlibp-docker-linux -ArgsJson '{ + "MinimumSupportedLVVersion": "2026", + "SupportedBitness": "64", + "ProjectPath": "lv_icon_editor.lvproj", + "TargetName": "My Computer", + "BuildSpecName": "Editor Packed Library", + "Major": 1, + "Minor": 0, + "Patch": 0, + "Build": 0, + "Commit": "abc1234", + "DockerImage": "nationalinstruments/labview", + "ImageTag": "2026q1-linux" +}' +``` + +### GitHub Action + +```yaml +- name: Build PPL with Linux Docker + uses: ni/open-source/build-lvlibp-docker-linux@v1 + with: + minimum_supported_lv_version: '2026' + supported_bitness: '64' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + build_spec_name: 'Editor Packed Library' + major: 1 + minor: 0 + patch: 0 + build: 0 + commit: ${{ github.sha }} + docker_image: 'nationalinstruments/labview' + image_tag: '2026q1-linux' +``` + +### Build All Specifications + +```yaml +- name: Build All PPLs + uses: ni/open-source/build-lvlibp-docker-linux@v1 + with: + minimum_supported_lv_version: '2026' + supported_bitness: '64' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + major: 1 + minor: 0 + patch: 0 + build: 0 + commit: ${{ github.sha }} +``` + +## Behavior + +1. **Version Setting**: + + - If all version components (`Major`, `Minor`, `Patch`, `Build`) are provided (≥ 0), the helper VI is called to set the version + - If any version component is missing or < 0, version setting is skipped and build specs use their own versions + - When version is provided: + - If `BuildSpecName` is specified: version is set on that build spec only + - If `BuildSpecName` is omitted: version is set on **all** build specs in the project + +2. **Docker Image Pull**: + + - Pulls the specified Docker image (or default `nationalinstruments/labview:2026q1-linux`) + - Verifies the pull was successful + +3. **LabVIEW Path Construction**: + + - Container path: `/usr/local/natinst/LabVIEW-{version}-{bitness}/labview` + - Example: `/usr/local/natinst/LabVIEW-2026-64/labview` + +4. **Build Execution**: + + - Mounts current directory to `/workspace` in container + - Mounts build script to `/tmp/build-lvlibp.sh` in container + - Calls helper VI to set version (if version parameters provided) + - Executes `LabVIEWCLI -OperationName ExecuteBuildSpec` inside container + +5. **Log Collection**: + + - Copies LabVIEW logs from `/tmp` to `/workspace/build-logs` for artifact collection + +6. **Error Handling**: + + - On failure, exits with the build error code + +## Return Codes + +- `0` – success +- non-zero – build failed or Docker operation failed + +## Requirements + +- Docker must be installed and running on the host system +- The specified Linux Docker image must be available (pulled or cached) +- The LabVIEW project file must exist at the specified path +- LabVIEWCLI must be available in the Docker container +- The target and build specification must exist in the project + +## See also + +- [build-lvlibp](build-lvlibp.md) – Non-Docker PPL build action +- [build](build.md) – General LabVIEW build action +- [Architecture documentation](../architecture.md) diff --git a/docs/actions/build-lvlibp-docker-windows.md b/docs/actions/build-lvlibp-docker-windows.md new file mode 100644 index 00000000..b273147e --- /dev/null +++ b/docs/actions/build-lvlibp-docker-windows.md @@ -0,0 +1,190 @@ +# build-lvlibp-docker-windows + +## Purpose + +Builds LabVIEW Packed Project Library (.lvlibp) files using a Windows LabVIEW Docker container. This action executes the LabVIEW build specification through LabVIEWCLI inside a Docker container, optionally embedding version information and commit metadata. + +Use this action when you need to build PPL files in containerized Windows environments (CI/CD pipelines) without installing LabVIEW directly on the host system. + +## Parameters + +Common parameters are described in [Common parameters](../common-parameters.md). + +### Required + +- **MinimumSupportedLVVersion** (`string`): LabVIEW version year for the build (e.g., `"2021"`, `"2023"`, `"2026"`). +- **SupportedBitness** (`string`): Bitness of the LabVIEW environment (`"32"` or `"64"`). +- **ProjectPath** (`string`): Path to the LabVIEW project `.lvproj` file that contains the build specification. + +### Optional + +- **TargetName** (`string`): Target that contains the build specification. Defaults to `"My Computer"` in helper VI. Default: `""`. +- **BuildSpecName** (`string`): Name of the build specification to execute. If empty, builds all build specifications under the specified target. Default: `""`. +- **Major** (`int`): Major version component for the PPL. Omit to skip version setting. Default: `-1`. +- **Minor** (`int`): Minor version component for the PPL. Omit to skip version setting. Default: `-1`. +- **Patch** (`int`): Patch version component for the PPL. Omit to skip version setting. Default: `-1`. +- **Build** (`int`): Build number component for the PPL. Omit to skip version setting. Default: `-1`. +- **Commit** (`string`): Commit hash or identifier recorded in the build. Default: `""`. +- **DockerImage** (`string`): Docker image name. Default: `"nationalinstruments/labview"`. +- **ImageTag** (`string`): Docker image tag. Default: `"2026q1-windows"`. + +### GitHub Action inputs + +| Input | CLI parameter | Description | +| --- | --- | --- | +| `minimum_supported_lv_version` | `MinimumSupportedLVVersion` | LabVIEW version year for the build. | +| `supported_bitness` | `SupportedBitness` | Bitness (`"32"` or `"64"`). | +| `project_path` | `ProjectPath` | Path to the LabVIEW project `.lvproj` file. | +| `target_name` | `TargetName` | Target that contains the build specification (optional). | +| `build_spec_name` | `BuildSpecName` | Name of the build specification (optional). | +| `major` | `Major` | Major version component (optional). | +| `minor` | `Minor` | Minor version component (optional). | +| `patch` | `Patch` | Patch version component (optional). | +| `build` | `Build` | Build number component (optional). | +| `commit` | `Commit` | Commit hash or identifier (optional). | +| `docker_image` | `DockerImage` | Docker image name. | +| `image_tag` | `ImageTag` | Docker image tag. | +| `working_directory` | `WorkingDirectory` | Base directory for the action. | +| `log_level` | `LogLevel` | Verbosity level (ERROR\|WARN\|INFO\|DEBUG). | +| `dry_run` | `DryRun` | If true, simulate without side effects. | + +## Examples + +### Minimal CLI Example + +Build with only required parameters (uses version from build specification): + +```powershell +pwsh -File actions/Invoke-OSAction.ps1 -ActionName build-lvlibp-docker-windows -ArgsJson '{ + "MinimumSupportedLVVersion": "2026", + "SupportedBitness": "64", + "ProjectPath": "lv_icon_editor.lvproj" +}' +``` + +### CLI with Custom Version + +```powershell +pwsh -File actions/Invoke-OSAction.ps1 -ActionName build-lvlibp-docker-windows -ArgsJson '{ + "MinimumSupportedLVVersion": "2026", + "SupportedBitness": "64", + "ProjectPath": "lv_icon_editor.lvproj", + "TargetName": "My Computer", + "BuildSpecName": "Editor Packed Library", + "Major": 1, + "Minor": 0, + "Patch": 0, + "Build": 0, + "Commit": "abc1234", + "DockerImage": "nationalinstruments/labview", + "ImageTag": "2026-windows" +}' +``` + +### Minimal GitHub Action + +Build with only required parameters: + +```yaml +- name: Build PPL with Windows Docker + uses: owner/repo/build-lvlibp-docker-windows@v1 + with: + minimum_supported_lv_version: '2026' + supported_bitness: '64' + project_path: 'lv_icon_editor.lvproj' +``` + +### GitHub Action with Custom Version + +```yaml +- name: Build PPL with Windows Docker + uses: owner/repo/build-lvlibp-docker-windows@v1 + with: + minimum_supported_lv_version: '2026' + supported_bitness: '64' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + build_spec_name: 'Editor Packed Library' + major: 1 + minor: 0 + patch: 0 + build: 0 + commit: ${{ github.sha }} + docker_image: 'nationalinstruments/labview' + image_tag: '2026-windows' +``` + +### Build All Specifications + +```yaml +- name: Build All PPLs + uses: owner/repo/build-lvlibp-docker-windows@v1 + with: + minimum_supported_lv_version: '2026' + supported_bitness: '64' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + build_spec_name: '' # Empty - builds all specifications + major: 1 + minor: 0 + patch: 0 + build: 0 + commit: ${{ github.sha }} +``` + +## Behavior + +1. Pulls the specified Windows Docker image (e.g., `nationalinstruments/labview:2026-windows`) +2. Mounts the workspace directory into the container at `C:\workspace` +3. Mounts the action repository root (containing helper VIs) into the container at `C:\action` +4. Mounts the PowerShell build script into the container at `C:\scripts\build-lvlibp.ps1` +5. Constructs the LabVIEWPath based on version and bitness +6. If version parameters are provided (all four must be specified): + - Executes helper VI to set build specification version + - Helper VI uses positional arguments: ProjectPath, BuildSpecName, TargetName, Version +7. Executes `LabVIEWCLI -OperationName ExecuteBuildSpec` with the specified parameters +8. Copies LabVIEW logs from `%TEMP%` to `C:\workspace\build-logs` for artifact collection +9. On failure, exits with the build error code + +## Return Codes + +- `0` – success +- non-zero – build failed, version setting failed, or Docker operation failed + +## Requirements + +- Docker must be installed and running on the host system +- The specified Windows Docker image must be available (pulled or cached) +- The host system must support Windows containers (Windows Server or Windows 10/11 with container support) +- The LabVIEW project file must exist at the specified path +- LabVIEWCLI must be available in the Docker container +- The target and build specification must exist in the project +- If setting version: all four version parameters (Major, Minor, Patch, Build) must be provided or all must be omitted + +## Platform Support + +This action is designed for Windows Docker containers. Key differences from the Linux variant: + +- Uses Windows-style paths (`C:\` drive letters) +- Requires Windows Server or Windows 10/11 with container support +- LabVIEW installation paths differ between 32-bit and 64-bit +- Logs are found in `%TEMP%` instead of `/tmp/` +- Uses PowerShell as the container shell instead of bash + +For Linux containers, see [build-lvlibp-docker-linux](build-lvlibp-docker-linux.md). + +## Version Setting + +The action can optionally set the build version before building: + +- **With version**: Provide all four version parameters (`major`, `minor`, `patch`, `build`) to set a custom version +- **Without version**: Omit all version parameters to use the version configured in the build specification + +You cannot partially specify version components - either provide all four or none. + +## See also + +- [build-lvlibp-docker-linux](build-lvlibp-docker-linux.md) – Linux Docker PPL build action +- [build-lvlibp-github-hosted-windows](build-lvlibp-github-hosted-windows.md) – Windows native PPL build action +- [build](build.md) – General LabVIEW build action +- [Architecture documentation](../architecture.md) diff --git a/docs/actions/build-lvlibp-github-hosted-windows.md b/docs/actions/build-lvlibp-github-hosted-windows.md new file mode 100644 index 00000000..31794064 --- /dev/null +++ b/docs/actions/build-lvlibp-github-hosted-windows.md @@ -0,0 +1,243 @@ +# build-lvlibp-github-hosted-windows + +## Purpose + +Builds LabVIEW Packed Project Library (.lvlibp) files using LabVIEW installed on a Windows GitHub-hosted runner. This action executes the LabVIEW build specification through LabVIEWCLI (32-bit), optionally embedding version information and commit metadata. + +Use this action when you need to build PPL files on GitHub-hosted Windows runners with locally installed LabVIEW (no Docker required). + +## Parameters + +Common parameters are described in [Common parameters](../common-parameters.md). + +### Required + +- **MinimumSupportedLVVersion** (`string`): LabVIEW version year for the build (e.g., `"2021"`, `"2023"`, `"2025"`). +- **SupportedBitness** (`string`): Bitness of the LabVIEW environment (`"32"` or `"64"`). +- **ProjectPath** (`string`): Path to the LabVIEW project `.lvproj` file that contains the build specification. + +### Optional + +- **TargetName** (`string`): Target that contains the build specification. Defaults to `"My Computer"` in helper VI if not provided. +- **BuildSpecName** (`string`): Name of the build specification to execute. If empty, builds all build specifications under the specified target. +- **Major** (`int`): Major version component for the PPL. If not provided (or < 0), version setting is skipped. +- **Minor** (`int`): Minor version component for the PPL. If not provided (or < 0), version setting is skipped. +- **Patch** (`int`): Patch version component for the PPL. If not provided (or < 0), version setting is skipped. +- **Build** (`int`): Build number component for the PPL. If not provided (or < 0), version setting is skipped. +- **Commit** (`string`): Commit hash or identifier recorded in the build. + +### GitHub Action inputs + +| Input | CLI parameter | Description | +| --- | --- | --- | +| `minimum_supported_lv_version` | `MinimumSupportedLVVersion` | LabVIEW version year for the build. | +| `supported_bitness` | `SupportedBitness` | Bitness (`"32"` or `"64"`). | +| `project_path` | `ProjectPath` | Path to the LabVIEW project `.lvproj` file. | +| `target_name` | `TargetName` | Target that contains the build specification ("My Computer" is used if empty). | +| `build_spec_name` | `BuildSpecName` | Name of the build specification (Uses all build specs if empty). | +| `major` | `Major` | Major version component (optional). | +| `minor` | `Minor` | Minor version component (optional). | +| `patch` | `Patch` | Patch version component (optional). | +| `build` | `Build` | Build number component (optional). | +| `commit` | `Commit` | Commit hash or identifier (optional). | +| `working_directory` | `WorkingDirectory` | Base directory for the action. | +| `log_level` | `LogLevel` | Verbosity level (ERROR\|WARN\|INFO\|DEBUG). | +| `dry_run` | `DryRun` | If true, simulate without side effects. | + +## Examples + +### CLI + +```powershell +pwsh -File actions/Invoke-OSAction.ps1 -ActionName build-lvlibp-github-hosted-windows -ArgsJson '{ + "MinimumSupportedLVVersion": "2025", + "SupportedBitness": "32", + "ProjectPath": "lv_icon_editor.lvproj", + "TargetName": "My Computer", + "BuildSpecName": "Editor Packed Library", + "Major": 1, + "Minor": 0, + "Patch": 0, + "Build": 0, + "Commit": "abc1234" +}' +``` + +### GitHub Action + +```yaml +- name: Build PPL with GitHub-hosted Runner + uses: ni/open-source/build-lvlibp-github-hosted-windows@v1 + with: + minimum_supported_lv_version: '2025' + supported_bitness: '32' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + build_spec_name: 'Editor Packed Library' + major: 1 + minor: 0 + patch: 0 + build: 0 + commit: ${{ github.sha }} +``` + +### CLI without Version (Skip setting version) + +```powershell +pwsh -File actions/Invoke-OSAction.ps1 -ActionName build-lvlibp-github-hosted-windows -ArgsJson '{ + "MinimumSupportedLVVersion": "2025", + "SupportedBitness": "32", + "ProjectPath": "lv_icon_editor.lvproj", + "BuildSpecName": "Editor Packed Library" +}' +``` + +### Complete Workflow with LabVIEW Setup + +```yaml +name: Build LVLIBP + +on: + push: + branches: [main] + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup NI Package Manager + uses: ni/open-source/setup-nipm@v1 + with: + log_level: 'INFO' + + - name: Setup LabVIEW + uses: ni/open-source/setup-labview@v1 + with: + labview_iso_url: 'https://download.ni.com/.../ni-labview-2025-community-x86_25.3.3_offline.iso' + timeout_seconds: 1800 + serial_number: ${{ secrets.LABVIEW_SERIAL_NUMBER }} + package_id: 'LabVIEW_COM_PKG 25.0300' + + - name: Extract version + id: version + shell: pwsh + run: | + $pkg = Get-Content package.json | ConvertFrom-Json + $parts = $pkg.version -split '\.' + "major=$($parts[0])" >> $env:GITHUB_OUTPUT + "minor=$($parts[1])" >> $env:GITHUB_OUTPUT + "patch=$($parts[2])" >> $env:GITHUB_OUTPUT + + - name: Build PPL + uses: ni/open-source/build-lvlibp-github-hosted-windows@v1 + with: + minimum_supported_lv_version: '2025' + supported_bitness: '32' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + build_spec_name: 'Editor Packed Library' + major: ${{ steps.version.outputs.major }} + minor: ${{ steps.version.outputs.minor }} + patch: ${{ steps.version.outputs.patch }} + build: ${{ github.run_number }} + commit: ${{ github.sha }} + + - name: Upload Built PPL + uses: actions/upload-artifact@v4 + if: success() + with: + name: lv_icon_x86_v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}.${{ github.run_number }}+g${{ github.sha }} + path: builds/*.lvlibp + retention-days: 7 + + - name: Upload Build Logs + uses: actions/upload-artifact@v4 + if: always() + with: + name: build-logs + path: build-logs/*.log + retention-days: 3 + if-no-files-found: ignore +``` + +### Build All Specifications + +Omit `build_spec_name` to build all build specifications. The provided version is applied to all specs: + +```yaml +- name: Build All PPLs + uses: ni/open-source/build-lvlibp-github-hosted-windows@v1 + with: + minimum_supported_lv_version: '2025' + supported_bitness: '32' + project_path: 'lv_icon_editor.lvproj' + target_name: 'My Computer' + major: 1 + minor: 0 + patch: 0 + build: 0 + commit: ${{ github.sha }} +``` + +## Behavior + +1. **Version Setting**: + + - If all version components (`Major`, `Minor`, `Patch`, `Build`) are provided (≥ 0), the helper VI is called to set the version + - If any version component is missing or < 0, version setting is skipped + - When version is provided: + - If `BuildSpecName` is specified: version is set on that build spec only + - If `BuildSpecName` is omitted: version is set on **all** build specs in the project + +2. **LabVIEW Path Construction**: + + - 32-bit: `C:\Program Files (x86)\National Instruments\LabVIEW {lv_version}\LabVIEW.exe` + +3. **Build Execution**: + + - Verifies LabVIEW exists at the expected path + - Verifies project file exists + - Calls helper VI to set version (if version parameters provided) + - Executes `LabVIEWCLI -OperationName ExecuteBuildSpec` with specified parameters + +4. **Log Collection**: + + - Copies LabVIEW logs from `%TEMP%` to `build-logs\` directory for artifact collection + +5. **Error Handling**: + + - On failure, exits with the build error code + +## Return Codes + +- `0` – success +- non-zero – build failed or LabVIEW not found + +## Requirements + +- LabVIEW must be installed at the expected path (use `setup-labview` action) +- LabVIEWCLI must be available in the PATH +- The LabVIEW project file must exist at the specified path +- The target and build specification must exist in the project +- Windows runner (Windows Server 2019, 2022, or Windows 10/11) +- Helper VI (`SetBuildVersionCaller.vi`) must be present in `scripts/build-lvlibp-helpers/` + +## Platform Support + +This action is designed for Windows GitHub-hosted runners with locally installed LabVIEW. + +For containerized builds, see: + +- [build-lvlibp-docker-windows](build-lvlibp-docker-windows.md) – Windows Docker PPL build action +- [build-lvlibp-docker-linux](build-lvlibp-docker-linux.md) – Linux Docker PPL build action + +## See also + +- [build-lvlibp-docker-windows](build-lvlibp-docker-windows.md) – Windows Docker PPL build action +- [build-lvlibp-docker-linux](build-lvlibp-docker-linux.md) – Linux Docker PPL build action +- [setup-labview](setup-labview.md) – LabVIEW installation action +- [setup-nipm](setup-nipm.md) – NI Package Manager setup action +- [Architecture documentation](../architecture.md) diff --git a/docs/actions/index.md b/docs/actions/index.md index 7e2f68b1..7e1f0d9d 100644 --- a/docs/actions/index.md +++ b/docs/actions/index.md @@ -5,6 +5,9 @@ List of available GitHub Actions. - [add-token-to-labview](./add-token-to-labview.md): Add a custom library path token to the LabVIEW INI file so LabVIEW can locate project libraries. - [apply-vipc](./apply-vipc.md): Apply a VI Package Configuration (.vipc) file to a specific LabVIEW installation using g-cli. - [build-lvlibp](./build-lvlibp.md): Build a LabVIEW project’s build specification into a Packed Project Library (.lvlibp) +- [build-lvlibp-docker-linux](./build-lvlibp-docker-linux.md) – Build LVLIBP using Linux Docker container +- [build-lvlibp-docker-windows](./build-lvlibp-docker-windows.md) – Build LVLIBP using Windows Docker container +- [build-lvlibp-github-hosted-windows](./build-lvlibp-github-hosted-windows.md) – Build LVLIBP using Windows GitHub-hosted runner - [build-vi-package](./build-vi-package.md): Update VIPB display information and build a VI package using g-cli. - [build](./build.md): Automate building the LabVIEW Icon Editor project, including cleaning, building libraries, and packaging. - [close-labview](./close-labview.md): Gracefully close a running LabVIEW instance via g-cli. diff --git a/docs/index.md b/docs/index.md index 469dd2bb..44c5aaba 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,6 +24,9 @@ Open Source LabVIEW Actions unifies LabVIEW [CI/CD](glossary.md#ci-cd) scripts b | [apply-vipc](actions/apply-vipc.md) | Apply a VI Package Configuration (.vipc) file to a specific LabVIEW installation using g-cli. | | [build](actions/build.md) | Automate building the LabVIEW Icon Editor project, including cleaning, building libraries, and packaging. | | [build-lvlibp](actions/build-lvlibp.md) | Build a LabVIEW project’s build specification into a Packed Project Library (.lvlibp). | +| [build-lvlibp-docker-linux](actions/build-lvlibp-docker-linux.md) | Build LVLIBP with Linux Docker. | +| [build-lvlibp-docker-windows](actions/build-lvlibp-docker-windows.md) | Build LVLIBP with Windows Docker. | +| [build-lvlibp-github-hosted-windows](actions/build-lvlibp-github-hosted-windows.md) | Build LVLIBP with Windows runner. | | [build-vi-package](actions/build-vi-package.md) | Update VIPB display information and build a VI package using g-cli. | | [close-labview](actions/close-labview.md) | Gracefully close a running LabVIEW instance via g-cli. | | [generate-release-notes](actions/generate-release-notes.md) | Generate release notes from the git history and write them to a markdown file. | diff --git a/docs/requirements.md b/docs/requirements.md index db560cd8..55791e49 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -40,6 +40,14 @@ Runner Type indicates whether a requirement runs on a standard GitHub-hosted ima | REQ-031 | Parsing logic validates presence of required fields and reports missing or malformed data. | `scripts/__tests__/junit-parser.test.js` | | | | | REQ-032 | Parser tolerates and retains unknown attributes for future extensibility. | `scripts/__tests__/junit-parser.test.js` | | | | | REQ-033 | Tests ending with SelfHosted.Workflow.Tests.ps1 execute only in dry run mode unless the workflow targets a self-hosted Windows runner labeled self-hosted-windows-lv. | `tests/pester/SelfHosted.Workflow.Tests.ps1` | | | | +| REQ-034 | Workflow tests the composite action defined in via-lv-docker/action.yml on the GitHub-hosted Ubuntu runner labeled ubuntu-latest. | `tests/pester/ViaLvDocker.Workflow.ps1` | ubuntu-latest | integration | false | +| REQ-035 | Setup NI Package Manager (NIPM) and configure it for CI/CD environments by installing the package manager and disabling package caching. | `tests/pester/SetupNipm.Workflow.Tests.ps1` | | | | +| REQ-036 | Download, install, and activate LabVIEW Community Edition from an ISO image, handling installation timeouts and cleanup. | `tests/pester/SetupLabview.Workflow.Tests.ps1` | | | | +| REQ-037 | Configure LabVIEW settings by updating LabVIEW.ini to enable TCP/IP server and VI scripting operations. | `tests/pester/ConfigureLabview.Workflow.Tests.ps1` | | | | +| REQ-038 | Install VI Package Manager (VIPM) and LUnit CLI package for LabVIEW automation testing. | `tests/pester/SetupLunit.Workflow.Tests.ps1` | | | | +| REQ-039 | Build LabVIEW Packed Project Library (.lvlibp) using Linux LabVIEW Docker container with specified version, bitness, and build specification, then rename the artifact with version and commit metadata. | `tests/pester/BuildLvlibpDockerLinux.Workflow.Tests.ps1` | | | | +| REQ-040 | Build LabVIEW Packed Project Library (.lvlibp) using Windows LabVIEW Docker container with specified version, bitness, and build specification, then rename the artifact with version and commit metadata. | `tests/pester/BuildLvlibpDockerWindows.Workflow.Tests.ps1` | | | | +| REQ-041 | Build LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner with locally installed LabVIEW. | `tests/pester/BuildLvlibpGithubHostedWindows.Workflow.Tests.ps1` | | | | | REQIE-001 | After checking out the LabVIEW icon editor repository, PreSequence: The sequencer shall enumerate and record the build matrix used by the workflow (LabVIEW versions and bitness). Acceptance: a 'matrix.json' file exists listing each tuple {"lv-version": "2021"\|"2023", "bitness": "32"\|"64"} with at least [ ["2021","32"], ["2021","64"], ["2023","64"] ]. g-cli is expected at 'C:\Program Files\G-CLI\bin\g-cli.exe'. | `tests/pester/BuildProfile1.IconEditor.PreSequence.matrix-enumeration.ps1` | self-hosted-windows-lv | integration | true | | REQIE-002 | After checking out the LabVIEW icon editor repository, Setup: For each matrix entry, the sequencer shall apply [VIPC](glossary.md#vipc) dependencies using the canonical action inputs (minimum_supported_lv_version, vip_lv_version, supported_bitness, relative_path). Evidence: a 'vipc-apply.json' summary per matrix entry capturing inputs, start/end timestamps, exit code, and status. Acceptance: all entries report exit_code == 0 and status == 'success'. g-cli is expected at 'C:\Program Files\G-CLI\bin\g-cli.exe'. | `tests/pester/BuildProfile1.IconEditor.Setup.apply-vipc-succeeds.ps1` | self-hosted-windows-lv | integration | true | | REQIE-003 | After checking out the LabVIEW icon editor repository, Setup: The sequencer shall compute and persist semantic version information. Evidence: a 'version.json' containing VERSION, MAJOR, MINOR, PATCH, BUILD, IS_PRERELEASE and the commit SHA used. Acceptance: VERSION conforms to SemVer and all numeric components are present. g-cli is expected at 'C:\Program Files\G-CLI\bin\g-cli.exe'. | `tests/pester/BuildProfile1.IconEditor.Setup.version-outputs-captured.ps1` | self-hosted-windows-lv | integration | true | diff --git a/docs/scripts/build-lvlibp-docker-linux.md b/docs/scripts/build-lvlibp-docker-linux.md new file mode 100644 index 00000000..5bb1b0da --- /dev/null +++ b/docs/scripts/build-lvlibp-docker-linux.md @@ -0,0 +1,80 @@ +# Build Packed Library with Docker Linux 🐳📦 + +Call **`BuildLvlibpDockerLinux.ps1`** to compile LabVIEW packed libraries using LabVIEWCLI inside a Linux Docker container. + +## Inputs + +| Name | Required | Default | Example | Description | +|------|----------|---------|---------|-------------| +| `minimum_supported_lv_version` | **Yes** | - | `2026` | LabVIEW version year to use. | +| `supported_bitness` | **Yes** | - | `32` or `64` | Target LabVIEW bitness. | +| `project_path` | **Yes** | - | `lv_icon_editor.lvproj` | Path to the LabVIEW project file. | +| `target_name` | No | `""` | `My Computer` | Target containing the build spec. Defaults to "My Computer" in helper VI. | +| `build_spec_name` | No | `""` | `Editor Packed Library` | Build spec name. If empty, builds all specs. | +| `major` | No | `-1` | `1` | Major version component. If < 0, version setting is skipped. | +| `minor` | No | `-1` | `0` | Minor version component. If < 0, version setting is skipped. | +| `patch` | No | `-1` | `0` | Patch version component. If < 0, version setting is skipped. | +| `build` | No | `-1` | `1` | Build number component. If < 0, version setting is skipped. | +| `commit` | No | `""` | `abcdef` | Commit identifier. | +| `docker_image` | No | `nationalinstruments/labview` | Custom image name | Docker image to use. | +| `image_tag` | No | `2026q1-linux` | Custom tag | Docker image tag. | + +## Quick-start + +The following example builds using LabVIEW 2026 inside a Linux Docker container. + +```yaml +- uses: ./.github/actions/build-lvlibp-docker-linux + with: + minimum_supported_lv_version: 2026 + supported_bitness: 64 + project_path: lv_icon_editor.lvproj + target_name: My Computer + build_spec_name: Editor Packed Library + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} + docker_image: nationalinstruments/labview + image_tag: 2026q1-linux +``` + +## Build All Specifications with Version Override + +Leave `build_spec_name` empty and provide version to set the same version on all build specs: + +```yaml +- uses: ./.github/actions/build-lvlibp-docker-linux + with: + minimum_supported_lv_version: 2026 + supported_bitness: 64 + project_path: lv_icon_editor.lvproj + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} +``` + +## Version Behavior + +- **All version components provided** (`major`, `minor`, `patch`, `build` all ≥ 0): + - Helper VI is called to set the version + - If `build_spec_name` is provided: version is set on that build spec only + - If `build_spec_name` is omitted: version is set on **all** build specs in the project + +- **Any version component omitted** (< 0 or not provided): + - Version setting is skipped + +## Requirements + +- Docker must be installed and running on the host system +- The specified Linux Docker image must contain LabVIEWCLI +- The LabVIEW project file must exist at the specified path + +See also: [docs/actions/build-lvlibp-docker-linux.md](../actions/build-lvlibp-docker-linux.md) + +## License + +This directory inherits the root repository's license (MIT, unless otherwise noted). diff --git a/docs/scripts/build-lvlibp-docker-windows.md b/docs/scripts/build-lvlibp-docker-windows.md new file mode 100644 index 00000000..41fea865 --- /dev/null +++ b/docs/scripts/build-lvlibp-docker-windows.md @@ -0,0 +1,94 @@ +# Build Packed Library with Docker Windows 🐳📦 + +Call **`BuildLvlibpDockerWindows.ps1`** to compile LabVIEW packed libraries using LabVIEWCLI inside a Windows Docker container. + +## Inputs + +| Name | Required | Example | Description | +|------|----------|---------|-------------| +| `minimum_supported_lv_version` | **Yes** | `2026` | LabVIEW version year to use. | +| `supported_bitness` | **Yes** | `32` or `64` | Target LabVIEW bitness. | +| `project_path` | **Yes** | `lv_icon_editor.lvproj` | Path to the LabVIEW project file. | +| `target_name` | No | `My Computer` | Target that contains the build specification. Defaults to "My Computer" in helper VI. | +| `build_spec_name` | No | `Editor Packed Library` | Build specification name. Leave empty to build all. | +| `major` | No | `1` | Major version component. Omit to skip version setting. | +| `minor` | No | `0` | Minor version component. Omit to skip version setting. | +| `patch` | No | `0` | Patch version component. Omit to skip version setting. | +| `build` | No | `1` | Build number component. Omit to skip version setting. | +| `commit` | No | `abcdef` | Commit identifier. | +| `docker_image` | No | `nationalinstruments/labview` | Docker image name. | +| `image_tag` | No | `2026q1-windows` | Docker image tag. | + +## Quick-start + +The following example builds using LabVIEW 2026 inside a Windows Docker container with custom version: + +```yaml +- uses: ./.github/actions/build-lvlibp-docker-windows + with: + minimum_supported_lv_version: 2026 + supported_bitness: 64 + project_path: lv_icon_editor.lvproj + target_name: My Computer + build_spec_name: Editor Packed Library + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} + docker_image: nationalinstruments/labview + image_tag: 2026q1-windows +``` + +## Minimal Example + +Build with only required parameters (skips version setting, builds all specifications in "My Computer"): + +```yaml +- uses: ./.github/actions/build-lvlibp-docker-windows + with: + minimum_supported_lv_version: 2026 + supported_bitness: 64 + project_path: lv_icon_editor.lvproj +``` + +## Build All Specifications + +Leave `build_spec_name` empty to build all build specifications under the target: + +```yaml +- uses: ./.github/actions/build-lvlibp-docker-windows + with: + minimum_supported_lv_version: 2026 + supported_bitness: 64 + project_path: lv_icon_editor.lvproj + target_name: My Computer + build_spec_name: '' + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} +``` + +## Requirements + +- Docker must be installed and running on the host system +- The host must support Windows containers (Windows Server or Windows 10/11 with Docker Desktop) +- The specified Windows Docker image must contain LabVIEWCLI +- The LabVIEW project file must exist at the specified path + +## Platform Notes + +This action requires **Windows containers**, which are only available on: + +- Windows Server 2016 or later +- Windows 10/11 with Docker Desktop configured for Windows containers + +For Linux-based builds, use [build-lvlibp-docker-linux](build-lvlibp-docker-linux.md). + +See also: [docs/actions/build-lvlibp-docker-windows.md](../actions/build-lvlibp-docker-windows.md) + +## License + +This directory inherits the root repository's license (MIT, unless otherwise noted). diff --git a/docs/scripts/build-lvlibp-github-hosted-windows.md b/docs/scripts/build-lvlibp-github-hosted-windows.md new file mode 100644 index 00000000..9a621891 --- /dev/null +++ b/docs/scripts/build-lvlibp-github-hosted-windows.md @@ -0,0 +1,153 @@ +# Build Packed Library with Windows Runner 🖥️📦 + +Call **`BuildLvlibpGithubHostedWindows.ps1`** to compile LabVIEW packed libraries using LabVIEWCLI on a Windows GitHub-hosted runner. + +## Inputs + +| Name | Required | Default | Example | Description | +|------|----------|---------|---------|-------------| +| `minimum_supported_lv_version` | **Yes** | - | `2025` | LabVIEW version year to use. | +| `supported_bitness` | **Yes** | - | `32` or `64` | Target LabVIEW bitness. | +| `project_path` | **Yes** | - | `lv_icon_editor.lvproj` | Path to the LabVIEW project file. | +| `target_name` | No | `""` | `My Computer` | Target containing the build spec. Defaults to "My Computer" in helper VI. | +| `build_spec_name` | No | `""` | `Editor Packed Library` | Build spec name. If empty, builds all specs. | +| `major` | No | `-1` | `1` | Major version component. If < 0, version setting is skipped. | +| `minor` | No | `-1` | `0` | Minor version component. If < 0, version setting is skipped. | +| `patch` | No | `-1` | `0` | Patch version component. If < 0, version setting is skipped. | +| `build` | No | `-1` | `1` | Build number component. If < 0, version setting is skipped. | +| `commit` | No | `""` | `abcdef` | Commit identifier. | + +## Quick-start + +The following example builds using LabVIEW 2025 (32-bit) on a Windows runner. + +```yaml +- uses: ./.github/actions/build-lvlibp-github-hosted-windows + with: + minimum_supported_lv_version: 2025 + supported_bitness: 32 + project_path: lv_icon_editor.lvproj + target_name: My Computer + build_spec_name: Editor Packed Library + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} +``` + +## Complete Example with LabVIEW Setup + +This example shows the full workflow including LabVIEW installation: + +```yaml +name: Build LVLIBP + +on: + push: + branches: [main] + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup NI Package Manager + uses: ./.github/actions/setup-nipm + with: + log_level: 'INFO' + + - name: Setup LabVIEW + uses: ./.github/actions/setup-labview + with: + labview_iso_url: 'https://download.ni.com/.../ni-labview-2025-community-x86_25.3.3_offline.iso' + timeout_seconds: 1800 + serial_number: ${{ secrets.LABVIEW_SERIAL_NUMBER }} + package_id: 'LabVIEW_COM_PKG 25.0300' + + - name: Build PPL + uses: ./.github/actions/build-lvlibp-github-hosted-windows + with: + minimum_supported_lv_version: 2025 + supported_bitness: 32 + project_path: lv_icon_editor.lvproj + target_name: My Computer + build_spec_name: Editor Packed Library + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} + + - name: Upload Built PPL + uses: actions/upload-artifact@v4 + with: + name: lv_icon_x86_v1.0.0.1 + path: builds/*.lvlibp +``` + +## Build All Specifications with Version Override + +Leave `build_spec_name` empty and provide version to set the same version on all build specs: + +```yaml +- uses: ./.github/actions/build-lvlibp-github-hosted-windows + with: + minimum_supported_lv_version: 2025 + supported_bitness: 32 + project_path: lv_icon_editor.lvproj + target_name: My Computer + major: 1 + minor: 0 + patch: 0 + build: 1 + commit: ${{ github.sha }} +``` + +## Skip Version setting + +Omit version parameters to use versions to skip setting versions in build specifications: + +```yaml +- uses: ./.github/actions/build-lvlibp-github-hosted-windows + with: + minimum_supported_lv_version: 2025 + supported_bitness: 32 + project_path: lv_icon_editor.lvproj + build_spec_name: Editor Packed Library +``` + +## Version Behavior + +- **All version components provided** (`major`, `minor`, `patch`, `build` all ≥ 0): + - Helper VI is called to set the version + - If `build_spec_name` is provided: version is set on that build spec only + - If `build_spec_name` is omitted: version is set on **all** build specs in the project + +- **Any version component omitted** (< 0 or not provided): + - Version setting is skipped + - Build specifications use their own version settings from the project file + +## Requirements + +- LabVIEW must be installed on the runner (use `setup-labview` action) +- LabVIEWCLI must be available in the PATH +- Helper VI must exist at `scripts/build-lvlibp-helpers/SetBuildVersionCaller.vi` +- Windows runner (Windows Server 2019, 2022, or Windows 10/11) + +## Platform Notes + +This action requires **Windows runners** with locally installed LabVIEW. + +For containerized builds: + +- Windows containers: [build-lvlibp-docker-windows](build-lvlibp-docker-windows.md) +- Linux containers: [build-lvlibp-docker-linux](build-lvlibp-docker-linux.md) + +See also: [docs/actions/build-lvlibp-github-hosted-windows.md](../actions/build-lvlibp-github-hosted-windows.md) + +## License + +This directory inherits the root repository's license (MIT, unless otherwise noted). diff --git a/requirements.json b/requirements.json index 75c5601d..6582ecc3 100644 --- a/requirements.json +++ b/requirements.json @@ -296,6 +296,27 @@ "SetupLunit.Workflow.Tests" ] }, + { + "id": "REQ-039", + "description": "Build LabVIEW Packed Project Library (.lvlibp) using Linux LabVIEW Docker container with specified version, bitness, and build specification, then rename the artifact with version and commit metadata.", + "tests": [ + "BuildLvlibpDockerLinux.Workflow.Tests" + ] + }, + { + "id": "REQ-040", + "description": "Build LabVIEW Packed Project Library (.lvlibp) using Windows LabVIEW Docker container with specified version, bitness, and build specification, then rename the artifact with version and commit metadata.", + "tests": [ + "BuildLvlibpDockerWindows.Workflow.Tests" + ] + }, + { + "id": "REQ-041", + "description": "Build LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner with locally installed LabVIEW.", + "tests": [ + "BuildLvlibpGithubHostedWindows.Workflow.Tests" + ] + }, { "id": "REQIE-001", "description": "After checking out the LabVIEW icon editor repository, PreSequence: The sequencer shall enumerate and record the build matrix used by the workflow (LabVIEW versions and bitness). Acceptance: a 'matrix.json' file exists listing each tuple {\"lv-version\": \"2021\"|\"2023\", \"bitness\": \"32\"|\"64\"} with at least [ [\"2021\",\"32\"], [\"2021\",\"64\"], [\"2023\",\"64\"] ]. g-cli is expected at 'C:\\Program Files\\G-CLI\\bin\\g-cli.exe'.", diff --git a/scripts/build-lvlibp-docker-linux/BuildLvlibpDockerLinux.ps1 b/scripts/build-lvlibp-docker-linux/BuildLvlibpDockerLinux.ps1 new file mode 100644 index 00000000..de191508 --- /dev/null +++ b/scripts/build-lvlibp-docker-linux/BuildLvlibpDockerLinux.ps1 @@ -0,0 +1,195 @@ +<# +.SYNOPSIS + Builds the LabVIEW Packed Project Library (.lvlibp) using Linux LabVIEW Docker container. + +.DESCRIPTION + Executes LabVIEW build specification through LabVIEWCLI inside a Docker container. + +.PARAMETER MinimumSupportedLVVersion + LabVIEW version year used for the build (e.g., "2021", "2023", "2026"). + +.PARAMETER SupportedBitness + Bitness of the LabVIEW environment ("32" or "64"). + +.PARAMETER ProjectPath + Path to the LabVIEW project .lvproj file that contains the build specification. + +.PARAMETER TargetName + Target that contains the build specification. Defaults to "My Computer". + +.PARAMETER BuildSpecName + Name of the LabVIEW build specification to execute. If empty, builds all specifications in the target. + +.PARAMETER Major + Major version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Minor + Minor version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Patch + Patch version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Build + Build number component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Commit + Commit hash or identifier recorded in the build. + +.PARAMETER DockerImage + Docker image name (e.g., "nationalinstruments/labview"). + +.PARAMETER ImageTag + Docker image tag (e.g., "2026q1-linux"). + +.EXAMPLE + .\BuildLvlibpDockerLinux.ps1 -MinimumSupportedLVVersion "2026" -SupportedBitness "64" -ProjectPath "lv_icon_editor.lvproj" -TargetName "My Computer" -BuildSpecName "Editor Packed Library" -Major 1 -Minor 0 -Patch 0 -Build 0 -Commit "abc1234" + +.NOTES + [REQ-039] Build LabVIEW Packed Project Library using Linux Docker container +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)] + [string]$MinimumSupportedLVVersion, + + [Parameter(Mandatory = $true)] + [string]$SupportedBitness, + + [Parameter(Mandatory = $true)] + [string]$ProjectPath, + + [Parameter(Mandatory = $false)] + [string]$TargetName = "", + + [Parameter(Mandatory = $false)] + [string]$BuildSpecName = "", + + [Parameter(Mandatory = $false)] + [int]$Major = -1, + + [Parameter(Mandatory = $false)] + [int]$Minor = -1, + + [Parameter(Mandatory = $false)] + [int]$Patch = -1, + + [Parameter(Mandatory = $false)] + [int]$Build = -1, + + [Parameter(Mandatory = $false)] + [string]$Commit = "", + + [Parameter(Mandatory = $false)] + [string]$DockerImage = "nationalinstruments/labview", + + [Parameter(Mandatory = $false)] + [string]$ImageTag = "2026q1-linux" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +try { + Write-Verbose "Building PPL with Linux Docker container" + $hasVersion = ($Major -ge 0) -and ($Minor -ge 0) -and ($Patch -ge 0) -and ($Build -ge 0) + + if ($hasVersion) { + $versionString = "$Major.$Minor.$Patch.$Build" + Write-Information "PPL Version: $versionString" -InformationAction Continue + } else { + Write-Information "PPL Version setting skipped." -InformationAction Continue + } + + if ($Commit) { + Write-Information "Commit: $Commit" -InformationAction Continue + } + + $fullImage = "${DockerImage}:${ImageTag}" + Write-Information "Docker Image: $fullImage" -InformationAction Continue + + # Pull Docker image + Write-Information "Pulling Docker image..." -InformationAction Continue + docker pull $fullImage *>&1 | ForEach-Object { Write-Information $_ -InformationAction Continue } + if ($LASTEXITCODE -ne 0) { + throw "Failed to pull Docker image (exit code: $LASTEXITCODE)" + } + + # Get the path to the bash script + $scriptDir = $PSScriptRoot + $buildScript = Join-Path $scriptDir 'build-lvlibp.sh' + + if (-not (Test-Path $buildScript)) { + throw "Build script not found: $buildScript" + } + + $actionRoot = Split-Path (Split-Path $scriptDir -Parent) -Parent + Write-Verbose "Calculated action root from script path: $actionRoot" + + $helperDir = Join-Path $actionRoot 'scripts' 'build-lvlibp-helpers' + + if (-not (Test-Path $helperDir)) { + throw "Helper VI directory not found: $helperDir" + } + + Write-Verbose "Action root: $actionRoot" + Write-Verbose "Helper directory: $helperDir" + Write-Verbose "Build script: $buildScript" + + # Construct LabVIEWPath for Linux container + $labviewPath = "/usr/local/natinst/LabVIEW-${MinimumSupportedLVVersion}-${SupportedBitness}/labview" + Write-Verbose "LabVIEWPath: $labviewPath" + + # Container paths are always Linux-style + $containerProjectPath = "/workspace/$ProjectPath" + $containerScriptPath = "/tmp/build-lvlibp.sh" + + # Construct bash command arguments + $bashArgs = @( + "--labview-path", "'$labviewPath'" + "--project-path", "'$containerProjectPath'" + ) + + if (-not [string]::IsNullOrWhiteSpace($TargetName)) { + $bashArgs += "--target-name", "'$TargetName'" + } + + if (-not [string]::IsNullOrWhiteSpace($BuildSpecName)) { + $bashArgs += "--build-spec-name", "'$BuildSpecName'" + } + + if ($hasVersion) { + $bashArgs += "--version", "'$versionString'" + } + + $bashCommand = "chmod +x $containerScriptPath && $containerScriptPath $($bashArgs -join ' ')" + + Write-Information "Executing build script in Docker container..." -InformationAction Continue + Write-Verbose "Command: bash -c `"$bashCommand`"" + + # Run build in container + # Mount user workspace to /workspace + # Mount folder with helper VIs to /helpers + # Mount build script to /tmp + docker run --rm ` + -v "${PWD}:/workspace" ` + -v "${actionRoot}:/helpers" ` + -v "${buildScript}:${containerScriptPath}" ` + $fullImage ` + bash -c $bashCommand ` + *>&1 | ForEach-Object { Write-Information $_ -InformationAction Continue } + + $buildExitCode = $LASTEXITCODE + Write-Information "Build completed with exit code: $buildExitCode" -InformationAction Continue + + if ($buildExitCode -ne 0) { + throw "Build failed with exit code $buildExitCode" + } + + Write-Information "Build succeeded" -InformationAction Continue + exit 0 +} +catch { + Write-Error "BuildLvlibpDockerLinux failed: $_" + exit 1 +} \ No newline at end of file diff --git a/scripts/build-lvlibp-docker-linux/build-lvlibp.sh b/scripts/build-lvlibp-docker-linux/build-lvlibp.sh new file mode 100644 index 00000000..2a9ef8e7 --- /dev/null +++ b/scripts/build-lvlibp-docker-linux/build-lvlibp.sh @@ -0,0 +1,137 @@ +#!/bin/bash +# Build LabVIEW Packed Project Library using LabVIEWCLI +# [REQ-039] Build LVLIBP using Docker container + +set -euo pipefail + +# Parse arguments +LABVIEW_PATH="" +PROJECT_PATH="" +TARGET_NAME="" +BUILD_SPEC_NAME="" +VERSION="" + +while [[ $# -gt 0 ]]; do + case $1 in + --labview-path) + LABVIEW_PATH="$2" + shift 2 + ;; + --project-path) + PROJECT_PATH="$2" + shift 2 + ;; + --target-name) + TARGET_NAME="$2" + shift 2 + ;; + --build-spec-name) + BUILD_SPEC_NAME="$2" + shift 2 + ;; + --version) + VERSION="$2" + shift 2 + ;; + *) + echo "Unknown argument: $1" + exit 1 + ;; + esac +done + +# Validate required arguments +if [[ -z "$LABVIEW_PATH" ]] || [[ -z "$PROJECT_PATH" ]]; then + echo "Error: Missing required arguments" + echo "Usage: $0 --labview-path --project-path [--target-name ] [--build-spec-name ] [--version ]" + exit 1 +fi + +echo "Building LabVIEW Packed Project Library..." +echo "LabVIEW: $LABVIEW_PATH" +echo "Project: $PROJECT_PATH" +echo "Target: ${TARGET_NAME:-}" +echo "Build Spec: ${BUILD_SPEC_NAME:-}" +echo "Version: ${VERSION:-}" + +if [[ -n "$VERSION" ]]; then + echo "Setting build version..." + HELPER_VI="/helpers/scripts/build-lvlibp-helpers/SetBuildVersionCaller.vi" + + if [[ ! -f "$HELPER_VI" ]]; then + echo "Error: Helper VI not found at $HELPER_VI" + exit 1 + fi + + # SetBuildVersionCaller.vi expects positional arguments: + # 1. ProjectPath (required) + # 2. BuildSpecName (optional, empty string to apply to all) + # 3. TargetName (optional, defaults to "My Computer" in VI) + # 4. Version (optional, empty string to skip version setting) + + echo "Executing: LabVIEWCLI -OperationName RunVI -LabVIEWPath \"$LABVIEW_PATH\" -VIPath $HELPER_VI \"$PROJECT_PATH\" \"$BUILD_SPEC_NAME\" \"$TARGET_NAME\" \"$VERSION\"" + + # Pass all positional arguments, preserving empty strings + LabVIEWCLI \ + -OperationName RunVI \ + -LabVIEWPath "$LABVIEW_PATH" \ + -VIPath "$HELPER_VI" \ + "$PROJECT_PATH" \ + "$BUILD_SPEC_NAME" \ + "$TARGET_NAME" \ + "$VERSION" \ + -Headless + + SET_VERSION_EXIT=$? + + if [[ $SET_VERSION_EXIT -ne 0 ]]; then + echo "Failed to set build version (exit code: $SET_VERSION_EXIT)" + exit $SET_VERSION_EXIT + fi + + echo "Build version set successfully" +else + echo "Skipping version set" +fi + +# Construct LabVIEWCLI command +CLI_ARGS=( + "-OperationName" "ExecuteBuildSpec" + "-LabVIEWPath" "$LABVIEW_PATH" + "-ProjectPath" "$PROJECT_PATH" +) + +if [[ -n "$TARGET_NAME" ]]; then + CLI_ARGS+=("-TargetName" "$TARGET_NAME") +fi + +if [[ -n "$BUILD_SPEC_NAME" ]]; then + CLI_ARGS+=("-BuildSpecName" "$BUILD_SPEC_NAME") +fi + +CLI_ARGS+=("-Headless") + +# Execute LabVIEWCLI +echo "Executing: LabVIEWCLI ${CLI_ARGS[*]}" +LabVIEWCLI "${CLI_ARGS[@]}" + +EXIT_CODE=$? +echo "Build exit code: $EXIT_CODE" + +# Copy LabVIEW logs to workspace for artifact collection +echo "Copying LabVIEW logs to workspace..." +mkdir -p /workspace/build-logs +if ls /tmp/lvtemporary_*.log 1> /dev/null 2>&1; then + cp /tmp/lvtemporary_*.log /workspace/build-logs/ 2>/dev/null || true + echo "Logs copied to /workspace/build-logs/" +else + echo "No LabVIEW log files found in /tmp/" +fi + +if [[ $EXIT_CODE -ne 0 ]]; then + echo "Build failed" + exit $EXIT_CODE +fi + +echo "Build completed successfully" +exit 0 \ No newline at end of file diff --git a/scripts/build-lvlibp-docker-windows/BuildLvlibpDockerWindows.ps1 b/scripts/build-lvlibp-docker-windows/BuildLvlibpDockerWindows.ps1 new file mode 100644 index 00000000..e20ee8d0 --- /dev/null +++ b/scripts/build-lvlibp-docker-windows/BuildLvlibpDockerWindows.ps1 @@ -0,0 +1,209 @@ +<# +.SYNOPSIS + Builds the LabVIEW Packed Project Library (.lvlibp) using Windows LabVIEW Docker container. + +.DESCRIPTION + Executes LabVIEW build specification through LabVIEWCLI inside a Windows Docker container, + embedding the provided version information and commit identifier. + +.PARAMETER MinimumSupportedLVVersion + LabVIEW version year used for the build (e.g., "2021", "2023", "2026"). + +.PARAMETER SupportedBitness + Bitness of the LabVIEW environment ("32" or "64"). + +.PARAMETER ProjectPath + Path to the LabVIEW project .lvproj file that contains the build specification. + +PARAMETER TargetName + Target that contains the build specification. Defaults to "My Computer". + +.PARAMETER BuildSpecName + Name of the LabVIEW build specification to execute. If empty, builds all specifications in the target. + +.PARAMETER Major + Major version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Minor + Minor version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Patch + Patch version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Build + Build number component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Commit + Commit hash or identifier recorded in the build. + +.PARAMETER DockerImage + Docker image name (e.g., "nationalinstruments/labview"). + +.PARAMETER ImageTag + Docker image tag (e.g., "2026q1-windows"). + +.EXAMPLE + .\BuildLvlibpDockerWindows.ps1 -MinimumSupportedLVVersion "2026" -SupportedBitness "64" -ProjectPath "lv_icon_editor.lvproj" -TargetName "My Computer" -BuildSpecName "Editor Packed Library" -Major 1 -Minor 0 -Patch 0 -Build 0 -Commit "abc1234" + +.NOTES + [REQ-040] Build LabVIEW Packed Project Library using Windows Docker container +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)] + [string]$MinimumSupportedLVVersion, + + [Parameter(Mandatory = $true)] + [string]$SupportedBitness, + + [Parameter(Mandatory = $true)] + [string]$ProjectPath, + + [Parameter(Mandatory = $false)] + [string]$TargetName = "", + + [Parameter(Mandatory = $false)] + [string]$BuildSpecName = "", + + [Parameter(Mandatory = $false)] + [int]$Major = -1, + + [Parameter(Mandatory = $false)] + [int]$Minor = -1, + + [Parameter(Mandatory = $false)] + [int]$Patch = -1, + + [Parameter(Mandatory = $false)] + [int]$Build = -1, + + [Parameter(Mandatory = $false)] + [string]$Commit = "", + + [Parameter(Mandatory = $false)] + [string]$DockerImage = "nationalinstruments/labview", + + [Parameter(Mandatory = $false)] + [string]$ImageTag = "2026q1-windows" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +try { + Write-Verbose "Building PPL with Windows Docker container" + $hasVersion = ($Major -ge 0) -and ($Minor -ge 0) -and ($Patch -ge 0) -and ($Build -ge 0) + + if ($hasVersion) { + $versionString = "$Major.$Minor.$Patch.$Build" + Write-Information "PPL Version: $versionString" -InformationAction Continue + } else { + Write-Information "PPL Version setting skipped." -InformationAction Continue + } + + if ($Commit) { + Write-Information "Commit: $Commit" -InformationAction Continue + } + + $fullImage = "${DockerImage}:${ImageTag}" + Write-Information "Docker Image: $fullImage" -InformationAction Continue + + # Pull Docker image + Write-Information "Pulling Docker image..." -InformationAction Continue + docker pull $fullImage *>&1 | ForEach-Object { Write-Information $_ -InformationAction Continue } + if ($LASTEXITCODE -ne 0) { + throw "Failed to pull Docker image (exit code: $LASTEXITCODE)" + } + + # Get the path to the PowerShell build script + $scriptDir = $PSScriptRoot + $buildScript = Join-Path $scriptDir 'build-lvlibp.ps1' + + if (-not (Test-Path $buildScript)) { + throw "Build script not found: $buildScript" + } + + $actionRoot = Split-Path (Split-Path $scriptDir -Parent) -Parent + Write-Verbose "Calculated action root from script path: $actionRoot" + + $helperDir = Join-Path $actionRoot 'scripts' 'build-lvlibp-helpers' + + if (-not (Test-Path $helperDir)) { + throw "Helper VI directory not found: $helperDir" + } + + Write-Verbose "Action root: $actionRoot" + Write-Verbose "Helper directory: $helperDir" + Write-Verbose "Build script path: $buildScript" + + # Create temporary directory for script mounting + $tempDir = Join-Path $env:TEMP "docker-build-$(New-Guid)" + New-Item -Path $tempDir -ItemType Directory -Force | Out-Null + $tempScript = Join-Path $tempDir 'build-lvlibp.ps1' + Copy-Item -Path $buildScript -Destination $tempScript -Force + Write-Verbose "Copied build script to: $tempScript" + + # Construct LabVIEWPath for Windows container + $labviewPath = if ($SupportedBitness -eq '32') { + "C:\Program Files (x86)\National Instruments\LabVIEW $MinimumSupportedLVVersion\LabVIEW.exe" + } else { + "C:\Program Files\National Instruments\LabVIEW $MinimumSupportedLVVersion\LabVIEW.exe" + } + + Write-Verbose "LabVIEWPath: $labviewPath" + + # Windows container paths + $containerProjectPath = "C:\workspace\$ProjectPath" + $containerScriptPath = "C:\scripts\build-lvlibp.ps1" + + # Construct PowerShell command arguments + $scriptArgs = @( + "-LabVIEWPath", "`"$labviewPath`"" + "-ProjectPath", "`"$containerProjectPath`"" + ) + + if (-not [string]::IsNullOrWhiteSpace($TargetName)) { + $scriptArgs += "-TargetName", "`"$TargetName`"" + } + + if (-not [string]::IsNullOrWhiteSpace($BuildSpecName)) { + $scriptArgs += "-BuildSpecName", "`"$BuildSpecName`"" + } + + if ($hasVersion) { + $scriptArgs += "-Version", "`"$versionString`"" + } + + Write-Information "Executing build script in Windows Docker container..." -InformationAction Continue + Write-Verbose "Script: $containerScriptPath $($scriptArgs -join ' ')" + + # Run build in Windows container using -File with mounted script + docker run --rm ` + -v "${PWD}:C:\workspace" ` + -v "${actionRoot}:C:\actions" ` + -v "${tempDir}:C:\scripts" ` + $fullImage ` + powershell -NoProfile -File $containerScriptPath @scriptArgs ` + *>&1 | ForEach-Object { Write-Information $_ -InformationAction Continue } + + $buildExitCode = $LASTEXITCODE + Write-Information "Build completed with exit code: $buildExitCode" -InformationAction Continue + + if ($buildExitCode -ne 0) { + throw "Build failed with exit code $buildExitCode" + } + + Write-Information "Build succeeded" -InformationAction Continue + exit 0 +} +catch { + Write-Error "BuildLvlibpDockerWindows failed: $_" + exit 1 +} +finally { + if ($tempDir -and (Test-Path $tempDir)) { + Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue + Write-Verbose "Cleaned up temporary directory: $tempDir" + } +} \ No newline at end of file diff --git a/scripts/build-lvlibp-docker-windows/build-lvlibp.ps1 b/scripts/build-lvlibp-docker-windows/build-lvlibp.ps1 new file mode 100644 index 00000000..e055be9b --- /dev/null +++ b/scripts/build-lvlibp-docker-windows/build-lvlibp.ps1 @@ -0,0 +1,117 @@ +<# +.SYNOPSIS + Build LabVIEW Packed Project Library using LabVIEWCLI + +.DESCRIPTION + [REQ-040] Build LVLIBP using Windows Docker container + +.NOTES + This script is executed inside the Windows Docker container. +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)] + [string]$LabVIEWPath, + + [Parameter(Mandatory = $true)] + [string]$ProjectPath, + + [Parameter(Mandatory = $false)] + [string]$TargetName = "", + + [Parameter(Mandatory = $false)] + [string]$BuildSpecName = "", + + [Parameter(Mandatory = $false)] + [string]$Version = "" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +Write-Host "Building LabVIEW Packed Project Library..." +Write-Host "LabVIEW: $LabVIEWPath" +Write-Host "Project: $ProjectPath" +Write-Host "Target: $(if ($TargetName) { $TargetName } else { '' })" +Write-Host "Build Spec: $(if ($BuildSpecName) { $BuildSpecName } else { '' })" +Write-Host "Version: $(if ($Version) { $Version } else { '' })" + +# Set build version using helper VI if Version is provided +if ($Version) { + Write-Host "Setting build version to: $Version..." + $helperVI = "C:\actions\scripts\build-lvlibp-helpers\SetBuildVersionCaller.vi" + + if (-not (Test-Path $helperVI)) { + throw "Helper VI not found at: $helperVI" + } + + # Format arguments for logging - show "" only for empty strings + $projectArg = if ($ProjectPath) { $ProjectPath } else { '""' } + $buildSpecArg = if ($BuildSpecName) { $BuildSpecName } else { '""' } + $targetArg = if ($TargetName) { $TargetName } else { '""' } + $versionArg = if ($Version) { $Version } else { '""' } + + Write-Host "Executing: LabVIEWCLI -OperationName RunVI -LabVIEWPath `"$LabVIEWPath`" -VIPath `"$helperVI`" `"$projectArg`" `"$buildSpecArg`" `"$targetArg`" `"$versionArg`" -Headless" + + & LabVIEWCLI -OperationName RunVI -LabVIEWPath $LabVIEWPath -VIPath $helperVI $projectArg $buildSpecArg $targetArg $versionArg -Headless + $setVersionExit = $LASTEXITCODE + + if ($setVersionExit -ne 0) { + throw "Failed to set build version (exit code: $setVersionExit)" + } + + Write-Host "Build version set successfully" +} else { + Write-Host "Skipping version set - using version from build spec(s)" +} + +# Construct LabVIEWCLI command +$cliArgs = @( + '-OperationName', 'ExecuteBuildSpec' + '-LabVIEWPath', $LabVIEWPath + '-ProjectPath', $ProjectPath +) + +if (-not [string]::IsNullOrWhiteSpace($TargetName)) { + $cliArgs += '-TargetName', $TargetName +} + +if (-not [string]::IsNullOrWhiteSpace($BuildSpecName)) { + $cliArgs += '-BuildSpecName', $BuildSpecName +} + +$cliArgs += '-Headless' + +Write-Host "Executing: LabVIEWCLI $($cliArgs -join ' ')" + +try { + & LabVIEWCLI @cliArgs + $exitCode = $LASTEXITCODE + Write-Host "Build exit code: $exitCode" + + # Copy LabVIEW logs to workspace for artifact collection + Write-Host "Copying LabVIEW logs to workspace..." + $logDir = "C:\workspace\build-logs" + New-Item -Path $logDir -ItemType Directory -Force | Out-Null + + $tempLogs = Get-ChildItem -Path $env:TEMP -Filter "lvtemporary_*.log" -ErrorAction SilentlyContinue + if ($tempLogs) { + Copy-Item -Path $tempLogs.FullName -Destination $logDir -Force -ErrorAction SilentlyContinue + Write-Host "Logs copied to $logDir" + } else { + Write-Host "No LabVIEW log files found in $env:TEMP" + } + + if ($exitCode -ne 0) { + Write-Host "Build failed" + exit $exitCode + } + + Write-Host "Build completed successfully" + exit 0 +} +catch { + Write-Error "Build failed: $_" + exit 1 +} \ No newline at end of file diff --git a/scripts/build-lvlibp-github-hosted-windows/BuildLvlibpGithubHostedWindows.ps1 b/scripts/build-lvlibp-github-hosted-windows/BuildLvlibpGithubHostedWindows.ps1 new file mode 100644 index 00000000..79dc671f --- /dev/null +++ b/scripts/build-lvlibp-github-hosted-windows/BuildLvlibpGithubHostedWindows.ps1 @@ -0,0 +1,196 @@ +<# +.SYNOPSIS + Builds the LabVIEW Packed Project Library (.lvlibp) using Windows GitHub-hosted runner. + +.DESCRIPTION + Executes LabVIEW build specification through LabVIEWCLI on a Windows GitHub-hosted runner. + +.PARAMETER MinimumSupportedLVVersion + LabVIEW version year used for the build (e.g., "2021", "2023", "2026"). + +.PARAMETER SupportedBitness + Bitness of the LabVIEW environment ("32"). + +.PARAMETER ProjectPath + Path to the LabVIEW project .lvproj file that contains the build specification. + +.PARAMETER TargetName + Target that contains the build specification. Defaults to "My Computer". + +.PARAMETER BuildSpecName + Name of the LabVIEW build specification to execute. If empty, builds all specifications in the target. + +.PARAMETER Major + Major version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Minor + Minor version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Patch + Patch version component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Build + Build number component for the PPL. Optional - if not provided, version setting is skipped. + +.PARAMETER Commit + Commit hash or identifier recorded in the build. + +.EXAMPLE + .\BuildLvlibpGithubHostedWindows.ps1 -MinimumSupportedLVVersion "2025" -SupportedBitness "32" -ProjectPath "lv_icon_editor.lvproj" -TargetName "My Computer" -BuildSpecName "Editor Packed Library" -Major 1 -Minor 0 -Patch 0 -Build 0 -Commit "abc1234" + +.NOTES + [REQ-041] Build LabVIEW Packed Project Library using Windows GitHub-hosted runner +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)] + [string]$MinimumSupportedLVVersion, + + [Parameter(Mandatory = $true)] + [string]$SupportedBitness, + + [Parameter(Mandatory = $true)] + [string]$ProjectPath, + + [Parameter(Mandatory = $false)] + [string]$TargetName = "", + + [Parameter(Mandatory = $false)] + [string]$BuildSpecName = "", + + [Parameter(Mandatory = $false)] + [int]$Major = -1, + + [Parameter(Mandatory = $false)] + [int]$Minor = -1, + + [Parameter(Mandatory = $false)] + [int]$Patch = -1, + + [Parameter(Mandatory = $false)] + [int]$Build = -1, + + [Parameter(Mandatory = $false)] + [string]$Commit = "" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +try { + Write-Verbose "Building PPL with Windows GitHub-hosted runner" + $hasVersion = ($Major -ge 0) -and ($Minor -ge 0) -and ($Patch -ge 0) -and ($Build -ge 0) + + if ($hasVersion) { + $versionString = "$Major.$Minor.$Patch.$Build" + Write-Information "PPL Version: $versionString" -InformationAction Continue + } else { + Write-Information "PPL Version setting skipped." -InformationAction Continue + } + + Write-Information "Commit: $Commit" -InformationAction Continue + + # Construct LabVIEWPath for Windows + if ($SupportedBitness -eq "32") { + $labviewPath = "C:\Program Files (x86)\National Instruments\LabVIEW $MinimumSupportedLVVersion\LabVIEW.exe" + } else { + $labviewPath = "C:\Program Files\National Instruments\LabVIEW $MinimumSupportedLVVersion\LabVIEW.exe" + } + + $labviewCLI = "C:\Program Files (x86)\National Instruments\Shared\LabVIEW CLI\LabVIEWCLI.exe" + + if (-not (Test-Path $labviewPath)) { + throw "LabVIEW not found at: $labviewPath" + } + + Write-Verbose "LabVIEWPath: $labviewPath" + Write-Information "Project: $ProjectPath" -InformationAction Continue + Write-Information "Target: $(if ($TargetName) { $TargetName } else { '' })" -InformationAction Continue + Write-Information "Build Spec: $(if ($BuildSpecName) { $BuildSpecName } else { '' })" -InformationAction Continue + # Verify project file exists + if (-not (Test-Path $ProjectPath)) { + throw "Project file not found: $ProjectPath" + } + + # Only set build version if Version is provided + if ($hasVersion) { + Write-Information "Setting build version to: $versionString..." -InformationAction Continue + $helperVI = Join-Path $PSScriptRoot '..' 'build-lvlibp-helpers' 'SetBuildVersionCaller.vi' + + if (-not (Test-Path $helperVI)) { + throw "Helper VI not found at: $helperVI" + } + + # SetBuildVersionCaller.vi expects positional arguments: + # 1. ProjectPath (required) + # 2. BuildSpecName (empty string to apply to all) + # 3. TargetName (empty string to use VI default) + # 4. Version (required when setting version) + $projectArg = (Resolve-Path $ProjectPath).Path + $buildSpecArg = if ($BuildSpecName) { $BuildSpecName } else { '""' } + $targetArg = if ($TargetName) { $TargetName } else { '""' } + $versionArg = if ($versionString) { $versionString } else { '""' } + + Write-Host "Executing: LabVIEWCLI -OperationName RunVI -LabVIEWPath `"$LabVIEWPath`" -VIPath `"$helperVI`" `"$projectArg`" `"$buildSpecArg`" `"$targetArg`" `"$versionArg`" -Headless" + + & $labviewCLI -OperationName RunVI -LabVIEWPath $LabVIEWPath -VIPath $helperVI $projectArg $buildSpecArg $targetArg $versionArg -Headless + $setVersionExit = $LASTEXITCODE + + if ($setVersionExit -ne 0) { + throw "Failed to set build version (exit code: $setVersionExit)" + } + + Write-Information "Build version set successfully" -InformationAction Continue + } else { + Write-Information "Skipping version set " -InformationAction Continue + } + + # Construct LabVIEWCLI command + $cliArgs = @( + '-OperationName', 'ExecuteBuildSpec' + '-LabVIEWPath', $labviewPath + '-ProjectPath', (Resolve-Path $ProjectPath).Path + ) + + if (-not [string]::IsNullOrWhiteSpace($TargetName)) { + $cliArgs += '-TargetName', $TargetName + } + + if (-not [string]::IsNullOrWhiteSpace($BuildSpecName)) { + $cliArgs += '-BuildSpecName', $BuildSpecName + } + + $cliArgs += '-Headless' + + Write-Information "Executing: LabVIEWCLI $($cliArgs -join ' ')" -InformationAction Continue + + # Execute LabVIEWCLI + & $labviewCLI @cliArgs + $buildExitCode = $LASTEXITCODE + Write-Information "Build exit code: $buildExitCode" -InformationAction Continue + + # Copy LabVIEW logs to workspace for artifact collection + Write-Information "Copying LabVIEW logs to workspace..." -InformationAction Continue + $logDir = "build-logs" + New-Item -Path $logDir -ItemType Directory -Force | Out-Null + + $tempLogs = Get-ChildItem -Path $env:TEMP -Filter "lvtemporary_*.log" -ErrorAction SilentlyContinue + if ($tempLogs) { + Copy-Item -Path $tempLogs.FullName -Destination $logDir -Force -ErrorAction SilentlyContinue + Write-Information "Logs copied to $logDir" -InformationAction Continue + } else { + Write-Warning "No LabVIEW log files found in $env:TEMP" + } + + if ($buildExitCode -ne 0) { + throw "Build failed with exit code $buildExitCode" + } + + Write-Information "Build succeeded" -InformationAction Continue + exit 0 +} +catch { + Write-Error "BuildLvlibpGithubHostedWindows failed: $_" + exit 1 +} \ No newline at end of file diff --git a/scripts/build-lvlibp-helpers/README.md b/scripts/build-lvlibp-helpers/README.md new file mode 100644 index 00000000..cae16ccd --- /dev/null +++ b/scripts/build-lvlibp-helpers/README.md @@ -0,0 +1,76 @@ +# Build LVLIBP Common Scripts + +This directory contains shared utilities used by all LVLIBP build actions. + +## SetBuildVersion.vi + +Helper VI that sets the build version for LabVIEW build specification(s). + +### VI Parameters + +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| `ProjectPath` | String | **Yes** | - | Path to the LabVIEW project file | +| `BuildSpecName` | String | No | *all build specs* | Build specification name | +| `TargetName` | String | No | `"My Computer"` | Target containing the build spec(s) | +| `Version` | String | **Yes** | - | Version string in format `M.m.p.b` | + +### Behavior + +- **ProjectPath** and **Version** are mandatory +- **TargetName** defaults to `"My Computer"` if not provided +- **BuildSpecName**: + + - If **not provided**, the VI sets the version on **all build specifications** in the project + - If **provided**, the VI sets the version on only the specified build specification + +### Usage with LabVIEWCLI + +**Set version on specific build spec:** + +```bash +LabVIEWCLI \ + -OperationName RunVI \ + -LabVIEWPath "/usr/local/natinst/LabVIEW-2025-64/labview" \ + -VIPath "/workspace/scripts/build-lvlibp-common/SetBuildVersion.vi" \ + "/workspace/project.lvproj" "My PPL" "My Computer" "1.0.0.4"\ + -Headless +``` + +**Set version on all build specs:** + +```bash +LabVIEWCLI \ + -OperationName RunVI \ + -LabVIEWPath "/usr/local/natinst/LabVIEW-2025-64/labview" \ + -VIPath "/workspace/scripts/build-lvlibp-common/SetBuildVersion.vi" \ + "/workspace/project.lvproj" "" "My Computer" "2.0.0.4"\ + -Headless +``` + +### Used By + +- [`build-lvlibp-docker-linux`](../build-lvlibp-docker-linux/BuildLvlibpDockerLinux.ps1) – When version parameters are provided +- [`build-lvlibp-docker-windows`](../build-lvlibp-docker-windows/BuildLvlibpDockerWindows.ps1) – When version parameters are provided +- [`build-lvlibp-github-hosted-windows`](../build-lvlibp-github-hosted-windows/BuildLvlibpGithubHostedWindows.ps1) – When version parameters are provided + +### When is the Helper VI Called? + +The helper VI is **only called** when: + +1. All version components (`Major`, `Minor`, `Patch`, `Build`) are provided **and** ≥ 0 + +The helper VI is **not called** when: + +1. Any version component is missing or < 0 (build specs use their own versions) + +### Notes + +- When **no version is provided** to the build scripts, the helper VI is **not called** +- Each build specification will use its own version settings from the project file +- When version is provided but BuildSpecName is omitted, **all build specs get the same version** + +## See Also + +- [Architecture documentation](../../docs/architecture.md) +- [CREATE-NEW-ACTION.md](../../CREATE-NEW-ACTION.md) diff --git a/scripts/build-lvlibp-helpers/SetBuildVersion.vi b/scripts/build-lvlibp-helpers/SetBuildVersion.vi new file mode 100644 index 00000000..d884784d Binary files /dev/null and b/scripts/build-lvlibp-helpers/SetBuildVersion.vi differ diff --git a/scripts/build-lvlibp-helpers/SetBuildVersionCaller.vi b/scripts/build-lvlibp-helpers/SetBuildVersionCaller.vi new file mode 100644 index 00000000..5d621eba Binary files /dev/null and b/scripts/build-lvlibp-helpers/SetBuildVersionCaller.vi differ diff --git a/tests/pester/BuildLvlibpDockerLinux.Workflow.Tests.ps1 b/tests/pester/BuildLvlibpDockerLinux.Workflow.Tests.ps1 new file mode 100644 index 00000000..8d3bb56a --- /dev/null +++ b/tests/pester/BuildLvlibpDockerLinux.Workflow.Tests.ps1 @@ -0,0 +1,49 @@ +#requires -Version 7.0 +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +Describe 'BuildLvlibpDockerLinux.Workflow' { + $meta = @{ + requirement = 'REQ-039' + Owner = 'NI' + Evidence = 'tests/pester/BuildLvlibpDockerLinux.Workflow.Tests.ps1' + } + + BeforeAll { + $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..' '..')).Path + Import-Module (Join-Path $repoRoot 'actions' 'OpenSourceActions.psd1') -Force + } + + It 'validates action.yml exists [REQ-039]' -Tag 'REQ-039' { + $actionPath = Join-Path $repoRoot 'build-lvlibp-docker-linux' 'action.yml' + Test-Path $actionPath | Should -Be $true + } + + It 'validates implementation script exists [REQ-039]' -Tag 'REQ-039' { + $scriptPath = Join-Path $repoRoot 'scripts' 'build-lvlibp-docker-linux' 'BuildLvlibpDockerLinux.ps1' + Test-Path $scriptPath | Should -Be $true + } + + It 'validates inner build script exists [REQ-039]' -Tag 'REQ-039' { + $scriptPath = Join-Path $repoRoot 'scripts' 'build-lvlibp-docker-linux' 'build-lvlibp.sh' + Test-Path $scriptPath | Should -Be $true + } + + It 'executes dry-run with only required parameters [REQ-039]' -Tag 'REQ-039' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'build-lvlibp-docker-linux' ` + -ArgsJson '{"MinimumSupportedLVVersion":"2026","SupportedBitness":"64","ProjectPath":"test.lvproj"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } + + It 'executes dry-run with all parameters [REQ-039]' -Tag 'REQ-039' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'build-lvlibp-docker-linux' ` + -ArgsJson '{"MinimumSupportedLVVersion":"2026","SupportedBitness":"64","ProjectPath":"test.lvproj","TargetName":"My Computer","BuildSpecName":"TestBuild","Major":1,"Minor":0,"Patch":0,"Build":0,"Commit":"abc1234","DockerImage":"nationalinstruments/labview","ImageTag":"2026q1-linux"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } +} \ No newline at end of file diff --git a/tests/pester/BuildLvlibpDockerWindows.Workflow.Tests.ps1 b/tests/pester/BuildLvlibpDockerWindows.Workflow.Tests.ps1 new file mode 100644 index 00000000..3e582c3d --- /dev/null +++ b/tests/pester/BuildLvlibpDockerWindows.Workflow.Tests.ps1 @@ -0,0 +1,49 @@ +#requires -Version 7.0 +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +Describe 'BuildLvlibpDockerWindows.Workflow' { + $meta = @{ + requirement = 'REQ-040' + Owner = 'NI' + Evidence = 'tests/pester/BuildLvlibpDockerWindows.Workflow.Tests.ps1' + } + + BeforeAll { + $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..' '..')).Path + Import-Module (Join-Path $repoRoot 'actions' 'OpenSourceActions.psd1') -Force + } + + It 'validates action.yml exists [REQ-040]' -Tag 'REQ-040' { + $actionPath = Join-Path $repoRoot 'build-lvlibp-docker-windows' 'action.yml' + Test-Path $actionPath | Should -Be $true + } + + It 'validates implementation script exists [REQ-040]' -Tag 'REQ-040' { + $scriptPath = Join-Path $repoRoot 'scripts' 'build-lvlibp-docker-windows' 'BuildLvlibpDockerWindows.ps1' + Test-Path $scriptPath | Should -Be $true + } + + It 'validates inner build script exists [REQ-040]' -Tag 'REQ-040' { + $scriptPath = Join-Path $repoRoot 'scripts' 'build-lvlibp-docker-windows' 'build-lvlibp.ps1' + Test-Path $scriptPath | Should -Be $true + } + + It 'executes dry-run with only required parameters [REQ-040]' -Tag 'REQ-040' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'build-lvlibp-docker-windows' ` + -ArgsJson '{"MinimumSupportedLVVersion":"2026","SupportedBitness":"64","ProjectPath":"test.lvproj"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } + + It 'executes dry-run with all parameters [REQ-040]' -Tag 'REQ-040' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'build-lvlibp-docker-windows' ` + -ArgsJson '{"MinimumSupportedLVVersion":"2026","SupportedBitness":"64","ProjectPath":"test.lvproj","TargetName":"My Computer","BuildSpecName":"TestBuild","Major":1,"Minor":0,"Patch":0,"Build":0,"Commit":"abc1234","DockerImage":"nationalinstruments/labview","ImageTag":"2026q1-windows"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } +} \ No newline at end of file diff --git a/tests/pester/BuildLvlibpGithubHostedWindows.Workflow.Tests.ps1 b/tests/pester/BuildLvlibpGithubHostedWindows.Workflow.Tests.ps1 new file mode 100644 index 00000000..f39344d5 --- /dev/null +++ b/tests/pester/BuildLvlibpGithubHostedWindows.Workflow.Tests.ps1 @@ -0,0 +1,44 @@ +#requires -Version 7.0 +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +Describe 'BuildLvlibpGithubHostedWindows.Workflow' { + $meta = @{ + requirement = 'REQ-041' + Owner = 'NI' + Evidence = 'tests/pester/BuildLvlibpGithubHostedWindows.Workflow.Tests.ps1' + } + + BeforeAll { + $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..' '..')).Path + Import-Module (Join-Path $repoRoot 'actions' 'OpenSourceActions.psd1') -Force + } + + It 'validates action.yml exists [REQ-041]' -Tag 'REQ-041' { + $actionPath = Join-Path $repoRoot 'build-lvlibp-github-hosted-windows' 'action.yml' + Test-Path $actionPath | Should -Be $true + } + + It 'validates implementation script exists [REQ-041]' -Tag 'REQ-041' { + $scriptPath = Join-Path $repoRoot 'scripts' 'build-lvlibp-github-hosted-windows' 'BuildLvlibpGithubHostedWindows.ps1' + Test-Path $scriptPath | Should -Be $true + } + + It 'executes dry-run with only required parameters [REQ-041]' -Tag 'REQ-041' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'build-lvlibp-github-hosted-windows' ` + -ArgsJson '{"MinimumSupportedLVVersion":"2026","SupportedBitness":"64","ProjectPath":"test.lvproj"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } + + It 'executes dry-run with all parameters [REQ-041]' -Tag 'REQ-041' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'build-lvlibp-github-hosted-windows' ` + -ArgsJson '{"MinimumSupportedLVVersion":"2026","SupportedBitness":"64","ProjectPath":"test.lvproj","TargetName":"My Computer","BuildSpecName":"TestBuild","Major":1,"Minor":0,"Patch":0,"Build":0,"Commit":"abc1234"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } +} \ No newline at end of file diff --git a/tests/pester/Dispatcher.DryRun.Tests.ps1 b/tests/pester/Dispatcher.DryRun.Tests.ps1 index ac3f8a77..8b0db576 100644 --- a/tests/pester/Dispatcher.DryRun.Tests.ps1 +++ b/tests/pester/Dispatcher.DryRun.Tests.ps1 @@ -33,6 +33,7 @@ Describe 'Unified Dispatcher — DryRun behavior for all actions' { LVVersion = '2021' LVBitness = '64' ProjectFile = 'Project.lvproj' + ProjectPath = 'Project.lvproj' Major = 1 Minor = 0 Patch = 0