Run LabVIEWCLI operations (MassCompile, VI Analyzer, RunVI) in GitLab CI/CD pipelines using LabVIEW Docker containers for LabVIEW CICD automation.
This guide shows how to use the LabVIEW container images in GitLab CI/CD pipelines. The example YAML definitions mirror the GitHub Actions workflows shipped with this repository.
-
Copy the example pipeline file for your platform into the root of your GitLab repository and rename it to
.gitlab-ci.yml: -
Push the change — GitLab will pick up the pipeline automatically on the next merge request.
Tip: If you need both Linux and Windows jobs in a single pipeline, merge both YAML files into one
.gitlab-ci.yml.
See a live pipeline run here: Linux pipeline on GitLab
| Requirement | Details |
|---|---|
| GitLab Runner (Linux) | A runner with the Docker executor — the standard shared runners on GitLab.com work. |
| GitLab Runner (Windows) | A self-hosted runner on a Windows host with Docker configured for Windows containers. Tag it with windows and docker so the job can target it. |
| Docker Hub access | The examples pull from nationalinstruments/labview on Docker Hub. If your runner is behind a proxy or uses a mirror, adjust the LABVIEW_IMAGE variable. |
Each example pipeline runs on merge request events and performs two steps:
- MassCompile — compiles the LabVIEW
Arraysexamples that ship inside the container image. - CI integration script — mounts the repository into the container and runs the provided helper script (
run-vi-analyzer.shon Linux,run-vi-analyzer.ps1on Windows) which performs VI Analyzer on the Test-VIs bundled in this repo.
# .gitlab-ci.yml (Linux)
stages:
- test
run-labview-cli-linux:
stage: test
image: docker:24
services:
- docker:24-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
LABVIEW_IMAGE: "nationalinstruments/labview:2026q1-linux"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
before_script:
- docker pull "$LABVIEW_IMAGE"
script:
- >
docker run --rm "$LABVIEW_IMAGE"
bash -c "LabVIEWCLI -OperationName MassCompile
-DirectoryToCompile /usr/local/natinst/LabVIEW-2026-64/examples/Arrays
-LabVIEWPath /usr/local/natinst/LabVIEW-2026-64/labview -Headless"
- >
docker run --rm -v "$CI_PROJECT_DIR:/workspace" "$LABVIEW_IMAGE"
bash -c "cd /workspace/examples/cicd-examples/helper-scripts/run-vi-analyzer && chmod +x run-vi-analyzer.sh && ./run-vi-analyzer.sh"# .gitlab-ci.yml (Windows)
stages:
- test
run-labview-cli-windows:
stage: test
tags:
- windows
- docker
variables:
LABVIEW_IMAGE: "nationalinstruments/labview:2026q1-windows"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
before_script:
- docker pull "$LABVIEW_IMAGE"
script:
- >
docker run --rm "$LABVIEW_IMAGE"
LabVIEWCLI -OperationName MassCompile
-DirectoryToCompile "C:\Program Files\National Instruments\LabVIEW 2026\examples\Arrays" -Headless
- >
docker run --rm -v "${CI_PROJECT_DIR}:C:\workspace" "$LABVIEW_IMAGE"
powershell -File "C:\workspace\examples\cicd-examples\helper-scripts\run-vi-analyzer\run-vi-analyzer.ps1" -WorkspaceRoot "C:\workspace"| Concept | GitHub Actions | GitLab CI/CD |
|---|---|---|
| Trigger | on: pull_request |
rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' |
| Checkout | actions/checkout@v3 |
Automatic — GitLab clones the repo before before_script |
| Workspace path | ${{ github.workspace }} |
$CI_PROJECT_DIR |
| Runner selection | runs-on: ubuntu-latest / windows-latest |
image: docker:24 (Linux) or tags: [windows, docker] (Windows) |
| Docker-in-Docker | Built-in on GitHub-hosted runners | Requires services: [docker:24-dind] on Linux |
- Change the LabVIEW version — edit the
LABVIEW_IMAGEvariable. - Add more LabVIEWCLI operations — append additional
docker runcommands in thescriptsection. - Use a private registry — replace
nationalinstruments/labviewwith your registry URL and add credentials via GitLab CI/CD variables (Settings > CI/CD > Variables). - Artifacts — to save reports (e.g., VI Analyzer results), add an
artifactsblock pointing to the mounted output path.