Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
421c8bf
Create an initial workflow - run-via-tests.yml to run VI Analyzer che…
watsnav Jan 5, 2026
87dca4d
Create an initial workflow - run-via-tests.yml to run VI Analyzer che…
watsnav Jan 5, 2026
b6ee010
Inital test run for VIA
Feb 12, 2026
29ed2f9
Merge branch 'feature/github-actions-cicd' into users/nwats/add-workf…
KSharma-NI Feb 12, 2026
23bcbec
Explicitly mention LabVIEWPath
Feb 12, 2026
e5e00e2
Explicitly mention LabVIEWPath
Feb 12, 2026
60c030a
Update github workspace
Feb 12, 2026
c365f5c
Update to 2026q1-linux
Feb 12, 2026
4bfe8a4
Update to 2026q1-linux
Feb 12, 2026
06190c8
Try labview pro
Feb 12, 2026
a429062
Try external script
Feb 12, 2026
75f45b8
Try docker run
Feb 12, 2026
af43ddc
Try docker run
Feb 12, 2026
1dbc330
Simplify the command
Feb 12, 2026
169a395
Add viancfg logic
Feb 13, 2026
45fa7a0
Update target branch
Feb 13, 2026
412163c
Get all history
Feb 13, 2026
0015aaf
Test VIA workflow
Feb 13, 2026
cf2d1ff
Update Item update logic
Feb 13, 2026
9c9fabd
Get the viancfg file for debugging
Feb 13, 2026
6560b25
Use correct template for linux
Feb 13, 2026
0c827e6
Updated VI path to be relative to viancfg
Feb 13, 2026
dcb0266
Update the VIs for testing
Feb 13, 2026
83c4251
Parse the HTML report
Feb 13, 2026
1b5cf95
Log more details from the report
Feb 13, 2026
ebe07f6
Updated the VI Analyzer tests
Feb 13, 2026
48e9d76
Move the parsing logic to a script
Feb 13, 2026
4a0139f
Update script to use VIA_EXIT_CODE
Feb 13, 2026
879e0df
Improved logic to handle manual triggers
Feb 16, 2026
8864593
Update folder structure to meet open-src standards
Feb 16, 2026
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
25 changes: 25 additions & 0 deletions .github/actions/generate_viancfg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Generate Dynamic VI Analyzer Config'
description: 'Generates a .viancfg file based on changed files in a PR'
inputs:
template-path:
description: 'Path to the .viancfg template'
required: true
output-path:
description: 'Path to save the generated .viancfg'
required: true
base-branch:
description: 'Branch to compare against'
default: 'origin/develop'
required: false

runs:
using: "composite"
steps:
- name: Generate VI Analyzer Config
shell: bash
run: |
chmod +x ${{ github.action_path }}/generate_viancfg.sh
${{ github.action_path }}/generate_viancfg.sh \
--template-path "${{ inputs.template-path }}" \
--output-path "${{ inputs.output-path }}" \
--target-branch "${{ inputs.base-branch }}"
103 changes: 103 additions & 0 deletions .github/actions/generate_viancfg/generate_viancfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/bash
set -e

# Parse arguments
TEMPLATE_PATH=""
OUTPUT_PATH=""
TARGET_BRANCH="origin/develop"

while [[ $# -gt 0 ]]; do
case $1 in
--template-path)
TEMPLATE_PATH="$2"
shift 2
;;
--output-path)
OUTPUT_PATH="$2"
shift 2
;;
--target-branch)
TARGET_BRANCH="$2"
shift 2
;;
*)
echo "Unknown parameter: $1"
exit 1
;;
esac
done

# Validate required parameters
if [ -z "$TEMPLATE_PATH" ] || [ -z "$OUTPUT_PATH" ]; then
echo "Error: --template-path and --output-path are required"
exit 1
fi

echo "Generating VI Analyzer config from template: $TEMPLATE_PATH"
echo "Target branch: $TARGET_BRANCH"
echo ""

# Get changed LabVIEW files relative to the target branch
mapfile -t CHANGED_FILES < <(git diff --name-only "$TARGET_BRANCH" --diff-filter=d | grep -E '\.(vi|ctl|llb)$' || true)

if [ ${#CHANGED_FILES[@]} -eq 0 ]; then
echo "No LabVIEW files changed. Skipping config generation."
exit 0
fi

echo "Found ${#CHANGED_FILES[@]} changed LabVIEW file(s):"
printf '%s\n' "${CHANGED_FILES[@]}"
echo ""

# Get Git root directory
GIT_ROOT=$(git rev-parse --show-toplevel)

# Read template XML and prepare output
cp "$TEMPLATE_PATH" "$OUTPUT_PATH"

OUTPUT_DIR=$(dirname "$OUTPUT_PATH")
if [ -n "$OUTPUT_DIR" ] && [ ! -d "$OUTPUT_DIR" ]; then
mkdir -p "$OUTPUT_DIR"
fi

# Get the absolute path of the output config for relative path calculation
OUTPUT_ABS_DIR=$(cd "$OUTPUT_DIR" && pwd)

# Create a temporary file for the items
ITEMS_FILE=$(mktemp)

for file in "${CHANGED_FILES[@]}"; do
# Construct absolute path
ABSOLUTE_FILE_PATH="$GIT_ROOT/$file"

# Calculate relative path from output config to the VI
RELATIVE_PATH=$(realpath --relative-to="$OUTPUT_ABS_DIR" "$ABSOLUTE_FILE_PATH")

FORMATTED_PATH="\"$RELATIVE_PATH\""

# Write XML item to temp file
cat >> "$ITEMS_FILE" << EOF
<Item>
<Path>$FORMATTED_PATH</Path>
<Removed>FALSE</Removed>
</Item>
EOF
done

# Use awk to insert the items into the template
awk -v items_file="$ITEMS_FILE" '
/<\/ItemsToAnalyze>/ {
while ((getline line < items_file) > 0) {
print line
}
close(items_file)
}
/<Item>/,/<\/Item>/ { next }
{ print }
' "$TEMPLATE_PATH" > "$OUTPUT_PATH"

# Clean up temp file
rm -f "$ITEMS_FILE"

echo ""
echo "Generated config at $OUTPUT_PATH with ${#CHANGED_FILES[@]} items."
Loading
Loading