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
12 changes: 6 additions & 6 deletions .github/workflows/vi-analyzer-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
uses: actions/checkout@v3

# Authenticate to Docker Hub
- name: Log in to Docker Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKER_UNAME }}
password: ${{ secrets.DOCKER_PASSWD }}
registry: ghcr.io
username: ${{ secrets.GHCR_UNAME }}
password: ${{ secrets.GHCR_PAT }}

- name: Pull Docker Image from Docker Hub
run: docker pull docker.io/shivacode02/labview_linux:2025q3_beta
run: docker pull ghcr.io/shivacode-2/labview:2025q3-linux-beta

- name: Run LabVIEWCLI Operations
run: |
docker run --rm \
-v "${{ github.workspace }}:/workspace" \
docker.io/shivacode02/labview_linux:2025q3_beta \
ghcr.io/shivacode-2/labview:2025q3-linux-beta \
bash -c "cd /workspace && chmod +x runlabview.sh && ./runlabview.sh"

39 changes: 23 additions & 16 deletions runlabview.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
#!/bin/bash
# Verify that the configuration file exists.
CONFIG_FILE='/workspace/Test-VIs/viaPassCase.viancfg'
LABVIEW_PATH='/usr/local/natinst/LabVIEW-2025-64/labviewprofull'
REPORT_PATH='/usr/local/natinst/ContainerExamples/Results.txt'
MASSCOMPILE_DIR='/usr/local/natinst/LabVIEW-2025-64/examples/Arrays'
MASSCOMPILE_DIR='/workspace/Test-VIs'

# Verify that the configuration file exists.
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: Configuration file not found at $CONFIG_FILE, exiting...!"
exit 1
fi
echo "────────────────────────────────────────────────────────────"
echo "(Debug) Running LabVIEWCLI MassCompile with following parameters:"
echo "(Debug) DirectorytoCompile: $MASSCOMPILE_DIR"
echo "(Debug) LabVIEWPath: $LABVIEW_PATH"


echo "Running LabVIEWCLI MassCompile with following parameters:"
echo "DirectorytoCompile: $MASSCOMPILE_DIR"

OUTPUT_MASSCOMPILE=$(LabVIEWCLI -LogToConsole TRUE \
-OperationName MassCompile \
-DirectoryToCompile $MASSCOMPILE_DIR \
-LabVIEWPath $LABVIEW_PATH)

echo "(Debug) Done Running Masscompile Operation"
echo " "
echo "Done Running Masscompile Operation"
echo "Printing Results..."
echo " "
echo "########################################################################################"
echo $OUTPUT_MASSCOMPILE
echo "────────────────────────────────────────────────────────────"
echo "########################################################################################"
echo " "

echo "(Debug) Running LabVIEWCLI VIAnalyzer with the following parameters:"
echo "(Debug) ConfigPath: $CONFIG_FILE"
echo "(Debug) ReportPath: $REPORT_PATH"
echo "(Debug) LabVIEWPath: $LABVIEW_PATH"
echo "Running LabVIEWCLI VIAnalyzer with the following parameters:"
echo "ConfigPath: $CONFIG_FILE"
echo "ReportPath: $REPORT_PATH"
echo " "

# Run the LabVIEWCLI command.
# Run the LabVIEWCLI VIA command.
OUTPUT=$(LabVIEWCLI -LogToConsole TRUE \
-OperationName RunVIAnalyzer \
-ConfigPath $CONFIG_FILE \
-ReportPath $REPORT_PATH \
-LabVIEWPath $LABVIEW_PATH)

echo "Done running of VI Analyzer Tests"
echo "Print Report..."
echo "────────────────────────────────────────────────────────────"
echo "Printing Results..."
echo " "
echo "########################################################################################"
cat "$REPORT_PATH"
echo "────────────────────────────────────────────────────────────"

# 1) Extract the number from the report file, anchor to “Failed Tests”
FAILED_COUNT=$(
Expand All @@ -60,8 +65,10 @@ echo "Number of failed tests: $FAILED_COUNT"
# 4) Exit based on count
if (( FAILED_COUNT > 0 )); then
echo "✖ Some tests failed. Exiting with error."
echo "########################################################################################"
exit 1
else
echo "✔ All tests passed."
echo "########################################################################################"
exit 0
fi