-
Notifications
You must be signed in to change notification settings - Fork 3
1310 lines (1227 loc) · 50.8 KB
/
Copy pathci-orchestrated.yml
File metadata and controls
1310 lines (1227 loc) · 50.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI Orchestrated (deterministic chain)
on:
push:
branches: [develop]
workflow_dispatch:
inputs:
origin_kind:
description: Trigger origin (e.g., issue_comment)
required: false
type: string
origin_pr:
description: PR number when triggered from a comment
required: false
type: string
origin_comment_id:
description: Comment id when triggered from a comment
required: false
type: string
origin_comment_url:
description: Comment URL when triggered from a comment
required: false
type: string
origin_author:
description: Comment author login
required: false
type: string
strategy:
description: Execution strategy (matrix or single)
required: false
default: single
type: choice
options: [matrix, single]
include_integration:
description: Include Integration-tagged tests
required: false
default: 'true'
type: choice
options: ['true', 'false']
sample_id:
description: Sampling correlation id (prevents cancels)
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.inputs.sample_id || github.ref }}
cancel-in-progress: true
jobs:
normalize:
runs-on: ubuntu-latest
env:
RESULTS_DIR: tests/results/normalize
outputs:
include_integration: ${{ steps.b.outputs.normalized }}
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: tests/results
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: tests/results
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: Wire Invoker (start)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-invoker-start
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Ensure Invoker (start)
uses: ./.github/actions/ensure-invoker
with:
mode: start
timeout-seconds: '60'
retries: '1'
retry-delay-seconds: '0'
results-dir: ${{ env.RESULTS_DIR }}
require-invoker: 'false'
- name: Normalize include_integration
id: b
uses: ./.github/actions/bool-normalize
with:
value: ${{ inputs.include_integration || 'true' }}
- name: Write run provenance
shell: pwsh
env:
EV_ORIGIN_KIND: ${{ inputs.origin_kind || '' }}
EV_ORIGIN_PR: ${{ inputs.origin_pr || '' }}
EV_ORIGIN_COMMENT_ID: ${{ inputs.origin_comment_id || '' }}
EV_ORIGIN_COMMENT_URL: ${{ inputs.origin_comment_url || '' }}
EV_ORIGIN_AUTHOR: ${{ inputs.origin_author || '' }}
EV_SAMPLE_ID: ${{ inputs.sample_id || '' }}
EV_INCLUDE_INTEGRATION: ${{ inputs.include_integration || 'true' }}
EV_STRATEGY: ${{ inputs.strategy || 'matrix' }}
run: |
pwsh -NoLogo -NoProfile -File tools/Write-RunProvenance.ps1 -ResultsDir '${{ env.RESULTS_DIR }}' -AppendStepSummary
- name: Upload run provenance
if: always()
uses: actions/upload-artifact@v5
with:
name: orchestrated-provenance
path: ${{ env.RESULTS_DIR }}/provenance.json
lint:
runs-on: ubuntu-latest
env:
RESULTS_DIR: tests/results/lint
ACTIONLINT_VERSION: '${{ vars.ACTIONLINT_VERSION || ''1.7.7'' }}'
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
COMPAREVI_TOOLS_IMAGE: ghcr.io/labview-community-ci-cd/comparevi-tools:latest
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: tests/results
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: tests/results
- name: Install actionlint (retry)
shell: bash
run: |
set -euo pipefail
mkdir -p ./bin
ver="${ACTIONLINT_VERSION:-1.7.7}"
for i in 1 2 3; do
if curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash -s -- "$ver" ./bin; then
break
else
echo "retry $i"; sleep 2
fi
done
- name: Run actionlint
run: |
./bin/actionlint -color
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: Non-LabVIEW checks (Docker)
shell: pwsh
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch || github.event.pull_request.base.repo.default_branch || github.event.workflow_run.repository.default_branch || '' }}
run: |
$params = @()
$defaultBranch = $env:DEFAULT_BRANCH
if ('${{ github.ref_name }}' -eq $defaultBranch -or '${{ github.base_ref }}' -eq $defaultBranch) {
$params += '-FailOnWorkflowDrift'
}
$params += '-SkipDotnetCliBuild'
# Skip linting this workflow while it is executing to avoid orchestration deadlocks.
$params += '-ExcludeWorkflowPaths'
$params += '.github/workflows/ci-orchestrated.yml'
pwsh -File ./tools/Run-NonLVChecksInDocker.ps1 @params
- name: Publish comparevi-cli (SDK container)
if: ${{ hashFiles('src/CompareVi.Tools.Cli/CompareVi.Tools.Cli.csproj') != '' }}
shell: bash
run: |
set -euo pipefail
SHA="${GITHUB_SHA:-local}"
docker run --rm -v "${PWD}:/work" -w /work -e BUILD_SHA="$SHA" mcr.microsoft.com/dotnet/sdk:8.0 bash -lc '
set -euo pipefail
export DOTNET_CLI_HOME=/tmp/dotnet
rm -rf dist/comparevi-cli src/CompareVi.Tools.Cli/obj src/CompareVi.Shared/obj || true
IV="${BUILD_SHA:-local}"
dotnet publish src/CompareVi.Tools.Cli/CompareVi.Tools.Cli.csproj -c Release -nologo -o dist/comparevi-cli -p:UseAppHost=false -p:InformationalVersion="$IV"
'
- name: Validate comparevi-cli outputs
if: ${{ hashFiles('dist/comparevi-cli/comparevi-cli.dll') != '' }}
run: node tools/npm/run-script.mjs cli:validate
- name: Watch run (REST sanity)
if: ${{ hashFiles('dist/tools/watchers/orchestrated-watch.js') != '' }}
run: node dist/tools/watchers/orchestrated-watch.js --run-id ${{ github.run_id }} --poll-ms 1000 --out "${{ env.RESULTS_DIR }}/watcher-rest.json"
- name: Merge REST watcher into session index
if: ${{ hashFiles(format('{0}/watcher-rest.json', env.RESULTS_DIR)) != '' }}
shell: pwsh
run: pwsh -File tools/Update-SessionIndexWatcher.ps1 -ResultsDir "${{ env.RESULTS_DIR }}" -WatcherJson "${{ env.RESULTS_DIR }}/watcher-rest.json"
- name: Compute comparevi-cli checksums
if: ${{ hashFiles('dist/comparevi-cli/**') != '' }}
shell: pwsh
run: |
$dir = 'dist/comparevi-cli'
$outDir = 'tests/results/_cli'
New-Item -ItemType Directory -Force -Path $outDir | Out-Null
$files = Get-ChildItem -LiteralPath $dir -File -Recurse
$list = @()
foreach($f in $files){
$sha = pwsh -File tools/Get-FileSha256.ps1 -Path $f.FullName
$list += [pscustomobject]@{ path = (Resolve-Path $f.FullName).Path; sha256 = $sha; bytes = $f.Length }
}
$meta = [pscustomobject]@{
gitSha = '${{ github.sha }}'
branch = '${{ github.ref_name }}'
generatedAt = (Get-Date).ToString('o')
files = $list
}
$json = $meta | ConvertTo-Json -Depth 6
$json | Out-File -FilePath (Join-Path $outDir 'meta.json') -Encoding utf8
if ($env:GITHUB_STEP_SUMMARY) {
$lines = @('### comparevi-cli artifact','',"- Files: $($files.Count)")
$first = $list | Select-Object -First 1
if ($first) { $lines += ("- First file: {0} (sha256={1})" -f $first.path,$first.sha256) }
$lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
}
- name: Upload comparevi-cli artifact
if: ${{ hashFiles('dist/comparevi-cli/**') != '' }}
uses: actions/upload-artifact@v5
with:
name: comparevi-cli-${{ runner.os }}
path: dist/comparevi-cli/**/*
- name: Setup Node with cache
uses: actions/setup-node@v5
with:
node-version: "20"
cache: "npm"
- name: Install CLI validation deps
run: node tools/npm/cli.mjs ci
- name: Install markdownlint-cli (retry)
shell: bash
run: |
set -euo pipefail
for i in 1 2 3; do
if node tools/npm/cli.mjs install -g markdownlint-cli; then
break
else
node tools/npm/cli.mjs cache clean --force || true
echo "retry $i"
sleep 2
fi
done
- name: Run markdownlint (non-blocking)
run: |
markdownlint "**/*.md" --ignore node_modules
continue-on-error: true
preflight:
runs-on: windows-latest
timeout-minutes: 3
needs: [normalize]
env:
RESULTS_DIR: tests/results/preflight
# Hosted Windows health gate before self-hosted jobs
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: tests/results
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: tests/results
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: Runner health (notice-only, hosted)
if: ${{ vars.RUNNER_HEALTH != '0' }}
shell: pwsh
run: pwsh -File tools/Collect-RunnerHealth.ps1 -AppendSummary -EmitJson
- name: Verify Windows runner and idle LabVIEW (surface LVCompare notice)
shell: pwsh
run: |-
Write-Host "Runner: $([System.Environment]::OSVersion.VersionString)"
Write-Host "Pwsh: $($PSVersionTable.PSVersion)"
$cli = 'C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe'
if (-not (Test-Path -LiteralPath $cli)) {
Write-Host "::notice::LVCompare.exe not found at canonical path: $cli (hosted preflight)"
} else { Write-Host "LVCompare present: $cli" }
$lv = Get-Process -Name 'LabVIEW' -ErrorAction SilentlyContinue
if ($lv) { $pids = ($lv | ForEach-Object Id); $msg = "::error::LabVIEW.exe is running (PID(s): {0})" -f ([string]::Join(",", $pids)); Write-Host $msg; exit 1 }
Write-Host 'Preflight OK: Windows runner healthy; LabVIEW not running.'
if ($env:GITHUB_STEP_SUMMARY) {
$note = @('Note:', '- This preflight runs on hosted Windows (windows-latest); LVCompare presence is not required here.', '- Self-hosted Windows steps later in this workflow enforce LVCompare at the canonical path.') -join "`n"
$note | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
}
# Hosted gate is informational only; enforce LVCompare on self-hosted jobs.
probe:
# Quick interactivity probe on self-hosted Windows to decide single vs fallback
if: ${{ inputs.strategy == 'single' || vars.ORCH_STRATEGY == 'single' }}
runs-on: [self-hosted, Windows, X64]
timeout-minutes: 2
needs: [normalize, preflight]
env:
RESULTS_DIR: tests/results/probe
outputs:
ok: ${{ steps.out.outputs.ok }}
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: tests/results
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: tests/results
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: Runner health (notice-only, self-hosted)
if: ${{ vars.RUNNER_HEALTH != '0' }}
shell: pwsh
run: pwsh -File tools/Collect-RunnerHealth.ps1 -ResultsDir '${{ env.RESULTS_DIR }}' -AppendSummary -EmitJson
- name: Run interactivity probe
id: out
shell: pwsh
run: |
pwsh -File tools/Write-InteractivityProbe.ps1
$ui = [System.Environment]::UserInteractive
$in = $false; try { $in = [Console]::IsInputRedirected } catch {}
$ok = ($ui -and -not $in)
"ok=$ok" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
pester-category:
if: ${{ inputs.strategy == 'matrix' || vars.ORCH_STRATEGY == 'matrix' || (inputs.strategy == '' && vars.ORCH_STRATEGY == '') || (inputs.strategy == 'single' && needs.probe.outputs.ok == 'false') }}
runs-on: [self-hosted, Windows, X64]
timeout-minutes: 3
needs: [normalize, preflight, probe]
strategy:
matrix:
category: [dispatcher, fixtures, schema, comparevi, loop, psummary, workflow]
max-parallel: 1
env:
RESULTS_ROOT: tests/results
RESULTS_DIR: ${{ format('tests/results/{0}', matrix.category) }}
DETECT_LEAKS: '1'
CLEAN_AFTER: '0'
SCAN_ARTIFACTS: '1'
UNBLOCK_GUARD: '0'
# Recommended LabVIEW environment toggles for headless invocations
LV_SUPPRESS_UI: '1'
LV_NO_ACTIVATE: '1'
LV_CURSOR_RESTORE: '1'
LV_IDLE_WAIT_SECONDS: '2'
LV_IDLE_MAX_WAIT_SECONDS: '5'
WATCH_CONSOLE: '1'
LABVIEW_EXE: C:\\Program Files\\National Instruments\\LabVIEW 2025\\LabVIEW.exe
EMIT_LV_CLOSURE_CRUMBS: '1'
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: tests/results/${{ matrix.category }}
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: tests/results/${{ matrix.category }}
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: Append interactivity probe
shell: pwsh
run: pwsh -File tools/Write-InteractivityProbe.ps1
- name: Snapshot processes (pre-invoker)
shell: pwsh
run: |
$procs = Get-Process | Where-Object { $_.Name -in 'pwsh','LVCompare','LabVIEW' } | Select-Object Name,Id,MainWindowTitle
$lines = @('### Pre-Invoker Process Snapshot','')
foreach ($p in $procs) { $lines += ('- {0} (PID {1}) {2}' -f $p.Name,$p.Id,$p.MainWindowTitle) }
if ($env:GITHUB_STEP_SUMMARY) { $lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 }
& (Join-Path $PWD 'tools/Emit-LVClosureCrumb.ps1') -ResultsDir '${{ env.RESULTS_DIR }}' -Phase 'pre-invoker'
- name: Wire Invoker (start)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-invoker-start
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Ensure Invoker (start)
id: inv_start_matrix
uses: ./.github/actions/ensure-invoker
with:
mode: start
results-dir: ${{ env.RESULTS_DIR }}
category: ${{ matrix.category }}
# Give the invoker more time and an extra retry while diagnosing READY
timeout-seconds: '120'
retries: '4'
retry-delay-seconds: '7'
- name: Debug invoker markers
if: always()
shell: pwsh
run: |
$dir = "${{ env.RESULTS_DIR }}/_invoker"
if (Test-Path -LiteralPath $dir -PathType Container) {
Write-Host "Invoker marker directory: $dir"
try { Get-ChildItem -LiteralPath $dir | Format-Table -AutoSize | Out-String | Write-Host } catch {}
$boot = Join-Path $dir 'boot.log'
if (Test-Path -LiteralPath $boot -PathType Leaf) {
Write-Host '--- boot.log ---'
Get-Content -LiteralPath $boot -Raw | Write-Host
} else {
Write-Host 'boot.log not found.'
}
} else {
Write-Host '::notice::Invoker marker directory missing.'
}
- name: LabVIEW warmup (preflight; leave LVCompare running)
if: runner.os == 'Windows'
env:
WARMUP_SKIP_ARGS: '1'
shell: pwsh
run: pwsh -File tools/Warmup-LabVIEW.ps1
- name: Snapshot processes (post-invoker)
shell: pwsh
run: |
$procs = Get-Process | Where-Object { $_.Name -in 'pwsh','LVCompare','LabVIEW' } | Select-Object Name,Id,MainWindowTitle
$lines = @('### Post-Invoker Process Snapshot','')
foreach ($p in $procs) { $lines += ('- {0} (PID {1}) {2}' -f $p.Name,$p.Id,$p.MainWindowTitle) }
if ($env:GITHUB_STEP_SUMMARY) { $lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 }
& (Join-Path $PWD 'tools/Emit-LVClosureCrumb.ps1') -ResultsDir '${{ env.RESULTS_DIR }}' -Phase 'post-invoker'
- name: Prepare fixture copies (base/head)
if: ${{ steps.inv_start_matrix.outputs.ready == 'true' }}
id: fixtures
uses: ./.github/actions/prepare-fixtures
- name: Export fixture env for tests
shell: pwsh
run: |
"LV_BASE_VI=${{ steps.fixtures.outputs.base }}" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"LV_HEAD_VI=${{ steps.fixtures.outputs.head }}" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Apply determinism profile
uses: ./.github/actions/determinism-profile
with:
strict: 'true'
- name: Apply dispatcher profile
id: dprofile
uses: ./.github/actions/dispatcher-profile
with:
emit-failures-json-always: 'true'
detect-leaks: 'true'
fail-on-leaks: 'false'
kill-leaks: 'false'
leak-grace-seconds: '3'
clean-labview-before: 'false'
clean-after: 'false'
track-artifacts: 'true'
- name: Wire Probe (T1)
uses: ./.github/actions/wire-probe
with:
phase: T1
results-dir: ${{ env.RESULTS_DIR }}
- name: Run Compare CLI (category)
if: ${{ steps.inv_start_matrix.outputs.ready == 'true' }}
shell: pwsh
run: |
pwsh -File tools/Invoke-CompareCli.ps1 `
-Category '${{ matrix.category }}' `
-IntegrationMode "${{ needs.normalize.outputs.include_integration == 'true' && 'include' || 'exclude' }}" `
-ResultsRoot '${{ env.RESULTS_ROOT }}'
- name: Summarize CLI output
if: ${{ steps.inv_start_matrix.outputs.ready == 'true' }}
shell: pwsh
run: |
$category = '${{ matrix.category }}'
$cliPath = Join-Path '${{ env.RESULTS_DIR }}' 'cli-run.json'
if (-not (Test-Path -LiteralPath $cliPath -PathType Leaf)) {
"Compare CLI summary not found for category '$category'." | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
return
}
try {
$cli = Get-Content -LiteralPath $cliPath -Raw | ConvertFrom-Json -ErrorAction Stop
$lines = @(
"### Compare CLI Status ($category)",
"- Status: $($cli.status)",
"- Exit Code: $($cli.exitCode)"
)
if ($cli.summary) {
$lines += ("- Tests: {0} Passed: {1} Failed: {2} Errors: {3}" -f $cli.summary.total,$cli.summary.passed,$cli.summary.failed,$cli.summary.errors)
if ($cli.summary.duration_s) { $lines += ("- Duration (s): {0}" -f $cli.summary.duration_s) }
}
($lines -join "`n") | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
} catch {
"Compare CLI summary parse failed: $_" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
}
- name: Ensure session index (fallback)
if: always()
shell: pwsh
run: pwsh -File tools/Ensure-SessionIndex.ps1 -ResultsDir "${{ env.RESULTS_DIR }}" -SummaryJson 'pester-summary.json'
- name: Wire Session Index (S1)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-session-index
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Session index post
if: always()
uses: ./.github/actions/session-index-post
with:
results-dir: ${{ env.RESULTS_DIR }}
validate-schema: true
upload: true
artifact-name: session-index-${{ matrix.category }}
- name: Upload Pester artifacts
if: always()
uses: actions/upload-artifact@v5
with:
name: orchestrated-pester-results-${{ matrix.category }}
path: |
${{ env.RESULTS_DIR }}/**/*.xml
${{ env.RESULTS_DIR }}/**/*.txt
${{ env.RESULTS_DIR }}/pester-summary.json
${{ env.RESULTS_DIR }}/pester-failures.json
${{ env.RESULTS_DIR }}/session-index.json
- name: Upload invoker boot log (category)
if: always() && hashFiles(format('{0}/_invoker/boot.log', env.RESULTS_DIR)) != ''
uses: actions/upload-artifact@v5
with:
name: invoker-boot-${{ matrix.category }}
path: ${{ env.RESULTS_DIR }}/_invoker/boot.log
- name: Wire Guard (pre)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-guard-pre
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Runner Unblock Guard
if: always()
uses: ./.github/actions/runner-unblock-guard
with:
snapshot-path: ${{ env.RESULTS_DIR }}/runner-unblock-snapshot.json
cleanup: ${{ env.UNBLOCK_GUARD == '1' }}
process-names: LabVIEW,LVCompare
- name: Wire Guard (post)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-guard-post
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Ensure Invoker (stop)
if: always()
uses: ./.github/actions/ensure-invoker
with:
mode: stop
results-dir: ${{ env.RESULTS_DIR }}
category: ${{ matrix.category }}
- name: Emit LV closure telemetry (category post-stop)
if: always()
shell: pwsh
run: |
& (Join-Path $PWD 'tools/Emit-LVClosureCrumb.ps1') -ResultsDir '${{ env.RESULTS_DIR }}' -Phase 'post-stop'
- name: Wire Invoker (stop)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-invoker-stop
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Append determinism summary
if: always()
shell: pwsh
run: pwsh -File tools/Write-DeterminismSummary.ps1
- name: Append runner identity
if: always()
shell: pwsh
run: pwsh -File tools/Write-RunnerIdentity.ps1 -SampleId '${{ github.event.inputs.sample_id || '' }}'
- name: Append artifact map
if: always()
shell: pwsh
run: |
$paths = @('${{ env.RESULTS_DIR }}/pester-summary.json','${{ env.RESULTS_DIR }}/pester-results.xml','${{ env.RESULTS_DIR }}/pester-failures.json','${{ env.RESULTS_DIR }}/session-index.json')
$pathsList = $paths -join ';'
pwsh -File tools/Write-ArtifactMap.ps1 -PathsList $pathsList -Title 'Artifacts'
- name: Append top failures
if: always()
shell: pwsh
run: pwsh -File tools/Write-PesterTopFailures.ps1 -ResultsDir "${{ env.RESULTS_DIR }}" -Top 5
- name: Generate dev dashboard (matrix)
if: always()
shell: pwsh
run: pwsh -File tools/Invoke-DevDashboard.ps1 -Group 'pester-selfhosted' -ResultsRoot "${{ env.RESULTS_DIR }}" -OutputRoot "${{ env.RESULTS_DIR }}/dev-dashboard"
- name: Upload dev dashboard (matrix)
if: always()
uses: actions/upload-artifact@v5
with:
name: dev-dashboard-${{ matrix.category }}
path: |
${{ env.RESULTS_DIR }}/dev-dashboard/dashboard.html
${{ env.RESULTS_DIR }}/dev-dashboard/dashboard.json
if-no-files-found: warn
- name: Append dev dashboard summary (matrix)
if: always()
shell: pwsh
run: |
$html = Join-Path "${{ env.RESULTS_DIR }}/dev-dashboard" 'dashboard.html'
$json = Join-Path "${{ env.RESULTS_DIR }}/dev-dashboard" 'dashboard.json'
if ($env:GITHUB_STEP_SUMMARY -and (Test-Path $html)) {
$lines = @(
"### Dev Dashboard (${{ matrix.category }})",
'',
"- HTML: $(Resolve-Path $html)",
"- JSON: $(Resolve-Path $json)"
)
$lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
}
- name: Re-run hint
if: always()
shell: pwsh
run: pwsh -File tools/Write-RerunHint.ps1 -Workflow 'ci-orchestrated.yml' -IncludeIntegration '${{ needs.normalize.outputs.include_integration }}' -SampleId '${{ github.event.inputs.sample_id || '' }}'
drift:
if: ${{ inputs.strategy == 'matrix' || vars.ORCH_STRATEGY == 'matrix' || (inputs.strategy == '' && vars.ORCH_STRATEGY == '') }}
runs-on: [self-hosted, Windows, X64]
timeout-minutes: 3
needs: [pester-category]
env:
RESULTS_DIR: results/fixture-drift
INVOKER_REQUIRED: '1'
UNBLOCK_GUARD: '0'
LV_SUPPRESS_UI: '0'
CLEAN_LV_BEFORE: ${{ vars.CLEAN_LV_BEFORE || 'true' }}
CLEAN_LV_AFTER: ${{ vars.CLEAN_LV_AFTER || 'true' }}
CLEAN_LV_INCLUDE_COMPARE: ${{ vars.CLEAN_LV_INCLUDE_COMPARE || vars.CLEAN_LVCOMPARE || 'true' }}
LVCI_SINGLE_COMPARE: '1'
WATCH_CONSOLE: '1'
LABVIEW_EXE: C:\\Program Files\\National Instruments\\LabVIEW 2025\\LabVIEW.exe
EMIT_LV_CLOSURE_CRUMBS: '1'
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: results/fixture-drift
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: results/fixture-drift
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: LabVIEW warmup (best-effort)
if: runner.os == 'Windows'
shell: pwsh
run: pwsh -File tools/Warmup-LabVIEW.ps1
- name: Append interactivity probe
shell: pwsh
run: pwsh -File tools/Write-InteractivityProbe.ps1
- name: Wire Invoker (start)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-invoker-start
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Ensure Invoker (start)
uses: ./.github/actions/ensure-invoker
with:
mode: start
results-dir: ${{ env.RESULTS_DIR }}
- name: Wire Probe (C1)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-probe
with:
phase: C1
results-dir: ${{ env.RESULTS_DIR }}
- name: Fixture Drift Orchestrator
uses: ./.github/actions/fixture-drift
with:
render-report: 'true'
comment-on-fail: 'true'
upload-artifacts: 'true'
artifact-name: orchestrated-fixture-drift
- name: Wire Probe (C2)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-probe
with:
phase: C2
results-dir: ${{ env.RESULTS_DIR }}
- name: Wire Session Index (S1)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-session-index
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Session index post (best-effort)
if: always()
uses: ./.github/actions/session-index-post
with:
results-dir: ${{ env.RESULTS_DIR }}
validate-schema: true
upload: true
artifact-name: fixture-drift-session-index
- name: Generate dev dashboard (drift)
if: always()
shell: pwsh
run: pwsh -File tools/Invoke-DevDashboard.ps1 -Group 'fixture-drift' -ResultsRoot '${{ env.RESULTS_DIR }}' -OutputRoot '${{ env.RESULTS_DIR }}/dev-dashboard'
- name: Upload dev dashboard (drift)
if: always()
uses: actions/upload-artifact@v5
with:
name: dev-dashboard-drift
path: |
${{ env.RESULTS_DIR }}/dev-dashboard/dashboard.html
${{ env.RESULTS_DIR }}/dev-dashboard/dashboard.json
if-no-files-found: warn
- name: Append dev dashboard summary (drift)
if: always()
shell: pwsh
run: |
$html = Join-Path '${{ env.RESULTS_DIR }}/dev-dashboard' 'dashboard.html'
$json = Join-Path '${{ env.RESULTS_DIR }}/dev-dashboard' 'dashboard.json'
if ($env:GITHUB_STEP_SUMMARY -and (Test-Path $html)) {
$lines = @(
'### Dev Dashboard (drift)',
'',
"- HTML: $(Resolve-Path $html)",
"- JSON: $(Resolve-Path $json)"
)
$lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
}
- name: Parse Compare Exec JSON (drift)
if: always()
shell: pwsh
run: |
pwsh -File tools/Parse-CompareExec.ps1 -SearchDir '${{ env.RESULTS_DIR }}' -OutJson '${{ env.RESULTS_DIR }}/compare-outcome.json'
- name: Upload compare outcome (drift)
if: always() && hashFiles(format('{0}/compare-outcome.json', env.RESULTS_DIR)) != ''
uses: actions/upload-artifact@v5
with:
name: compare-outcome-drift
path: ${{ env.RESULTS_DIR }}/compare-outcome.json
- name: Wire Guard (pre)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-guard-pre
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Runner Unblock Guard
if: always()
uses: ./.github/actions/runner-unblock-guard
with:
snapshot-path: ${{ env.RESULTS_DIR }}/runner-unblock-snapshot.json
cleanup: ${{ env.UNBLOCK_GUARD == '1' }}
process-names: LabVIEW,LVCompare
- name: Wire Guard (post)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-guard-post
with:
results-dir: ${{ env.RESULTS_DIR }}
- name: Ensure Invoker (stop)
if: always()
uses: ./.github/actions/ensure-invoker
with:
mode: stop
results-dir: ${{ env.RESULTS_DIR }}
- name: Emit LV closure telemetry (drift post-stop)
if: always()
shell: pwsh
run: |
& (Join-Path $PWD 'tools/Emit-LVClosureCrumb.ps1') -ResultsDir '${{ env.RESULTS_DIR }}' -Phase 'post-stop'
- name: Wire Invoker (stop)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-invoker-stop
with:
results-dir: ${{ env.RESULTS_DIR }}
publish:
if: ${{ always() && (inputs.strategy == 'matrix' || vars.ORCH_STRATEGY == 'matrix' || (inputs.strategy == '' && vars.ORCH_STRATEGY == '')) && needs.pester-category.result != 'skipped' }}
runs-on: ubuntu-latest
needs: [lint, pester-category, drift]
steps:
- uses: actions/checkout@v5
- name: Wire Probe (J1)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J1
results-dir: tests/results
- name: Wire Probe (J2)
if: '${{ vars.WIRE_PROBES != ''0'' }}'
uses: ./.github/actions/wire-probe
with:
phase: J2
results-dir: tests/results
- name: Configure Git safe.directory (service)
shell: pwsh
run: git config --global --add safe.directory $env:GITHUB_WORKSPACE
- name: Summarize orchestrated run
shell: pwsh
run: |
$lines = @(
'### CI Orchestrated Summary',
'- Lint: ${{ needs.lint.result }}',
'- Pester: ${{ needs.pester-category.result }}',
'- Drift: ${{ needs.drift.result }}'
) -join "`n"
$lines | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
- name: Setup Node.js (derive env)
if: always()
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Derive environment snapshot (publish)
if: always()
shell: bash
run: |
set -euo pipefail
node tools/npm/run-script.mjs --silent derive:env > derived-env.json
mkdir -p tests/results/_agent
cp derived-env.json tests/results/_agent/derived-env.json
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
{
echo '### Derived Environment';
echo '```json';
cat derived-env.json;
echo '```';
} >> "$GITHUB_STEP_SUMMARY"
fi
- name: Append run links (publish)
if: always()
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$summaryPath = $env:GITHUB_STEP_SUMMARY
if (-not $summaryPath) { return }
if (-not $env:GH_TOKEN) {
Write-Warning '[run-links] GH_TOKEN missing; skipping run link summary.'
return
}
$repo = $env:GITHUB_REPOSITORY
if (-not $repo) {
Write-Warning '[run-links] GITHUB_REPOSITORY missing; skipping run link summary.'
return
}
$runId = '${{ github.run_id }}'
$uri = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs?per_page=100"
$headers = @{
Authorization = "Bearer $env:GH_TOKEN"
'X-GitHub-Api-Version' = '2022-11-28'
Accept = 'application/vnd.github+json'
}
try {
$resp = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -ErrorAction Stop
} catch {
Write-Warning ("[run-links] failed to fetch run jobs: {0}" -f $_.Exception.Message)
return
}
$jobs = @($resp.jobs)
if (-not $jobs -or $jobs.Count -eq 0) { return }
$items = @()
foreach ($job in $jobs) {
if (-not $job.name -or -not $job.html_url) { continue }
$items += ('- [{0}]({1})' -f $job.name, $job.html_url)
}
if ($items.Count -eq 0) { return }
$block = @('### Run Links','') + $items
$block -join "`n" | Out-File -FilePath $summaryPath -Append -Encoding utf8
- name: Wire Probe (P1)
if: ${{ vars.WIRE_PROBES != '0' }}
uses: ./.github/actions/wire-probe
with:
phase: P1
results-dir: tests/results
- name: Download Pester category artifacts (dispatcher)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-dispatcher
path: cats/dispatcher
- name: Download Pester category artifacts (fixtures)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-fixtures
path: cats/fixtures
- name: Download Pester category artifacts (schema)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-schema
path: cats/schema
- name: Download Pester category artifacts (comparevi)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-comparevi
path: cats/comparevi
- name: Download Pester category artifacts (loop)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-loop
path: cats/loop
- name: Download Pester category artifacts (psummary)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-psummary
path: cats/psummary
- name: Download Pester category artifacts (workflow)
if: always()
uses: actions/download-artifact@v4
with:
name: orchestrated-pester-results-workflow
path: cats/workflow
- name: Summarize Pester categories
if: always()
shell: pwsh
run: |
$cats = @('dispatcher','fixtures','schema','comparevi','loop','psummary','workflow')
& (Join-Path $PWD 'tools/Summarize-PesterCategories.ps1') -BaseDir 'cats' -Categories $cats
- name: Download run provenance artifact
if: always()
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: orchestrated-provenance
path: prov
- name: Validate run provenance (schema-lite)
if: always()
shell: pwsh
continue-on-error: true
run: |
$json = Join-Path 'prov' 'provenance.json'
if (Test-Path $json) {
pwsh -File tools/Invoke-JsonSchemaLite.ps1 -JsonPath $json -SchemaPath docs/schemas/run-provenance-v1.schema.json
$status = if ($LASTEXITCODE -eq 0) { 'ok' } else { 'fail' }
if ($env:GITHUB_STEP_SUMMARY) {
$lines = @('### Run Provenance Schema','',"- Status: $status","- File: $json")
$lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
}
} else {
if ($env:GITHUB_STEP_SUMMARY) { "### Run Provenance Schema`n- File: (missing) $json" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 }
}
- name: Validate session-index (categories) schema-lite
if: always()
shell: pwsh
continue-on-error: true
run: |
$cats = @('dispatcher','fixtures','schema','comparevi','loop','psummary','workflow')
$ok=0; $fail=0; $miss=0
foreach ($c in $cats) {
$p1 = Join-Path (Join-Path 'cats' $c) 'tests/results/session-index.json'
$p2 = Join-Path (Join-Path 'cats' $c) 'session-index.json'
$json = if (Test-Path $p1) { $p1 } elseif (Test-Path $p2) { $p2 } else { $null }
if (-not $json) { $miss++; continue }
pwsh -File tools/Invoke-JsonSchemaLite.ps1 -JsonPath $json -SchemaPath docs/schemas/session-index-v1.schema.json
if ($LASTEXITCODE -eq 0) { $ok++ } else { $fail++ }
}