This document explains how to locally set up and run the LabVIEW Icon Editor workflows on a self-hosted runner using GitHub Actions.
This document details how to automate building, testing, and packaging the LabVIEW Icon Editor on Windows using GitHub Actions on a self-hosted runner. By employing these workflows, you can:
- Eliminate manual tasks like editing
vi.libor togglinglabview.ini. - Run consistent builds and tests across different machines or developers.
- Automatically version your Icon Editor code via semantic labeling (major/minor/patch) plus a global build counter.
- Upload the
.vipartifact for download; the workflow does not create tags or GitHub releases.
Additionally, you can pass metadata fields (like organization or repository name) to the build script. These fields are embedded into the VI Package display information, effectively branding the Icon Editor package with a unique identifier. This is especially useful when multiple forks or organizations produce their own versions of the Icon Editor—ensuring each .vip is clearly labeled with the correct “author” or “company.”
Prerequisites:
- LabVIEW 2021 (21.0), 32-bit and 64-bit.
- The relevant VIPC file is now at
.github/actions/apply-vipc/runner_dependencies.vipc.- PowerShell 7+
- Git for Windows
For experienced users, a brief overview:
-
Install Required Software
- Ensure LabVIEW 2021 (21.0) 32-bit and 64-bit are installed.
- PowerShell 7+
- Git for Windows
-
Apply the VIPC
- Apply
.github/actions/apply-vipc/runner_dependencies.vipcwith VIPM in LabVIEW 2021 (21.0) 32-bit; repeat for LabVIEW 2021 (21.0) 64-bit. - This is required on new runners because the workflow's
apply-depsjob in.github/workflows/ci-composite.ymlruns only when.vipcfiles change (if: needs.changes.outputs.vipc == 'true'). When no.vipcupdates exist, dependencies aren't installed automatically, so apply the VIPC manually.
-
Configure a Self-Hosted Runner
- Go to Settings → Actions → Runners in your (forked) repo.
- Follow GitHub’s steps to add a Windows runner.
-
Development Mode Toggle
- (Optional) Toggle LabVIEW dev mode (
Set_Development_Mode.ps1orRevertDevelopmentMode.ps1) via the Development Mode Toggle workflow.
- (Optional) Toggle LabVIEW dev mode (
-
Run Tests
- Run the tests using the CI Pipeline (Composite) workflow; its dedicated test job executes the unit tests.
-
Build VI Package
- Invoke the Build VI Package job within the CI Pipeline (Composite) workflow to produce a
.vipusing the version computed by the workflow's separate version job (see that job's output for the generated version). Publishing tags or GitHub releases requires a separate workflow. - You can also pass in org/repository info (e.g.,
-CompanyName "MyOrg"or-AuthorName "myorg/myrepo") to brand the resulting package with your unique identifiers.
- Invoke the Build VI Package job within the CI Pipeline (Composite) workflow to produce a
-
Disable Dev Mode (Optional)
- Revert environment once building/testing is done.
Development Mode
- Temporarily reconfigures
labview.iniandvi.libso LabVIEW loads your Icon Editor source directly, renaminglv_icon.lvlibptolv_icon.shipand packaging the LabVIEW Icon API. - Enable/disable via the Development Mode Toggle workflow.
Testing / Distributable Builds
- Usually done in a normal LabVIEW environment (Dev Mode disabled).
- Ensures that the
.vipartifact or tests reflect a standard environment.
-
Development Mode Toggle
mode: enable→ callsSet_Development_Mode.ps1.mode: disable→ callsRevertDevelopmentMode.ps1.labview_version(default2021, only2021is supported).- Great for reconfiguring LabVIEW for local dev vs. distribution builds.
-
CI Pipeline (Composite)
- Includes a test job for unit tests, a version job that computes semantic versioning, and a build-vi-package job that packages the
.vipusing the version job's outputs. - Label-based semantic versioning (
major,minor,patch). Defaults topatchif no label. - Derives build number from total commit count (
git rev-list --count HEAD). - Fork-friendly: runs on forks without requiring signing keys.
- Publishes
.vipas an artifact; creating Git tags or GitHub releases requires a separate workflow. - Branding the Package:
- You can pass metadata parameters like
-CompanyNameand-AuthorNameinto the build script. These map to fields in the VI Package (e.g., “Company Name,” “Author Name (Person or Company)”). - This means each package can show the organization and repository that produced it, providing a unique ID if you have multiple forks or parallel versions.
- You can pass metadata parameters like
- Includes a test job for unit tests, a version job that computes semantic versioning, and a build-vi-package job that packages the
Steps:
-
Install LabVIEW 2021 (21.0), 32-bit and 64-bit
- Confirm both are present on your Windows machine.
- Apply
.github/actions/apply-vipc/runner_dependencies.vipcto each if needed. - Version contract: CI treats
.lvversionas the single source of truth. The runner sanity step validates that the installed LabVIEW version matches.lvversionand fails fast if it does not. - Registry probe logic (Windows): the runner sanity check looks for installs in:
C:\Program Files\National Instruments\LabVIEW <Year>(64-bit)C:\Program Files (x86)\National Instruments\LabVIEW <Year>(32-bit)- Registry keys:
HKLM:\SOFTWARE\National Instruments\LabVIEW <Year>HKLM:\SOFTWARE\WOW6432Node\National Instruments\LabVIEW <Year>
- It checks
Path,InstallDir, orInstallPathvalues for a valid install root.
- If you install to a custom path, ensure the registry keys above are present so the runner can locate LabVIEW.
- Runner ACL preflight (no-LabVIEW dev mode):
- When
LVIE_FORCE_NO_LABVIEW_DEVMODE=1is set, runner sanity also checks write access to:vi.libvi.lib\LabVIEW Icon API(if present)resource\pluginsLabVIEW.ini
- If the runner service account cannot write to these paths, dev-mode enable/revert will fail on that bitness.
- You can override the check with
LVIE_RUNNER_ACL_CHECK=0(not recommended). - You can enable auto-fix with
LVIE_RUNNER_ACL_AUTOFIX=1to grant Modify permissions to the current runner identity. - Auto-fix requires elevated rights on the runner machine; otherwise pre-grant access manually (for example with
icacls).
- When
-
Install PowerShell 7+ and Git
- Reboot if newly installed so environment variables are recognized.
-
Add a Self-Hosted Runner
- Settings → Actions → Runners → New self-hosted runner
- Follow GitHub’s CLI instructions.
-
Labels (optional)
- The workflow uses the
self-hosted-windows-lvlabel by default (orLVIE_RUNNER_LABELif set). Itsruns-onexpression also referencesself-hosted-linux-lvfor potential Linux jobs, though the default matrix runs only on Windows. Label your runner accordingly, and prepare a Linux runner withself-hosted-linux-lvif you expand the matrix.
- The workflow uses the
-
Runner diagnostics cleanup (recommended)
- Some runner failures can occur before checkout if old diagnostics logs accumulate under the runner's
_diag\pagesfolder. - Use the job-started hook to clean that folder before each job.
- Copy the scripts from the repo to the runner:
.github\scripts\cleanup-runner-diag-pages.ps1.github\scripts\runner-job-started-clean-diag.ps1
- Place them under
<runner-root>\scripts\and set the hook in<runner-root>\.env:ACTIONS_RUNNER_HOOK_JOB_STARTED=C:\path\to\runner\scripts\runner-job-started-clean-diag.ps1
- Restart the runner service after updating
.env. - Optional: set
RUNNER_DIAG_RETENTION_DAYS=7in.envif you want to keep recent logs. - The cleanup skips any diagnostics file that is still in use, so the job does not fail.
- Some runner failures can occur before checkout if old diagnostics logs accumulate under the runner's
-
Standardize worktree root under the runner directory (recommended)
- Use a short path under the runner root to avoid Windows path-length issues.
- Recommended path:
<runner-root>\_work\lvie\w(for exampleC:\actions-runner\_work\lvie\w). - Runner contract helper (run from repo root):
pwsh -NoProfile -File .\Tooling\Setup-Runner.ps1 -RunnerRoot C:\actions-runner -Scope Machine
- This writes
<runner-root>\_work\lvie\runner-contract.jsonand setsLVIE_WORKTREE_ROOT,LVIE_ARTIFACT_ROOT,LVIE_LOCK_ROOT, andLVIE_LOG_ROOT. - Restart the runner service after setting Machine/User environment variables.
-
Stateless runner bootstrap (no service restart)
- Workflows call the
runner-bootstrapaction, which runsTooling/Initialize-Runner.ps1at job start to refresh the runner contract and exportLVIE_*variables into the job environment. - This avoids relying on Machine/User environment variables and does not require restarting the runner service.
- Workflows call the
With your runner online:
-
Enable Dev Mode (if needed)
- Actions → Development Mode Toggle, set
mode: enable. labview_versionis fixed to2021if provided.
- Actions → Development Mode Toggle, set
-
Run Tests via CI Pipeline (Composite)
- Execute the workflow and review the test job logs to confirm all unit tests pass.
-
Build VI Package
- Produces
.vipusing the version computed in the version job (review that job's output for version details). The workflow only uploads the artifact; creating tags or GitHub releases requires additional steps. - Pass your org/repo info (e.g.
-CompanyName "AcmeCorp"/-AuthorName "AcmeCorp/IconEditor") to embed in the final package. - Artifacts appear in the run summary under Artifacts.
- Produces
-
Disable Dev Mode (if used)
mode: disablereverts your LabVIEW environment.- Keep
labview_versionset to2021if you include it.
-
Review the
.vip- Download from Artifacts. Publishing to a GitHub release requires a separate workflow.
CI jobs run from short-path worktrees to avoid Windows path limits. Each job creates:
ci-<jobhash>-<bitness>-<runid>-<attempt>jobhash= first 8 chars of SHA1(GITHUB_JOB) to keep job names unique.- Some workflows insert an extra variant token (e.g. LabVIEW version) between
<jobhash>and<bitness>. - Example:
C:\dev\ci-D170BDEE-64-21534416929-1
The workflow exports:
REPO_ROOT→ worktree path (authoritative for scripts)PROJECT_PATH→$REPO_ROOT\lv_icon_editor.lvprojLABVIEW_VERSION_YEAR/LABVIEW_MINOR_REVISION→ derived from.lvversion(e.g.,21.0→2021and minor0)
CI treats .lvversion in REPO_ROOT as the canonical LabVIEW version for the run.
If you need deterministic runs for a specific commit, use the helper script:
pwsh -NoProfile -File .\Tooling\Run-CICompositeForCommit.ps1 -Sha <commit>
Notes:
- The script creates a temporary
ci-run/<shortsha>branch and dispatches the workflow on it. - Use
-CleanupRemoteto delete the temporary branch after dispatch.
- Enable Development Mode: if you plan to actively modify the Icon Editor code inside LabVIEW.
- Code & Test: Make changes, run the CI Pipeline (Composite) workflow (its test job runs unit tests) to confirm stability.
- Open a Pull Request:
- Assign a version bump label if you want
major,minor, orpatch. - The workflow checks this label upon merging.
- Assign a version bump label if you want
- Merge:
- The CI Pipeline (Composite) workflow triggers, with the version job computing the version and the Build VI Package job using that version to package and upload the
.vip. - Metadata (such as company/repo) is already integrated into the final
.vip, so each build is easily identified.
- The CI Pipeline (Composite) workflow triggers, with the version job computing the version and the Build VI Package job using that version to package and upload the
- Disable Dev Mode: Return to a normal LabVIEW environment.
- Install & Verify: Download the
.vipartifact for final validations.
- Check the Main Repo’s README.md: for environment disclaimers, additional tips, or project-specific instructions.
- Extend the Workflows: You can add custom steps for linting, coverage, or multi-version LabVIEW tests.
- Submit Pull Requests: If you refine scripts or fix issues, open a PR with logs showing your updated workflow runs.
- Troubleshoot: If manual environment edits are needed, consult
ManualSetup.mdor the original documentation for advanced configuration steps.
Happy Building! By integrating these workflows, you’ll maintain a robust, automated CI/CD pipeline for the LabVIEW Icon Editor—complete with semantic versioning, build artifact uploads, and metadata branding (company/repo).