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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/reusable-vipm-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Reusable - Refresh VIPM Lock

on:
workflow_call:
inputs:
working_directory:
description: 'Path (relative to the caller repo root) containing vipm.toml.'
required: true
type: string
labview_version:
description: 'LabVIEW version (YYYY) matching the [project] section of vipm.toml.'
required: true
type: string
labview_bitness:
description: '"32" or "64" bitness matching the [project] section of vipm.toml.'
required: true
type: string
check_only:
description: 'If true, verifies an existing vipm.lock or generates the initial lock when absent.'
required: false
type: boolean
default: false
base_branch:
description: 'Target branch for the generated pull request.'
required: true
type: string
pr_branch:
description: 'Branch name to push vipm.lock updates to.'
required: false
type: string
default: 'automation/vipm-lock-refresh'
pr_labels:
description: 'Comma-separated labels to apply to the generated PR.'
required: false
type: string
default: 'dependencies'
secrets:
VIPM_SERIAL_NUMBER:
required: false
VIPM_FULL_NAME:
required: false
VIPM_EMAIL:
required: false

jobs:
refresh-vipm-lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- uses: ni/open-source/refresh-vipm-lock@users/amrutha/vipm-lock-refresh-and-dependency-update
with:
working_directory: ${{ inputs.working_directory }}
labview_version: ${{ inputs.labview_version }}
labview_bitness: ${{ inputs.labview_bitness }}
check_only: ${{ inputs.check_only }}
vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }}
vipm_full_name: ${{ secrets.VIPM_FULL_NAME }}
vipm_email: ${{ secrets.VIPM_EMAIL }}
- name: Upload vipm.lock artifact
if: ${{ inputs.check_only }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: vipm-lock
path: ${{ inputs.working_directory }}/vipm.lock
if-no-files-found: error
- uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1
if: ${{ !inputs.check_only }}
with:
commit-message: 'chore(deps): refresh vipm.lock'
title: 'chore(deps): refresh vipm.lock'
body: |
Automated `vipm.lock` refresh generated by `ni/open-source`'s reusable
`reusable-vipm-lock.yml` workflow.

Review the `vipm.lock` diff before merging.
base: ${{ inputs.base_branch }}
branch: ${{ inputs.pr_branch }}
add-paths: ${{ inputs.working_directory }}/vipm.lock
labels: ${{ inputs.pr_labels }}
100 changes: 100 additions & 0 deletions .github/workflows/reusable-vipm-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Reusable - Update VIPM Dependencies

on:
workflow_call:
inputs:
working_directory:
description: 'Path (relative to the caller repo root) containing vipm.toml.'
required: true
type: string
labview_version:
description: 'LabVIEW version (YYYY) matching the [project] section of vipm.toml.'
required: true
type: string
labview_bitness:
description: '"32" or "64" bitness matching the [project] section of vipm.toml.'
required: true
type: string
base_branch:
description: 'Target branch for the generated pull request in the caller repository.'
required: true
type: string
pr_branch:
description: 'Branch name to push dependency updates to.'
required: false
type: string
default: 'automation/vipm-dependency-update'
pr_labels:
description: 'Comma-separated labels to apply to the generated PR.'
required: false
type: string
default: 'dependencies'
secrets:
VIPM_SERIAL_NUMBER:
required: false
VIPM_FULL_NAME:
required: false
VIPM_EMAIL:
required: false

workflow_dispatch:
inputs:
working_directory:
description: 'Path (relative to this repository root) containing vipm.toml.'
required: true
type: string
labview_version:
description: 'LabVIEW version (YYYY).'
required: true
type: string
labview_bitness:
description: '"32" or "64" bitness.'
required: true
type: string
base_branch:
description: "Optional target branch; defaults to this repository's default branch."
required: false
type: string
pr_branch:
description: 'Branch name to push dependency updates to.'
required: false
type: string
default: 'automation/vipm-dependency-update'
pr_labels:
description: 'Comma-separated labels to apply to the generated PR.'
required: false
type: string
default: 'dependencies'

permissions:
contents: write
pull-requests: write

jobs:
update-vipm-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- uses: ni/open-source/update-vipm-dependencies@users/amrutha/vipm-lock-refresh-and-dependency-update
with:
working_directory: ${{ inputs.working_directory }}
labview_version: ${{ inputs.labview_version }}
labview_bitness: ${{ inputs.labview_bitness }}
vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }}
vipm_full_name: ${{ secrets.VIPM_FULL_NAME }}
vipm_email: ${{ secrets.VIPM_EMAIL }}
- uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1
with:
commit-message: 'chore(deps): update VIPM package dependencies'
title: 'chore(deps): update VIPM package dependencies'
body: |
Automated dependency update generated by `ni/open-source`'s reusable
`reusable-vipm-update.yml` workflow.

Review the `vipm.toml` / `vipm.lock` diff before merging.
base: ${{ inputs.base_branch || github.event.repository.default_branch }}
branch: ${{ inputs.pr_branch }}
add-paths: |
${{ inputs.working_directory }}/vipm.toml
${{ inputs.working_directory }}/vipm.lock
labels: ${{ inputs.pr_labels }}
5 changes: 4 additions & 1 deletion actions/OpenSourceActions.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'OpenSourceActions.psm1'
ModuleVersion = '1.0.0'
ModuleVersion = '1.1.1'
GUID = '8c0a64c5-6a52-4d7e-9f74-8f79f21f1b2c'
Author = 'LabVIEW Community CI/CD'
CompanyName = 'LabVIEW Community'
Expand All @@ -25,6 +25,7 @@
'Invoke-MissingInProject'
'Invoke-ModifyVIPBDisplayInfo'
'Invoke-PrepareLabVIEWSource'
'Invoke-RefreshVipmLock'
'Invoke-RenameFile'
'Invoke-RestoreSetupLVSource'
'Invoke-RevertDevelopmentMode'
Expand All @@ -34,13 +35,15 @@
'Invoke-SetupLabview'
'Invoke-SetupLunit'
'Invoke-SetupNipm'
'Invoke-UpdateVipmDependencies'
'Invoke-ViaLvDocker'
)

PrivateData = @{
PSData = @{
ReleaseNotes = @(
'1.0.0 - Initial release: adapters for apply-vipc, build-lvlibp, missing-in-project, run-unit-tests; Format-UnitTestReport helper; discovery flags; DryRun; cross-platform g-cli support.'
'1.1.1 - Fix: update-vipm-dependencies now fails the job (instead of warning and continuing) when any package cannot be resolved/updated, so a partial dependency bump never reaches vipm.lock or a PR.'
)
}
}
Expand Down
111 changes: 111 additions & 0 deletions actions/OpenSourceActions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,117 @@ function Invoke-SetupNipm {
return $result
}

# Generates or checks vipm.lock from vipm.toml using the VIPM CLI in a Linux Docker container.
# WorkingDirectory: Path (relative to the repo root) containing vipm.toml.
# LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml.
# LabVIEWBitness: "32" or "64" bitness matching the [project] section of vipm.toml.
# CheckOnly: If set, checks an existing vipm.lock or generates the initial lock when absent.
# VipmSerialNumber: VIPM Pro serial number (omit to skip activation).
# VipmFullName: Name used for VIPM Pro activation.
# VipmEmail: Email used for VIPM Pro activation.
# VipmDebUrl: URL for the VIPM Linux .deb package.
# DockerImage: Docker image name (default: "nationalinstruments/labview").
# ImageTag: Docker image tag (default: "latest-linux").
# DryRun: If set, prints the command instead of executing it.
function Invoke-RefreshVipmLock {
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string] $WorkingDirectory,
[string] $LabVIEWVersion,
[string] $LabVIEWBitness,
[switch] $CheckOnly,
[Parameter()] [string] $VipmSerialNumber = "",
[Parameter()] [string] $VipmFullName = "",
[Parameter()] [string] $VipmEmail = "",
[Parameter()] [string] $VipmDebUrl = "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb",
[Parameter()] [string] $DockerImage = "nationalinstruments/labview",
[Parameter()] [string] $ImageTag = "latest-linux",
[switch] $DryRun
)
Write-Information "Invoking RefreshVipmLock" -InformationAction Continue

if (-not $DryRun) {
if ([string]::IsNullOrWhiteSpace($LabVIEWVersion) -or [string]::IsNullOrWhiteSpace($LabVIEWBitness)) {
throw 'LabVIEWVersion and LabVIEWBitness are required unless -DryRun is specified.'
}
if ($LabVIEWBitness -notin @('32', '64')) {
throw "Unsupported LabVIEW bitness: $LabVIEWBitness"
}
}

$result = Invoke-OpenSourceActionScript `
-ScriptSegments @('refresh-vipm-lock', 'RefreshVipmLock.ps1') `
-Arguments @{
WorkingDirectory = $WorkingDirectory
LabVIEWVersion = $LabVIEWVersion
LabVIEWBitness = $LabVIEWBitness
CheckOnly = $CheckOnly
VipmSerialNumber = $VipmSerialNumber
VipmFullName = $VipmFullName
VipmEmail = $VipmEmail
VipmDebUrl = $VipmDebUrl
DockerImage = $DockerImage
ImageTag = $ImageTag
} `
-DryRun:$DryRun

return $result
}

# Bumps every dependency in vipm.toml to its latest available version and regenerates vipm.lock.
# WorkingDirectory: Path (relative to the repo root) containing vipm.toml.
# LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml.
# LabVIEWBitness: "32" or "64" bitness matching the [project] section of vipm.toml.
# VipmSerialNumber: VIPM Pro serial number (`vipm add` requires Community or Professional edition).
# VipmFullName: Name used for VIPM Pro activation.
# VipmEmail: Email used for VIPM Pro activation.
# VipmDebUrl: URL for the VIPM Linux .deb package.
# DockerImage: Docker image name (default: "nationalinstruments/labview").
# ImageTag: Docker image tag (default: "latest-linux").
# DryRun: If set, prints the command instead of executing it.
function Invoke-UpdateVipmDependencies {
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string] $WorkingDirectory,
[string] $LabVIEWVersion,
[string] $LabVIEWBitness,
[Parameter()] [string] $VipmSerialNumber = "",
[Parameter()] [string] $VipmFullName = "",
[Parameter()] [string] $VipmEmail = "",
[Parameter()] [string] $VipmDebUrl = "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb",
[Parameter()] [string] $DockerImage = "nationalinstruments/labview",
[Parameter()] [string] $ImageTag = "latest-linux",
[switch] $DryRun
)
Write-Information "Invoking UpdateVipmDependencies" -InformationAction Continue

if (-not $DryRun) {
if ([string]::IsNullOrWhiteSpace($LabVIEWVersion) -or [string]::IsNullOrWhiteSpace($LabVIEWBitness)) {
throw 'LabVIEWVersion and LabVIEWBitness are required unless -DryRun is specified.'
}
if ($LabVIEWBitness -notin @('32', '64')) {
throw "Unsupported LabVIEW bitness: $LabVIEWBitness"
}
}

$result = Invoke-OpenSourceActionScript `
-ScriptSegments @('update-vipm-dependencies', 'UpdateVipmDependencies.ps1') `
-Arguments @{
WorkingDirectory = $WorkingDirectory
LabVIEWVersion = $LabVIEWVersion
LabVIEWBitness = $LabVIEWBitness
VipmSerialNumber = $VipmSerialNumber
VipmFullName = $VipmFullName
VipmEmail = $VipmEmail
VipmDebUrl = $VipmDebUrl
DockerImage = $DockerImage
ImageTag = $ImageTag
} `
-DryRun:$DryRun

return $result
}

# Runs VI Analyzer tests using LabVIEW Docker container.
# ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files.
# TemplatePath: Path to .viancfg template (required when generating config dynamically).
Expand Down
Loading
Loading