This document explains how to automate build, test, and distribution steps for the Icon Editor using GitHub Actions. It includes features such as automatic version bumping (using labels) and artifact upload. Additionally, it shows how you can brand the resulting VI Package with organization and repository metadata for unique identification.
Automating your Icon Editor builds and tests:
- Provides consistent steps for every commit or pull request
- Minimizes manual toggling of LabVIEW environment settings
- Stores build artifacts (VI Packages) in GitHub for easy download
- Automatically versions releases using semantic version logic
- Allows you to brand each VI Package build with your organization or repository name for unique identification
Prerequisites:
- LabVIEW 2021 SP1 (32-bit and 64-bit) and LabVIEW 2023 (64-bit)
- PowerShell 7+
- Git for Windows
-
Install PowerShell and Git
Ensure your environment has the required tools before setting up the workflows. -
Configure a Self-Hosted Runner
Under Settings → Actions → Runners in your GitHub repo or organization, add a runner with LabVIEW installed. -
Enable or Disable Development Mode You can toggle Development Mode either via the “Development Mode Toggle” workflow or manually.
- Development Mode modifies
labview.inito reference your local source code.
- Development Mode modifies
-
Run Tests Use the main CI workflow (
ci-composite.yml) to confirm your environment is valid.- The workflow triggers on pushes to or pull requests targeting:
maindevelop- release branches:
release-alpha/*,release-beta/*,release-rc/* - feature branches:
feature/* - hotfix branches:
hotfix/* - issue branches:
issue-* workflow_dispatchenables manual runs.- Every run—push, pull request, or manual—requires the source branch name to match
issue-<number>and the linked issue's Status to be In Progress; otherwise, downstream jobs are skipped. - Typically run with Dev Mode disabled unless you’re testing dev features specifically.
- The
issue-statusjob enforces these checks and also skips the workflow if the branch or pull request has aNoCIlabel. Contributors must ensure their issue is added to a project with the required Status. For pull requests, the check inspects the head branch. This gating helps avoid ambiguous runs for automated tools. - A concurrency group cancels any previous run on the same branch, ensuring only the latest pipeline execution continues.
- The workflow triggers on pushes to or pull requests targeting:
-
Build VI Package
- Produces
.vipartifacts automatically. By default, the workflow populates the “Company Name” withgithub.repository_ownerand the “Author Name” withgithub.event.repository.name, so each build is branded with your GitHub account and repository. - To use different branding, edit the “Generate display information JSON” step in
.github/workflows/ci-composite.ymland supply custom values for these fields. - Uses label-based version bumping (major/minor/patch) on pull requests.
- Generates
Tooling/deployment/release_notes.mdsummarizing recent commits. Use this file to draft changelogs or release notes.
- Produces
-
Disable Dev Mode (optional)
Reverts your environment to normal LabVIEW settings, removing local overrides.
Note
The workflow automatically brands the VI Package using the repository owner (github.repository_owner) and repository name (github.event.repository.name). Modify the “Generate display information JSON” step in .github/workflows/ci-composite.yml if you need different values.
-
Development Mode:
A specialized configuration where LabVIEW references local paths for the Icon Editor code. Useful for debugging or certain dev features.- Enable via
Set_Development_Mode.ps1or the Development Mode Toggle workflow.
- Enable via
-
Testing / Distributable Builds:
Typically done in normal LabVIEW mode. If you forget to disable Dev Mode, tests or builds might rely on your local dev environment in unexpected ways.
Below are the key GitHub Actions provided in this repository:
-
- Invokes
Set_Development_Mode.ps1orRevertDevelopmentMode.ps1. - Usually triggered via
workflow_dispatchfor manual toggling.
- Invokes
-
- Automatically versions your code based on PR labels (
major,minor,patch). Direct pushes retain the previous version and increment only the build number. - Uses a build counter to ensure each artifact is uniquely numbered (e.g.,
v1.2.3-build4). - Fork-Friendly: Runs in forks without requiring extra signing keys.
- Produces the
.vipfile via a PowerShell script (e.g.,Build.ps1). - By default, “Company Name” and “Author Name” in the generated
.vipcome fromgithub.repository_ownerandgithub.event.repository.name. Update the “Generate display information JSON” step inci-composite.ymlif you need custom values. - Uploads the
.vipartifact to GitHub’s build artifacts.
- Automatically versions your code based on PR labels (
The ci-composite.yml pipeline breaks the build into several jobs:
- issue-status – skips the workflow if the pull request or branch has a
NoCIlabel, then queries the Status field of the linked GitHub issue’s associated GitHub Project and proceeds only when that field is In Progress. Contributors must ensure their issue is added to a project with this Status value. It also requires the source branch name to containissue-<number>(such asissue-123orfeature/issue-123). For pull requests, the job evaluates the PR’s head branch. - changes – checks out the repository and detects
.vipcfile changes to determine if dependencies need to be applied. - apply-deps – installs VIPC dependencies for multiple LabVIEW versions and bitnesses only when the
changesjob reports.vipcmodifications (if: needs.changes.outputs.vipc == 'true'). - version – computes the semantic version and build number using commit count and PR labels.
- missing-in-project-check – verifies every source file is referenced in the
.lvproj. - test – runs LabVIEW unit tests on Windows in LabVIEW 2021 (32- and 64-bit).
- build-ppl – uses a matrix to build 32-bit and 64-bit packed libraries, then uses the
rename-fileaction to append the bitness to each library’s filename. - build-vi-package – packages the final VI Package using the built libraries and version information. In
ci-composite.ymlthis job passessupported_bitness: 64, so it produces only a 64-bit.vip.
Both build-ppl and build-vi-package run a close-labview step after their build actions finish but before any steps that rename files or upload artifacts, so it isn't the job's final step.
The build-ppl job uses a matrix to produce both bitnesses rather than distinct jobs.
(The Run Unit Tests workflow has been consolidated into the main CI process.)
-
Install Prerequisites:
- LabVIEW 2021 SP1 (32-bit and 64-bit) and LabVIEW 2023 (64-bit)
- PowerShell 7+
- Git for Windows
-
Add Self-Hosted Runner:
Go to Settings → Actions → Runners in your GitHub repository (or organization) and follow the steps to register a runner on your machine that has LabVIEW installed. -
Label the Runner:
- Canonical label:
self-hosted-windows-lvmust always be present. - The workflows use
LVIE_RUNNER_LABEL(repo variable) and fall back toself-hosted-windows-lv. - For forks, set Settings → Actions → Variables →
LVIE_RUNNER_LABELto match your runner label. - If
LVIE_RUNNER_LABELis set to a fork-specific label, keepself-hosted-windows-lvon the same runner. - Example label set:
self-hosted-windows-lv,self-hosted-windows-lv-ie.
- Canonical label:
-
Runner Contract (recommended):
- Run
Tooling/Setup-Runner.ps1to create a runner contract and standardize work roots. - The contract is written under the runner root and used by
Tooling/Check-Runner.ps1. - The template is
Tooling/runner-contract.template.json. - CI validates the runner labels using
Tooling/Assert-RunnerLabel.ps1at job start.
- Run
-
Git safe.directory:
Tooling/Setup-Runner.ps1configures a scoped safe.directory for the work root.- This prevents Git “dubious ownership” errors when the runner service account differs from the checkout owner.
Although GitHub Actions primarily run on GitHub-hosted or self-hosted agents, you can replicate the general process locally:
-
Enable Development Mode (if necessary to do dev tasks):
- Run the “Development Mode Toggle” workflow with
enableor manually callSet_Development_Mode.ps1.
- Run the “Development Mode Toggle” workflow with
-
Run Tests:
- Confirm everything passes in your local environment or via the main CI workflow.
- If you have custom or dev references, ensure Dev Mode is toggled appropriately.
-
Build VI Package:
- Manually invoke
Build.ps1from.github/actions/buildto generate a.vip. - Pass optional metadata fields (e.g.,
-CompanyName,-AuthorName) if you want your build to be branded. - On GitHub Actions, the workflow will produce and upload the artifact automatically.
- Manually invoke
-
Disable Dev Mode:
- Revert to a normal LabVIEW environment so standard usage or testing can resume.
Scenario: You want to implement a new feature, test it, and produce a uniquely branded .vip.
-
Enable Development Mode:
- Either via the Development Mode Toggle workflow or by running
Set_Development_Mode.ps1.
- Either via the Development Mode Toggle workflow or by running
-
Implement and Test:
- Use the main CI workflow (or a local script) to verify your changes pass.
- Keep Dev Mode enabled if needed for debugging; disable it if you want a “clean” environment.
-
Open a Pull Request and Label it:
- Assign
major,minor, orpatchto control the version bump. - The CI validates your code without creating tags or releases.
- Assign
-
Merge the PR into
develop(ormain):- The Build VI Package workflow builds and uploads the
.vipartifact. - Inside that
.vip, the “Company Name” and “Author Name (Person or Company)” fields are filled automatically usinggithub.repository_ownerandgithub.event.repository.name. Modify the “Generate display information JSON” step in.github/workflows/ci-composite.ymlto override them.
- The Build VI Package workflow builds and uploads the
-
Disable Development Mode:
- Switch LabVIEW back to normal mode.
- Optionally install the resulting
.vipto confirm your new feature in a production-like environment.
- Artifact Storage: The
.vipfile is accessible under the Actions run summary (click “Artifacts”). - Version Enforcement: Pull requests without a version label default to
patch; you can enforce labeling with an optional “Label Enforcer” step if desired. - Branding: To highlight the organization or repository behind a particular build, simply pass
-CompanyNameand-AuthorName(or similar parameters) into theBuild.ps1script. This metadata flows into the final Display Information of the Icon Editor’s VI Package.
What is portable
- Any Windows self-hosted runner with LabVIEW 2021 (21.0), PowerShell 7+, and Git installed.
- Forks or orgs that keep the canonical runner label
self-hosted-windows-lv. - Environments where the GitHub Actions API is restricted (runner contract fallback is local).
What is not portable
- Non-Windows runners (LabVIEW + g-cli requires Windows).
- Hosts without LabVIEW 2021 installed for both 32-bit and 64-bit.
Operational caveats
- Service restart requires admin rights on the host machine.
- If runner paths differ, use
Tooling/Setup-Runner.ps1to generate the contract and set paths.
By adopting these workflows—Development Mode Toggle and Build VI Package—you can maintain a streamlined, consistent CI/CD process for the Icon Editor while customizing the VI Package with your own unique or fork-specific branding.