diff --git a/.github/workflows/vi-analyzer-container.yml b/.github/workflows/vi-analyzer-container.yml index 7c1e7f4..368fb4f 100644 --- a/.github/workflows/vi-analyzer-container.yml +++ b/.github/workflows/vi-analyzer-container.yml @@ -1,11 +1,11 @@ name: Run LabVIEWCLI on Linux Container -on: - pull_request: - types: - - opened - - synchronize - - reopened +# on: +# pull_request: +# types: +# - opened +# - synchronize +# - reopened jobs: run-vi-analyzer: @@ -15,20 +15,20 @@ jobs: uses: actions/checkout@v3 # Authenticate to Docker Hub - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ secrets.GHCR_UNAME }} - password: ${{ secrets.GHCR_PAT }} + #- name: Log in to GitHub Container Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ secrets.GHCR_UNAME }} + #password: ${{ secrets.GHCR_PAT }} - name: Pull Docker Image from Docker Hub - run: docker pull ghcr.io/shivacode-2/labview:2025q3-linux-beta + run: docker pull nationalinstruments/labview:2025q3-linux - name: Run LabVIEWCLI Operations run: | docker run --rm \ -v "${{ github.workspace }}:/workspace" \ - ghcr.io/shivacode-2/labview:2025q3-linux-beta \ + nationalinstruments/labview:2025q3-linux \ bash -c "cd /workspace && chmod +x runlabview.sh && ./runlabview.sh" diff --git a/.github/workflows/vi-compare-linux.yml b/.github/workflows/vi-compare-linux.yml new file mode 100644 index 0000000..057bf0e --- /dev/null +++ b/.github/workflows/vi-compare-linux.yml @@ -0,0 +1,139 @@ +name: VI Compare (Linux) + +# Prerequisite (one-time, requires admin): +# Go to Settings → Pages → Build and deployment → Source → GitHub Actions → Save. +# Without this the "Deploy to GitHub Pages" step will fail with a clear error message. + +on: + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + run-vi-compare-linux: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + pages: write + id-token: write + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Compute Changed Files and Prepare Base Versions + run: | + # Write tab-separated STATUSFILE lines for changed .vi files. + # STATUS: A=added, D=deleted, M=modified. + # Run git diff separately so errors are not masked by grep's exit code. + git diff --name-status "origin/${{ github.base_ref }}...HEAD" \ + > /tmp/vi-diff-all.txt + grep '\.vi$' /tmp/vi-diff-all.txt \ + > "${{ github.workspace }}/changed-files.txt" || true + + echo "Changed VI files:" + cat "${{ github.workspace }}/changed-files.txt" + + # Create a git worktree for the base branch so binary .vi files can be + # compared safely without manual extraction. + git worktree add "${{ github.workspace }}/vi-base" "origin/${{ github.base_ref }}" + + - name: Pull Docker Image from Docker Hub + run: docker pull nationalinstruments/labview:2026q1-linux + + - name: Run CreateComparisonReport on Changed Files + run: | + docker run --rm \ + -v "${{ github.workspace }}:/workspace" \ + nationalinstruments/labview:2026q1-linux \ + bash -c "chmod +x /workspace/VICompareTooling/runvicompare.sh && /workspace/VICompareTooling/runvicompare.sh" + + - name: Fix report file permissions + if: always() + run: | + if [ -d "${{ github.workspace }}/vi-compare-reports" ]; then + sudo chmod -R a+r "${{ github.workspace }}/vi-compare-reports" + fi + + - name: Upload reports to GitHub Pages + id: upload-pages + if: always() && hashFiles('vi-compare-reports/*.html') != '' + uses: actions/upload-pages-artifact@v3 + with: + path: vi-compare-reports/ + + - name: Deploy to GitHub Pages + id: deploy-pages + if: always() && steps.upload-pages.outcome == 'success' + uses: actions/deploy-pages@v4 + continue-on-error: true + + - name: Check GitHub Pages setup + if: always() && steps.deploy-pages.outcome == 'failure' + run: | + echo "" + echo "==========================================================" + echo " GitHub Pages deployment failed — admin setup required" + echo "==========================================================" + echo "" + echo " A repo admin must complete the following one-time setup:" + echo "" + echo " 1. Go to https://github.com/${{ github.repository }}/settings/pages" + echo " 2. Under 'Build and deployment', set Source to 'GitHub Actions'" + echo " 3. Click Save" + echo "" + echo " This setting requires admin access to the repository." + echo "==========================================================" + echo "::error::GitHub Pages is not configured. A repo admin must go to Settings → Pages → Source → GitHub Actions and click Save. See the step log for details." + exit 1 + + - name: Post PR Comment with Report Links + if: always() && steps.deploy-pages.outcome == 'success' + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + const path = require('path'); + const changedFilesPath = path.join(process.env.GITHUB_WORKSPACE, 'changed-files.txt'); + if (!fs.existsSync(changedFilesPath)) return; + + // Each line is: STATUS\tpath/to/file.vi + // STATUS: A=added, D=deleted, M=modified + const entries = fs.readFileSync(changedFilesPath, 'utf8') + .split('\n') + .map(l => l.trim()) + .filter(l => l.includes('\t') && l.endsWith('.vi')) + .map(l => { + const [status, file] = l.split('\t', 2); + return { status: status.trim(), file: file.trim() }; + }); + + if (entries.length === 0) return; + + const pagesUrl = '${{ steps.deploy-pages.outputs.page_url }}'; + const base = pagesUrl.endsWith('/') ? pagesUrl : pagesUrl + '/'; + + let body = '### VI Comparison Reports (Linux)\n\n'; + body += '| VI File | Change | Report |\n|---------|--------|--------|\n'; + for (const { status, file } of entries) { + const baseName = path.basename(file, '.vi'); + const isModified = status === 'M'; + const reportFile = isModified + ? `${baseName}-diff-report.html` + : `${baseName}-print-report.html`; + const changeLabel = status === 'A' ? 'Added' + : status === 'D' ? 'Deleted' + : 'Modified'; + body += `| \`${file}\` | ${changeLabel} | [${reportFile}](${base}${encodeURIComponent(reportFile)}) |\n`; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body + }); diff --git a/.github/workflows/vi-compare-windows.yml b/.github/workflows/vi-compare-windows.yml new file mode 100644 index 0000000..8affc0a --- /dev/null +++ b/.github/workflows/vi-compare-windows.yml @@ -0,0 +1,141 @@ +name: VI Compare (Windows) + +# Prerequisite (one-time, requires admin): +# Go to Settings → Pages → Build and deployment → Source → GitHub Actions → Save. +# Without this the "Deploy to GitHub Pages" step will fail with a clear error message. + +on: + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + run-vi-compare-windows: + runs-on: windows-latest + permissions: + contents: read + pull-requests: write + pages: write + id-token: write + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Compute Changed Files and Prepare Base Versions + shell: pwsh + run: | + # Write tab-separated STATUSFILE lines for changed .vi files. + # STATUS: A=added, D=deleted, M=modified. + $lines = git diff --name-status "origin/${{ github.base_ref }}...HEAD" | + Where-Object { $_ -match '\.vi$' } + + Write-Host "Changed VI files:" + $lines | ForEach-Object { Write-Host " $_" } + + # Create a git worktree for the base branch so binary .vi files can be + # compared safely without manual extraction. + git worktree add "${{ github.workspace }}\vi-base" "origin/${{ github.base_ref }}" + + # Write the list to a file so the container can read it without + # multiline environment-variable encoding issues. + if ($null -eq $lines) { + New-Item -ItemType File -Path "${{ github.workspace }}\changed-files.txt" -Force | Out-Null + } else { + $lines | Out-File -FilePath "${{ github.workspace }}\changed-files.txt" ` + -Encoding utf8NoBOM + } + + - name: Pull Docker Image from Docker Hub + run: docker pull nationalinstruments/labview:2026q1-windows + + - name: Run CreateComparisonReport on Changed Files + shell: pwsh + run: | + docker run --rm ` + -v "${{ github.workspace }}:C:\workspace" ` + nationalinstruments/labview:2026q1-windows ` + powershell -File C:\workspace\VICompareTooling\runvicompare.ps1 + + - name: Upload reports to GitHub Pages + id: upload-pages + if: always() && hashFiles('vi-compare-reports/*.html') != '' + uses: actions/upload-pages-artifact@v3 + with: + path: vi-compare-reports/ + + - name: Deploy to GitHub Pages + id: deploy-pages + if: always() && steps.upload-pages.outcome == 'success' + uses: actions/deploy-pages@v4 + continue-on-error: true + + - name: Check GitHub Pages setup + if: always() && steps.deploy-pages.outcome == 'failure' + shell: pwsh + run: | + Write-Host "" + Write-Host "==========================================================" + Write-Host " GitHub Pages deployment failed — admin setup required" + Write-Host "==========================================================" + Write-Host "" + Write-Host " A repo admin must complete the following one-time setup:" + Write-Host "" + Write-Host " 1. Go to https://github.com/${{ github.repository }}/settings/pages" + Write-Host " 2. Under 'Build and deployment', set Source to 'GitHub Actions'" + Write-Host " 3. Click Save" + Write-Host "" + Write-Host " This setting requires admin access to the repository." + Write-Host "==========================================================" + Write-Host "::error::GitHub Pages is not configured. A repo admin must go to Settings -> Pages -> Source -> GitHub Actions and click Save. See the step log for details." + exit 1 + + - name: Post PR Comment with Report Links + if: always() && steps.deploy-pages.outcome == 'success' + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + const path = require('path'); + const changedFilesPath = path.join(process.env.GITHUB_WORKSPACE, 'changed-files.txt'); + if (!fs.existsSync(changedFilesPath)) return; + + // Each line is: STATUS\tpath/to/file.vi + // STATUS: A=added, D=deleted, M=modified + const entries = fs.readFileSync(changedFilesPath, 'utf8') + .split('\n') + .map(l => l.trim()) + .filter(l => l.includes('\t') && l.endsWith('.vi')) + .map(l => { + const [status, file] = l.split('\t', 2); + return { status: status.trim(), file: file.trim() }; + }); + + if (entries.length === 0) return; + + const pagesUrl = '${{ steps.deploy-pages.outputs.page_url }}'; + const base = pagesUrl.endsWith('/') ? pagesUrl : pagesUrl + '/'; + + let body = '### VI Comparison Reports (Windows)\n\n'; + body += '| VI File | Change | Report |\n|---------|--------|--------|\n'; + for (const { status, file } of entries) { + const baseName = path.basename(file, '.vi'); + const isModified = status === 'M'; + const reportFile = isModified + ? `${baseName}-diff-report.html` + : `${baseName}-print-report.html`; + const changeLabel = status === 'A' ? 'Added' + : status === 'D' ? 'Deleted' + : 'Modified'; + body += `| \`${file}\` | ${changeLabel} | [${reportFile}](${base}${encodeURIComponent(reportFile)}) |\n`; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body + }); diff --git a/Test-VIs/ArthOps.vi b/Test-VIs/ArthOps.vi index c099283..b6e34e8 100644 Binary files a/Test-VIs/ArthOps.vi and b/Test-VIs/ArthOps.vi differ diff --git a/Test-VIs/BeepWrapper.vi b/Test-VIs/BeepWrapper.vi index 31b7b14..5047982 100644 Binary files a/Test-VIs/BeepWrapper.vi and b/Test-VIs/BeepWrapper.vi differ diff --git a/Test-VIs/NewThing.vi b/Test-VIs/NewThing.vi new file mode 100644 index 0000000..a86010a Binary files /dev/null and b/Test-VIs/NewThing.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/Append log.vi b/VICompareTooling/PrintToSingleFileHtml/Append log.vi new file mode 100644 index 0000000..9cf2341 Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/Append log.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/Create output file.vi b/VICompareTooling/PrintToSingleFileHtml/Create output file.vi new file mode 100644 index 0000000..7564b7b Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/Create output file.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/GetHelp.vi b/VICompareTooling/PrintToSingleFileHtml/GetHelp.vi new file mode 100644 index 0000000..f0c983d Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/GetHelp.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/Make path absolute.vi b/VICompareTooling/PrintToSingleFileHtml/Make path absolute.vi new file mode 100644 index 0000000..f0c1327 Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/Make path absolute.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/Open VI.vi b/VICompareTooling/PrintToSingleFileHtml/Open VI.vi new file mode 100644 index 0000000..dfa07a9 Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/Open VI.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/Parse inputs.vi b/VICompareTooling/PrintToSingleFileHtml/Parse inputs.vi new file mode 100644 index 0000000..05a6a88 Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/Parse inputs.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/Print to temp file.vi b/VICompareTooling/PrintToSingleFileHtml/Print to temp file.vi new file mode 100644 index 0000000..dc1ed5f Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/Print to temp file.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/PrintToSingleFileHtml.lvclass b/VICompareTooling/PrintToSingleFileHtml/PrintToSingleFileHtml.lvclass new file mode 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6';7RF3(2N<#ZD>'Q!,%"1!!)!"!!&(5.M>8.U:8)A<W9A9WRB=X-A=(*J>G&U:3"E982B!!%!"A!!!!9!!!!!!!!!!1!!!!)!!!!$!!!!"0````]!!!!!!!!!!!!!!!!!!!!!!!!!!!%61W^S:5^Q:8*B>'FP<CZM>G.M98.T5&2)-!!!!!!!!!!!!#9!A!!!!!!!!!!!!!!! + + + false + 1.0.0.1 + + + + + 2 + + + -1 + 160 + 0 + 2 + 1 + 8388608 + 2 + + + -1 + 16777216 + 0 + 2 + 1 + 532496 + 2 + + + -1 + 16777344 + 0 + 2 + 1 + 532496 + 2 + + + -1 + 1090519168 + 1 + 1 + 1 + 34078736 + + + -1 + 160 + 0 + 2 + 1 + 8388626 + 2 + + + -1 + 160 + 0 + 2 + 1 + 8388626 + 2 + + + -1 + 160 + 0 + 2 + 1 + 8388624 + 2 + + + -1 + 160 + 0 + 2 + 1 + 524304 + 2 + + + -1 + 16777344 + 1 + 1 + 1 + 34078736 + + diff --git a/VICompareTooling/PrintToSingleFileHtml/RunOperation.vi b/VICompareTooling/PrintToSingleFileHtml/RunOperation.vi new file mode 100644 index 0000000..c18c25b Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/RunOperation.vi differ diff --git a/VICompareTooling/PrintToSingleFileHtml/base64_fast_encode.vi b/VICompareTooling/PrintToSingleFileHtml/base64_fast_encode.vi new file mode 100644 index 0000000..85082a5 Binary files /dev/null and b/VICompareTooling/PrintToSingleFileHtml/base64_fast_encode.vi differ diff --git a/VICompareTooling/runvicompare.ps1 b/VICompareTooling/runvicompare.ps1 new file mode 100644 index 0000000..bc1b0d5 --- /dev/null +++ b/VICompareTooling/runvicompare.ps1 @@ -0,0 +1,135 @@ +# Reads a list of changed .vi files from changed-files.txt (written by the workflow). +# Each line is a tab-separated pair: \t +# where STATUS is A (added), D (deleted), or M (modified). +# +# Modified VIs -> CreateComparisonReport (base vs head), *-diff-report.html +# Added VIs -> PrintToSingleFileHtml (head version), *-print-report.html +# Deleted VIs -> PrintToSingleFileHtml (base version), *-print-report.html + +$CHANGED_FILES_FILE = "C:\workspace\changed-files.txt" +$REPORT_DIR = "C:\workspace\vi-compare-reports" +$LabVIEWPath = "C:\Program Files\National Instruments\LabVIEW 2026\LabVIEW.exe" +$AdditionalOpDir = "C:\workspace\VICompareTooling" + +New-Item -ItemType Directory -Force -Path $REPORT_DIR | Out-Null + +if (-not (Test-Path $CHANGED_FILES_FILE)) { + Write-Host "No changed-files.txt found. Exiting." + exit 0 +} + +$lines = Get-Content $CHANGED_FILES_FILE | + ForEach-Object { $_.Trim() } | + Where-Object { $_ -match '\t' -and $_ -match '\.vi$' } + +if ($lines.Count -eq 0) { + Write-Host "No changed .vi files to process. Exiting." + exit 0 +} + +$FAILED = 0 + +foreach ($line in $lines) { + $parts = $line -split "`t", 2 + $status = $parts[0].Trim() + $file = $parts[1].Trim() + + $baseName = [System.IO.Path]::GetFileNameWithoutExtension($file) + + if ($status -eq "M") { + # ---------- Modified: compare base vs head ---------- + $VI_BASE = Join-Path "C:\workspace\vi-base" $file + $VI_HEAD = Join-Path "C:\workspace" $file + $REPORT_PATH = Join-Path $REPORT_DIR "$baseName-diff-report.html" + + if (-not (Test-Path $VI_HEAD)) { + Write-Host "Warning: Head version not found: $VI_HEAD, skipping." + continue + } + if (-not (Test-Path $VI_BASE)) { + Write-Host "Warning: Base version not found: $VI_BASE, skipping." + continue + } + + Write-Host "Running LabVIEWCLI CreateComparisonReport for modified VI: $file" + + # -o overwrites an existing report; -c continues if LabVIEW is already open. + & LabVIEWCLI ` + -OperationName CreateComparisonReport ` + -AdditionalOperationDirectory "$AdditionalOpDir" ` + -LabVIEWPath "$LabVIEWPath" ` + -LogToConsole TRUE ` + -vi1 "$VI_BASE" ` + -vi2 "$VI_HEAD" ` + -reportType "HTMLSingleFile" ` + -reportPath "$REPORT_PATH" ` + -o -c -nobdcosm ` + -Headless + + } elseif ($status -eq "A") { + # ---------- Added: print the new VI ---------- + $VI_PATH = Join-Path "C:\workspace" $file + $REPORT_PATH = Join-Path $REPORT_DIR "$baseName-print-report.html" + + if (-not (Test-Path $VI_PATH)) { + Write-Host "Warning: Added VI not found: $VI_PATH, skipping." + continue + } + + Write-Host "Running LabVIEWCLI PrintToSingleFileHtml for added VI: $file" + + & LabVIEWCLI ` + -OperationName PrintToSingleFileHtml ` + -AdditionalOperationDirectory "$AdditionalOpDir" ` + -LabVIEWPath "$LabVIEWPath" ` + -LogToConsole TRUE ` + -VI "$VI_PATH" ` + -OutputPath "$REPORT_PATH" ` + -o -c ` + -Headless + + } elseif ($status -eq "D") { + # ---------- Deleted: print the old VI ---------- + $VI_PATH = Join-Path "C:\workspace\vi-base" $file + $REPORT_PATH = Join-Path $REPORT_DIR "$baseName-print-report.html" + + if (-not (Test-Path $VI_PATH)) { + Write-Host "Warning: Deleted VI not found in base: $VI_PATH, skipping." + continue + } + + Write-Host "Running LabVIEWCLI PrintToSingleFileHtml for deleted VI: $file" + + & LabVIEWCLI ` + -OperationName PrintToSingleFileHtml ` + -AdditionalOperationDirectory "$AdditionalOpDir" ` + -LabVIEWPath "$LabVIEWPath" ` + -LogToConsole TRUE ` + -VI "$VI_PATH" ` + -OutputPath "$REPORT_PATH" ` + -o -c ` + -Headless + + } else { + Write-Host "Skipping unrecognized status '$status' for: $file" + continue + } + + if ($LASTEXITCODE -ne 0) { + Write-Host "X LabVIEWCLI failed for $file (exit code $LASTEXITCODE)" + $FAILED++ + } elseif (-not (Test-Path $REPORT_PATH)) { + Write-Host "X LabVIEWCLI exited 0 but report was not created: $REPORT_PATH" + $FAILED++ + } else { + Write-Host "[OK] Report generated for $file" + } +} + +if ($FAILED -gt 0) { + Write-Host "X $FAILED file(s) failed. Exiting with error." + exit 1 +} else { + Write-Host "[OK] All reports generated successfully." + exit 0 +} diff --git a/VICompareTooling/runvicompare.sh b/VICompareTooling/runvicompare.sh new file mode 100644 index 0000000..04f674a --- /dev/null +++ b/VICompareTooling/runvicompare.sh @@ -0,0 +1,143 @@ +#!/bin/bash +# Reads changed .vi files from /workspace/changed-files.txt and generates HTML +# reports. Each line of changed-files.txt is a tab-separated pair: +# \t +# where STATUS is A (added), D (deleted), or M (modified). +# +# Modified VIs → CreateComparisonReport (base vs head), *-diff-report.html +# Added VIs → PrintToSingleFileHtml (head version), *-print-report.html +# Deleted VIs → PrintToSingleFileHtml (base version), *-print-report.html + +CHANGED_FILES_FILE='/workspace/changed-files.txt' +REPORT_DIR='/workspace/vi-compare-reports' +LABVIEW_PATH='/usr/local/natinst/LabVIEW-2026-64/labviewprofull' +ADDITIONAL_OP_DIR='/workspace/VICompareTooling' + +mkdir -p "$REPORT_DIR" +mkdir -p "/tmp/natinst" +echo "1" > /tmp/natinst/LVContainer.txt + +if [ ! -f "$CHANGED_FILES_FILE" ]; then + echo "No changed-files.txt found. Exiting." + exit 0 +fi + +FAILED=0 + +# Set IFS to tab for the read loop, saving and restoring the original value. +ORIG_IFS="$IFS" +IFS=$'\t' +while read -r status file; do + IFS="$ORIG_IFS" + file="$(echo "$file" | tr -d '\r')" + status="$(echo "$status" | tr -d '\r')" + IFS=$'\t' + [[ -z "$file" ]] && continue + [[ "$file" != *.vi ]] && continue + + BASE_NAME="$(basename "$file" .vi)" + + if [[ "$status" == "M" ]]; then + # ---------- Modified: compare base vs head ---------- + VI_BASE="/workspace/vi-base/$file" + VI_HEAD="/workspace/$file" + REPORT_PATH="$REPORT_DIR/$BASE_NAME-diff-report.html" + + if [ ! -f "$VI_HEAD" ]; then + echo "Warning: Head version not found: $VI_HEAD, skipping." + continue + fi + if [ ! -f "$VI_BASE" ]; then + echo "Warning: Base version not found: $VI_BASE, skipping." + continue + fi + + echo "Running LabVIEWCLI CreateComparisonReport for modified VI: $file" + + # -o overwrites an existing report file; -c continues if LabVIEW is already open. + LabVIEWCLI \ + -OperationName CreateComparisonReport \ + -AdditionalOperationDirectory "$ADDITIONAL_OP_DIR" \ + -LabVIEWPath $LABVIEW_PATH \ + -LogToConsole TRUE \ + -vi1 "$VI_BASE" \ + -vi2 "$VI_HEAD" \ + -reportType "HTMLSingleFile" \ + -reportPath "$REPORT_PATH" \ + -o -c -nobdcosm \ + -Headless + + EXIT_CODE=$? + + elif [[ "$status" == "A" ]]; then + # ---------- Added: print the new VI ---------- + VI_PATH="/workspace/$file" + REPORT_PATH="$REPORT_DIR/$BASE_NAME-print-report.html" + + if [ ! -f "$VI_PATH" ]; then + echo "Warning: Added VI not found: $VI_PATH, skipping." + continue + fi + + echo "Running LabVIEWCLI PrintToSingleFileHtml for added VI: $file" + + LabVIEWCLI \ + -OperationName PrintToSingleFileHtml \ + -AdditionalOperationDirectory "$ADDITIONAL_OP_DIR" \ + -LabVIEWPath $LABVIEW_PATH \ + -LogToConsole TRUE \ + -VI "$VI_PATH" \ + -OutputPath "$REPORT_PATH" \ + -o -c \ + -Headless + + EXIT_CODE=$? + + elif [[ "$status" == "D" ]]; then + # ---------- Deleted: print the old VI ---------- + VI_PATH="/workspace/vi-base/$file" + REPORT_PATH="$REPORT_DIR/$BASE_NAME-print-report.html" + + if [ ! -f "$VI_PATH" ]; then + echo "Warning: Deleted VI not found in base: $VI_PATH, skipping." + continue + fi + + echo "Running LabVIEWCLI PrintToSingleFileHtml for deleted VI: $file" + + LabVIEWCLI \ + -OperationName PrintToSingleFileHtml \ + -AdditionalOperationDirectory "$ADDITIONAL_OP_DIR" \ + -LabVIEWPath $LABVIEW_PATH \ + -LogToConsole TRUE \ + -VI "$VI_PATH" \ + -OutputPath "$REPORT_PATH" \ + -o -c \ + -Headless + + EXIT_CODE=$? + + else + echo "Skipping unrecognized status '$status' for: $file" + continue + fi + + if [ $EXIT_CODE -ne 0 ]; then + echo "✖ LabVIEWCLI failed for $file (exit code $EXIT_CODE)" + FAILED=$((FAILED + 1)) + elif [ ! -f "$REPORT_PATH" ]; then + echo "✖ LabVIEWCLI exited 0 but report was not created: $REPORT_PATH" + FAILED=$((FAILED + 1)) + else + echo "✔ Report generated for $file" + fi +done < "$CHANGED_FILES_FILE" +IFS="$ORIG_IFS" + +if [ $FAILED -gt 0 ]; then + echo "✖ $FAILED file(s) failed. Exiting with error." + exit 1 +else + echo "✔ All reports generated successfully." + exit 0 +fi diff --git a/runlabview.sh b/runlabview.sh index 1144094..503cae2 100644 --- a/runlabview.sh +++ b/runlabview.sh @@ -1,8 +1,8 @@ #!/bin/bash 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='/workspace/Test-VIs' +LABVIEW_PATH='/usr/local/natinst/LabVIEW-2025-64/labviewprofull' # Verify that the configuration file exists. if [ ! -f "$CONFIG_FILE" ]; then @@ -10,6 +10,8 @@ if [ ! -f "$CONFIG_FILE" ]; then exit 1 fi +mkdir -p "/tmp/natinst" +echo "1" > /tmp/natinst/LVContainer.txt echo "Running LabVIEWCLI MassCompile with following parameters:" echo "DirectorytoCompile: $MASSCOMPILE_DIR"