Repository navigation
3030 lines (2706 loc) · 128 KB
/
Copy pathci.yml
File metadata and controls
3030 lines (2706 loc) · 128 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: Build and Test
on:
push:
branches: [ main, master ]
tags: [ 'v*' ]
pull_request:
branches: [ main, master ]
# Merge queue checks. Each merge group is validated like a pull request against the queue's base.
merge_group:
types: [ checks_requested ]
workflow_dispatch:
inputs:
local_ai_proof_baseline:
description: 'Optional full main SHA for before/after Local AI UI proof'
type: string
required: false
default: ''
workflow_call:
inputs:
promotion_alpha:
type: string
required: true
promotion_source_sha:
type: string
required: true
promotion_stable_tag:
type: string
required: true
permissions:
contents: read
actions: read
env:
OPENCLAW_RELEASE_SOURCE_SHA: ${{ inputs.promotion_source_sha || github.sha }}
OPENCLAW_RELEASE_REF: ${{ inputs.promotion_stable_tag && format('refs/tags/{0}', inputs.promotion_stable_tag) || github.ref }}
OPENCLAW_RELEASE_TAG: ${{ inputs.promotion_stable_tag || github.ref_name }}
# Release sources are already selected. Normalization can confuse release and MSIX reservation tags.
# Keep normalization for branch/PR builds, including synthetic merge refs.
GitVersion_NoNormalizeEnabled: ${{ (inputs.promotion_alpha != '' || startsWith(github.ref, 'refs/tags/v')) && 'true' || 'false' }}
GitVersion_NoFetchEnabled: ${{ (inputs.promotion_alpha != '' || startsWith(github.ref, 'refs/tags/v')) && 'true' || 'false' }}
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('{0}-{1}', github.ref, github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
change-classification:
runs-on: ubuntu-latest
outputs:
classification: ${{ steps.classify.outputs.classification }}
core_tests: ${{ steps.classify.outputs.core_tests }}
tray_tests: ${{ steps.classify.outputs.tray_tests }}
ui_tests: ${{ steps.classify.outputs.ui_tests }}
setup_e2e: ${{ steps.classify.outputs.setup_e2e }}
revocation_e2e: ${{ steps.classify.outputs.revocation_e2e }}
network_e2e: ${{ steps.classify.outputs.network_e2e }}
x64_release: ${{ steps.classify.outputs.x64_release }}
arm64_release: ${{ steps.classify.outputs.arm64_release }}
full: ${{ steps.classify.outputs.full }}
promotion_record: ${{ steps.promotion.outputs.record }}
gateway_version: ${{ steps.gateway.outputs.version }}
gateway_release: ${{ steps.gateway.outputs.release }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Bind alpha promotion to the approved source and pipeline
id: promotion
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
ALPHA_TAG: ${{ inputs.promotion_alpha }}
INPUT_SOURCE_SHA: ${{ inputs.promotion_source_sha }}
INPUT_STABLE_TAG: ${{ inputs.promotion_stable_tag }}
run: |
if ([string]::IsNullOrEmpty($env:ALPHA_TAG)) {
if ($env:INPUT_SOURCE_SHA -or $env:INPUT_STABLE_TAG) { throw 'Partial promotion inputs are not allowed.' }
exit 0
}
if ($env:INPUT_SOURCE_SHA -cnotmatch '\A[0-9a-f]{40}\z' -or -not $env:INPUT_STABLE_TAG) {
throw 'Promotion requires an exact source SHA and stable tag.'
}
if ($env:GITHUB_REPOSITORY -cne 'openclaw/openclaw-windows-node' -or
$env:GITHUB_REF -cne 'refs/heads/main' -or $env:GITHUB_EVENT_NAME -cne 'workflow_dispatch') {
throw 'Alpha promotion must be dispatched from canonical main.'
}
. ./scripts/AlphaPromotion.ps1
$record = Get-AlphaPromotion -AlphaTag $env:ALPHA_TAG -PipelineSha $env:GITHUB_SHA `
-ExpectedSourceSha $env:OPENCLAW_RELEASE_SOURCE_SHA -RequireApproval
if ($record.stableTag -cne $env:OPENCLAW_RELEASE_TAG) { throw 'Unexpected stable target.' }
"record=$($record | ConvertTo-Json -Compress)" >> $env:GITHUB_OUTPUT
- name: Classify changed paths
id: classify
shell: pwsh
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
run: |
$impactJson = ./scripts/Get-CiChangeClassification.ps1 `
-EventName $env:GITHUB_EVENT_NAME `
-BaseSha $env:PR_BASE_SHA `
-HeadSha $env:PR_HEAD_SHA
$impact = $impactJson | ConvertFrom-Json
if ($impact.classification -notin @("docs_only", "fast_only", "targeted", "full")) {
throw "Unexpected CI change classification '$($impact.classification)'."
}
"classification=$($impact.classification)" >> $env:GITHUB_OUTPUT
foreach ($lane in @(
"core_tests",
"tray_tests",
"ui_tests",
"setup_e2e",
"revocation_e2e",
"network_e2e",
"x64_release",
"arm64_release",
"full")) {
$value = ([bool]$impact.$lane).ToString().ToLowerInvariant()
"$lane=$value" >> $env:GITHUB_OUTPUT
"CI lane $lane`: $value" >> $env:GITHUB_STEP_SUMMARY
}
"CI change classification: $($impact.classification)" >> $env:GITHUB_STEP_SUMMARY
- name: Snapshot latest WSL Gateway baseline
id: gateway
if: ${{ steps.classify.outputs.setup_e2e == 'true' || steps.classify.outputs.revocation_e2e == 'true' || steps.classify.outputs.network_e2e == 'true' }}
shell: pwsh
run: ./scripts/Resolve-CiGateway.ps1
fast-validation:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Ensure .squad stays untracked
shell: bash
run: |
tracked_squad="$(git ls-files .squad)"
if [ -n "$tracked_squad" ]; then
echo "::error::.squad files must not be tracked by Git. Keep squad state local and ignored."
echo "$tracked_squad"
exit 1
fi
- name: Test repository triage automation and dashboard
run: node --test .github/scripts/repository-triage.test.cjs .github/extensions/openclaw-triage-dashboard/triage-state.test.mjs
- name: Test upstream welcome copy monitoring
run: node --test .github/scripts/welcome-content-notification.test.cjs
- name: Test mock Gateway screenshot report
shell: pwsh
run: |
npm ci --prefix .github/scripts/gateway-fixture-report --ignore-scripts --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
node --test .github/scripts/gateway-fixture-report/report.test.mjs
- name: Test hosted desktop preflight
shell: pwsh
run: ./scripts/test-ci-desktop-resolution.ps1
- name: Test native animation prerequisite
shell: pwsh
run: ./scripts/test-native-animation-preference.ps1
- name: Validate documentation
shell: pwsh
run: ./scripts/validate-docs.ps1
- name: Validate agent skills
shell: pwsh
run: ./scripts/validate-agent-skills.ps1
- name: Test agent skill validator
shell: pwsh
run: ./scripts/test-agent-skills-validator.ps1
# Always-on so pull requests that change only UI or Shared tests cannot skip the ratchet.
- name: Validate timing-sensitive test patterns
shell: pwsh
run: ./scripts/validate-test-timing-patterns.ps1
- name: Test proof results and local evidence
shell: pwsh
run: ./scripts/test-proof-evidence.ps1
- name: Test safe native failure metadata
shell: pwsh
run: ./scripts/test-ci-native-failure-metadata.ps1
- name: Test read-only agent readiness
shell: pwsh
run: ./scripts/test-agent-readiness.ps1
- name: Test native Gateway source build safety
shell: pwsh
run: ./scripts/test-native-gateway-source-build.ps1
- name: Test Gateway npm release selection
shell: pwsh
run: ./scripts/test-gateway-npm-release.ps1
- name: Test packaged Gateway provenance
shell: pwsh
run: ./scripts/test-gateway-packaged-release.ps1
- name: Validate CI change classifier
shell: pwsh
run: ./scripts/test-ci-change-classifier.ps1
- name: Validate CI Gate result contracts
shell: pwsh
run: ./scripts/test-ci-gate-results.ps1
- name: Test new-test soak selection
shell: pwsh
run: ./scripts/test-ci-changed-tests.ps1
- name: Test main failure watch
shell: pwsh
run: ./scripts/test-ci-main-failure-watch.ps1
- name: Validate CI workflow contracts
shell: pwsh
run: |
./scripts/test-ci-workflow-contract.ps1
./scripts/test-ci-crash-metadata-source.ps1
- name: Validate official Reactor package bootstrap
shell: pwsh
run: ./scripts/test-reactor-packages.ps1
- name: Validate MSIX CI artifacts
shell: pwsh
run: ./scripts/test-msix-ci-artifacts.ps1
- name: Validate developer migration test package
shell: pwsh
run: ./scripts/test-migration-test-msix.ps1
- name: Validate Store migration helper fixtures
shell: pwsh
run: .\scripts\test-store-migration-test-script.ps1
# installer.iss is only compiled for real in the tag-only release job, so a
# Pascal Script error would otherwise be found at release time. The runner image
# does not ship Inno Setup; the release job installs it the same way.
- name: Install Inno Setup
run: choco install innosetup -y --no-progress
- name: Compile installer script
shell: pwsh
run: ./scripts/Test-InstallerScriptCompiles.ps1 -RequireCompiler
- name: Validate central Store publication requests
shell: pwsh
run: ./scripts/test-store-publication-request.ps1
- name: Validate Store MSIX bundle construction
shell: pwsh
run: ./scripts/test-msix-bundle.ps1
- name: Validate MSIX version allocation
shell: pwsh
run: ./scripts/test-msix-versioning.ps1
- name: Validate MSIX preview source selection
shell: pwsh
run: ./scripts/test-msix-preview-source-version.ps1
- name: Validate signed Dev MSIX release assets
shell: pwsh
run: ./scripts/test-dev-msix-release.ps1
- name: Validate daily alpha release-line selection
shell: pwsh
run: ./scripts/test-daily-alpha-version.ps1
- name: Validate stable correction release ordering regressions
shell: pwsh
run: ./scripts/test-stable-correction-release-validator.ps1
- name: Validate release-candidate outcome classification
shell: pwsh
run: ./scripts/Resolve-ReleaseCandidateE2EOutcome.Tests.ps1
- name: Validate alpha promotion policy and workflow
shell: pwsh
run: ./scripts/test-alpha-promotion.ps1
- name: Validate alpha promotion GitVersion behavior
shell: pwsh
run: |
dotnet tool restore
if ($LASTEXITCODE -ne 0) { throw 'GitVersion restore failed.' }
./scripts/test-alpha-promotion-versioning.ps1
- name: Validate release branch GitVersion behavior
shell: pwsh
run: ./scripts/test-release-branch-versioning.ps1
proof-pool-contracts:
name: Proof-pool contracts
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Select proof-pool regression scope
id: proof_pool_regression
continue-on-error: true
shell: pwsh
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
run: |
$decision = ./scripts/Get-CiProofPoolRegressionDecision.ps1 `
-EventName $env:GITHUB_EVENT_NAME `
-BaseSha $env:PR_BASE_SHA `
-HeadSha $env:PR_HEAD_SHA
if ($decision -notin @("true", "false")) {
throw "Unexpected proof-pool regression decision '$decision'."
}
"run=$decision" >> $env:GITHUB_OUTPUT
- name: Validate proof-pool regressions
if: ${{ steps.proof_pool_regression.outcome != 'success' || steps.proof_pool_regression.outputs.run != 'false' }}
shell: pwsh
run: ./scripts/test-proof-pool-validator.ps1
metadata:
name: Release metadata
needs: change-classification
if: ${{ !cancelled() && needs.change-classification.result == 'success' && (needs.change-classification.outputs.x64_release == 'true' || needs.change-classification.outputs.arm64_release == 'true') }}
runs-on: windows-latest
outputs:
semVer: ${{ steps.release_version.outputs.semVer }}
majorMinorPatch: ${{ steps.release_version.outputs.majorMinorPatch }}
isPrerelease: ${{ steps.release_version.outputs.isPrerelease }}
isStableCorrection: ${{ steps.release_version.outputs.isStableCorrection }}
msixVersionInfo: ${{ steps.msix_preview.outputs.versionInfo }}
msixSourceVersion: ${{ steps.msix_preview.outputs.sourceVersion }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.promotion_source_sha || github.sha }}
persist-credentials: false
- &tag-version-source
name: Bind tagged versioning to the checked-out release
if: inputs.promotion_alpha == '' && startsWith(github.ref, 'refs/tags/v')
shell: pwsh
run: |
$head = git rev-parse HEAD
if ($LASTEXITCODE -ne 0 -or $head -cne $env:OPENCLAW_RELEASE_SOURCE_SHA) {
throw 'Release checkout does not match the selected source SHA.'
}
$tagSource = git rev-parse --verify "$($env:OPENCLAW_RELEASE_REF)^{commit}"
if ($LASTEXITCODE -ne 0 -or $tagSource -cne $head) {
throw 'Release tag does not match the selected source SHA.'
}
# A local release branch removes detached-HEAD ancestry ambiguity without moving any remote ref.
git switch --create "release/$($env:OPENCLAW_RELEASE_TAG)" $head
if ($LASTEXITCODE -ne 0) { throw 'Could not bind the checkout-only release branch.' }
- &promotion-version-tag
name: Create checkout-only stable tag for candidate versioning
if: inputs.promotion_alpha != ''
shell: pwsh
run: |
$existing = git rev-parse --verify --quiet "$($env:OPENCLAW_RELEASE_TAG)^{commit}"
if ($LASTEXITCODE -eq 0) {
if ($existing -cne $env:OPENCLAW_RELEASE_SOURCE_SHA) { throw 'Stable tag points to another candidate.' }
} else {
git -c tag.gpgsign=false tag $env:OPENCLAW_RELEASE_TAG $env:OPENCLAW_RELEASE_SOURCE_SHA
if ($LASTEXITCODE -ne 0) { throw 'Could not create the checkout-only versioning tag.' }
}
- name: Setup .NET 10
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.8.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v4
with:
disableNormalization: ${{ inputs.promotion_alpha != '' || startsWith(github.ref, 'refs/tags/v') }}
- name: Resolve release version
id: release_version
shell: pwsh
env:
GITVERSION_SEMVER: ${{ steps.gitversion.outputs.semVer }}
GITVERSION_MAJOR_MINOR_PATCH: ${{ steps.gitversion.outputs.majorMinorPatch }}
GH_TOKEN: ${{ github.token }}
run: |
$semVer = $env:GITVERSION_SEMVER
$majorMinorPatch = $env:GITVERSION_MAJOR_MINOR_PATCH
$isPrerelease = $semVer.Contains("-")
$isStableCorrection = $false
if ($env:OPENCLAW_RELEASE_REF.StartsWith("refs/tags/v", [StringComparison]::Ordinal)) {
$tagVersion = $env:OPENCLAW_RELEASE_TAG -replace '^v', ''
# Match every numeric suffix, including malformed ones such as -0 and
# -03, so the correction validator is the single authority that can
# accept or reject them.
$correction = [regex]::Match(
$tagVersion,
'^(?<base>(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))-(?<revision>\d+)$')
if ($correction.Success) {
$validation = .\scripts\Test-OpenClawStableCorrectionRelease.ps1 `
-Tag $env:OPENCLAW_RELEASE_TAG `
-GitHubToken $env:GH_TOKEN
$semVer = $tagVersion
$majorMinorPatch = $validation.BaseVersion
$isPrerelease = $false
$isStableCorrection = $true
} elseif ($semVer -ne $tagVersion) {
throw "GitVersion SemVer '$semVer' did not match tag '$tagVersion'."
}
}
"semVer=$semVer" >> $env:GITHUB_OUTPUT
"majorMinorPatch=$majorMinorPatch" >> $env:GITHUB_OUTPUT
"isPrerelease=$($isPrerelease.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
"isStableCorrection=$($isStableCorrection.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
- name: Resolve MSIX preview version
id: msix_preview
if: ${{ inputs.promotion_alpha == '' && !(github.repository == 'openclaw/openclaw-windows-node' && startsWith(github.ref, 'refs/tags/v') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')) }}
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$sourceVersion = .\scripts\Get-OpenClawMsixPreviewSourceVersion.ps1 `
-GitHubToken $env:GH_TOKEN
$info = .\scripts\Resolve-MsixPackageVersion.ps1 `
-SourceVersion $sourceVersion -SourceCommit $env:OPENCLAW_RELEASE_SOURCE_SHA `
-SourceRef $env:OPENCLAW_RELEASE_REF -Repository openclaw/openclaw-windows-node `
-GitHubToken $env:GH_TOKEN
"sourceVersion=$sourceVersion" >> $env:GITHUB_OUTPUT
"versionInfo=$($info | ConvertTo-Json -Depth 4 -Compress)" >> $env:GITHUB_OUTPUT
reserve-msix-version:
name: Reserve official MSIX version
needs: [change-classification, metadata]
if: ${{ !cancelled() && needs.metadata.result == 'success' && github.repository == 'openclaw/openclaw-windows-node' && (startsWith(github.ref, 'refs/tags/v') || inputs.promotion_alpha != '') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
runs-on: windows-latest
permissions:
contents: write
actions: read
outputs:
versionInfo: ${{ steps.reserve.outputs.versionInfo }}
sourceVersion: ${{ steps.reserve.outputs.sourceVersion }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Reserve or reuse release package version
id: reserve
shell: pwsh
env:
PROMOTION_ALPHA: ${{ inputs.promotion_alpha }}
PROMOTION_RECORD: ${{ needs.change-classification.outputs.promotion_record }}
SOURCE_VERSION: ${{ needs.metadata.outputs.semVer }}
GH_TOKEN: ${{ github.token }}
run: |
$promotionArguments = @{}
if ($env:PROMOTION_ALPHA) {
. ./scripts/AlphaPromotion.ps1
$record = Get-AlphaPromotion -AlphaTag $env:PROMOTION_ALPHA -PipelineSha $env:GITHUB_SHA `
-ExpectedSourceSha $env:OPENCLAW_RELEASE_SOURCE_SHA -RequireApproval
if (($record | ConvertTo-Json -Compress) -cne $env:PROMOTION_RECORD -or
$record.version -cne $env:SOURCE_VERSION -or
"refs/tags/$($record.stableTag)" -cne $env:OPENCLAW_RELEASE_REF) {
throw 'Promotion provenance changed before MSIX reservation.'
}
$promotionArguments.PromotionAlphaTag = $record.alphaTag
}
$info = .\scripts\Resolve-MsixPackageVersion.ps1 @promotionArguments `
-SourceVersion $env:SOURCE_VERSION -SourceCommit $env:OPENCLAW_RELEASE_SOURCE_SHA `
-SourceRef $env:OPENCLAW_RELEASE_REF -Repository $env:GITHUB_REPOSITORY -Reserve
"sourceVersion=$($info.sourceVersion)" >> $env:GITHUB_OUTPUT
"versionInfo=$($info | ConvertTo-Json -Depth 4 -Compress)" >> $env:GITHUB_OUTPUT
core-tests:
name: Core and CLI tests
needs: change-classification
if: ${{ !cancelled() && needs.change-classification.result == 'success' && needs.change-classification.outputs.core_tests == 'true' }}
runs-on: windows-latest
env:
OPENCLAW_CI_COLLECT_COVERAGE: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
OPENCLAW_REPO_ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.promotion_source_sha || github.sha }}
persist-credentials: false
- *tag-version-source
- *promotion-version-tag
- name: Setup .NET 10
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Configure core NuGet cache
# Keep the core graph out of the repository-wide NuGet cache used by every other lane.
shell: pwsh
run: '"NUGET_PACKAGES=$env:RUNNER_TEMP\openclaw-core-nuget-packages" >> $env:GITHUB_ENV'
- name: Cache NuGet packages
continue-on-error: true
uses: actions/cache@v6
with:
path: ${{ env.NUGET_PACKAGES }}
# SDK/config and imported MSBuild files can change restore behavior or shared package references.
# These project files are the complete transitive graph restored by the core lane.
key: >-
nuget-core-${{ runner.os }}-${{ hashFiles(
'global.json',
'NuGet.Config',
'Directory.Build.props',
'Directory.Build.targets',
'src/Directory.Build.props',
'src/Directory.Build.targets',
'tests/Directory.Build.props',
'tests/OpenClaw.TestSupport/Directory.Build.props',
'tests/OpenClaw.Shared.TestHost/Directory.Build.props',
'src/OpenClaw.Shared/OpenClaw.Shared.csproj',
'src/OpenClaw.Connection/OpenClaw.Connection.csproj',
'src/OpenClaw.Cli/OpenClaw.Cli.csproj',
'src/OpenClaw.WinNode.Cli/OpenClaw.WinNode.Cli.csproj',
'src/OpenClaw.FileWorker/OpenClaw.FileWorker.csproj',
'tests/OpenClaw.TestSupport/OpenClaw.TestSupport.csproj',
'tests/OpenClaw.Shared.TestHost/OpenClaw.Shared.TestHost.csproj',
'tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj',
'tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj',
'tests/OpenClaw.WinNode.Cli.Tests/OpenClaw.WinNode.Cli.Tests.csproj',
'tests/OpenClaw.FileWorker.Tests/OpenClaw.FileWorker.Tests.csproj'
) }}
- name: Restore core test projects
run: |
dotnet restore tests/OpenClaw.Shared.Tests
dotnet restore tests/OpenClaw.Connection.Tests
dotnet restore tests/OpenClaw.WinNode.Cli.Tests
dotnet restore tests/OpenClaw.FileWorker.Tests
- name: Install dotnet-coverage
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
run: dotnet tool install --global dotnet-coverage
- name: Build core test projects
run: |
dotnet build tests/OpenClaw.Shared.Tests -c Debug --no-restore
dotnet build tests/OpenClaw.Connection.Tests -c Debug --no-restore
dotnet build tests/OpenClaw.WinNode.Cli.Tests -c Debug --no-restore
dotnet build tests/OpenClaw.FileWorker.Tests -c Debug --no-restore
- name: Run Shared Tests
timeout-minutes: 15
env:
OPENCLAW_CI_STEP_TIMEOUT_MINUTES: '15'
OPENCLAW_RUN_INTEGRATION: 1
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Shared.Tests
-ResultsDirectory TestResults\Shared
-TrxFileName OpenClaw.Shared.Tests.trx
-HangTimeoutSeconds 300
- name: Run Connection Tests
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Connection.Tests
-ResultsDirectory TestResults\Connection
-TrxFileName OpenClaw.Connection.Tests.trx
- name: Run WinNode CLI Tests
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.WinNode.Cli.Tests
-ResultsDirectory TestResults\WinNodeCli
-TrxFileName OpenClaw.WinNode.Cli.Tests.trx
- name: Run File Worker Tests
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.FileWorker.Tests
-ResultsDirectory TestResults\FileWorker
-TrxFileName OpenClaw.FileWorker.Tests.trx
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-core
path: TestResults/
if-no-files-found: warn
# The tray lane is the sole writer of the shared NuGet key within a run.
# Other lanes restore it and fetch missing packages normally, without racing
# to archive the same multi-GB directory during post-job cleanup.
tray-tests:
name: Tray, setup, and integration tests
needs: change-classification
if: ${{ !cancelled() && needs.change-classification.result == 'success' && needs.change-classification.outputs.tray_tests == 'true' }}
runs-on: windows-latest
env:
OPENCLAW_CI_COLLECT_COVERAGE: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
OPENCLAW_REPO_ROOT: ${{ github.workspace }}
OPENCLAW_TRAY_DATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayTests
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.promotion_source_sha || github.sha }}
persist-credentials: false
- *tag-version-source
- *promotion-version-tag
- name: Setup .NET 10
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Cache NuGet packages
continue-on-error: true
uses: actions/cache@v6
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }}
restore-keys: nuget-${{ runner.os }}-
- name: Restore tray test projects
run: |
$ErrorActionPreference = 'Stop'
./scripts/Initialize-ReactorPackages.ps1
dotnet restore src/OpenClaw.Tray.WinUI -r win-x64
dotnet restore tests/OpenClaw.Tray.Tests -r win-x64
dotnet restore tests/OpenClaw.SetupEngine.Tests -r win-x64
dotnet restore tests/OpenClaw.Tray.IntegrationTests -r win-x64
- name: Install dotnet-coverage
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
run: dotnet tool install --global dotnet-coverage
- name: Build tray test projects
run: |
dotnet build src/OpenClaw.Tray.WinUI -c Debug -r win-x64 --no-restore
dotnet build tests/OpenClaw.Tray.Tests -c Debug -r win-x64 --no-restore
dotnet build tests/OpenClaw.SetupEngine.Tests -c Debug -r win-x64 --no-restore
dotnet build tests/OpenClaw.Tray.IntegrationTests -c Debug -r win-x64 --no-restore
- name: Run Tray Tests
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Tray.Tests
-ResultsDirectory TestResults\Tray
-TrxFileName OpenClaw.Tray.Tests.trx
-Runtime win-x64
# Tray integration tests gate on OPENCLAW_RUN_INTEGRATION; set it so the
# MCP-server and capability tests actually run.
- name: Run Tray Integration Tests
env:
OPENCLAW_RUN_INTEGRATION: 1
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Tray.IntegrationTests
-ResultsDirectory TestResults\TrayIntegration
-TrxFileName OpenClaw.Tray.IntegrationTests.trx
-Runtime win-x64
- name: Run SetupEngine Tests
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.SetupEngine.Tests
-ResultsDirectory TestResults\SetupEngine
-TrxFileName OpenClaw.SetupEngine.Tests.trx
-Runtime win-x64
- name: Test cleanup helper signing boundary
shell: pwsh
run: .\scripts\test-cleanup-host-signing.ps1
- name: Run Dev containment settings tests
run: >
dotnet test tests/OpenClaw.Tray.Tests
-c Debug -r win-x64 --no-restore -p:DevBuild=true
--filter "FullyQualifiedName~SettingsManagerIsolationTests|FullyQualifiedName~AppRefactorContractTests.SandboxPage_"
--results-directory TestResults\TrayDev
--logger "trx;LogFileName=OpenClaw.Tray.DevSettings.Tests.trx"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-tray
path: TestResults/
if-no-files-found: warn
ui-tests:
name: UI, functional, and accessibility tests
needs: change-classification
if: ${{ !cancelled() && needs.change-classification.result == 'success' && needs.change-classification.outputs.ui_tests == 'true' }}
runs-on: windows-latest
env:
OPENCLAW_CI_COLLECT_COVERAGE: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
OPENCLAW_REPO_ROOT: ${{ github.workspace }}
OPENCLAW_TRAY_DATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayUITests
OPENCLAW_TRAY_APPDATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayUITests-Roaming
OPENCLAW_TRAY_LOCALAPPDATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayUITests-Local
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.promotion_source_sha || github.sha }}
persist-credentials: false
- *tag-version-source
- *promotion-version-tag
- name: Setup .NET 10
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Cache NuGet packages
continue-on-error: true
uses: actions/cache/restore@v6
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }}
restore-keys: nuget-${{ runner.os }}-
- name: Verify native testhost exit diagnostics
shell: pwsh
run: ./scripts/test-ci-test-host-exit.ps1
- name: Restore UI test projects
run: |
$ErrorActionPreference = 'Stop'
./scripts/Initialize-ReactorPackages.ps1
dotnet restore tests/OpenClaw.Tray.UITests -r win-x64
dotnet restore tests/OpenClawTray.FunctionalUI.Tests -r win-x64
- name: Install dotnet-coverage
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
run: dotnet tool install --global dotnet-coverage
- name: Build UI test projects
id: ui-build
run: |
dotnet build tests/OpenClaw.Tray.UITests -c Debug -r win-x64 --no-restore
dotnet build tests/OpenClawTray.FunctionalUI.Tests -c Debug -r win-x64 --no-restore
# UI tests need a real visual tree AND a system-registered WindowsAppRuntime
# framework MSIX. The hosted runner image does not preinstall it, so install
# the runtime matching the repo-level WindowsAppSDK version.
- name: Install WindowsAppRuntime
id: ui-runtime
shell: pwsh
run: |
[xml]$props = Get-Content (Join-Path $env:GITHUB_WORKSPACE "Directory.Build.props")
$versionNode = $props.SelectSingleNode("/Project/PropertyGroup/MicrosoftWindowsAppSDKVersion")
if ($null -eq $versionNode -or [string]::IsNullOrWhiteSpace($versionNode.InnerText)) {
throw "MicrosoftWindowsAppSDKVersion was not found in Directory.Build.props"
}
$version = $versionNode.InnerText.Trim()
$channel = [regex]::Match($version, '^\d+\.\d+').Value
if ([string]::IsNullOrWhiteSpace($channel)) {
throw "Cannot derive WindowsAppRuntime channel from MicrosoftWindowsAppSDKVersion '$version'"
}
$url = "https://aka.ms/windowsappsdk/$channel/$version/windowsappruntimeinstall-x64.exe"
Write-Host "Installing WindowsAppRuntime $version from $url"
$exe = "$env:RUNNER_TEMP\WindowsAppRuntimeInstall.exe"
Invoke-WebRequest -Uri $url -OutFile $exe
& $exe --quiet
if ($LASTEXITCODE -ne 0) { throw "WindowsAppRuntimeInstall failed with exit code $LASTEXITCODE" }
- name: Configure UI desktop
id: ui-desktop
shell: pwsh
run: ./scripts/Set-CiDesktopResolution.ps1
- name: Run Functional UI Tests
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClawTray.FunctionalUI.Tests
-ResultsDirectory TestResults\FunctionalUI
-TrxFileName OpenClawTray.FunctionalUI.Tests.trx
-Runtime win-x64
- name: Mark Tray UI crash metadata window
id: tray-ui-crash-window
shell: pwsh
run: |
"startedUtc=$((Get-Date).ToUniversalTime().ToString('o'))" >> $env:GITHUB_OUTPUT
# The ordinary Tray UI suite is split by test class across this job and
# tray-ui-shard so neither serial run approaches its timeout. Both filters
# start with the same category exclusions; this job negates exactly the
# class list that tray-ui-shard selects, so together they run every test
# once. scripts/test-ci-workflow-contract.ps1 enforces the partition.
- name: Run Tray UI Tests
# -HangTimeoutSeconds still bounds a single stalled test.
timeout-minutes: 25
env:
OPENCLAW_CI_STEP_TIMEOUT_MINUTES: '25'
OPENCLAW_UI_TEST_RESOURCE_PROFILE: Standard
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Tray.UITests
-ResultsDirectory TestResults\TrayUI
-TrxFileName OpenClaw.Tray.UITests.trx
-Runtime win-x64
-Filter "Category!=Accessibility&Category!=NativeOnboardingProof&Category!=GatewayFixture&Category!=ProductionResources&Category!=AnimationPreferenceEnabled&Category!=AnimationPreferenceDisabled&FullyQualifiedName!~OpenClaw.Tray.UITests.WorkspaceWindowProofTests.&FullyQualifiedName!~OpenClaw.Tray.UITests.ReactorChatLayoutProofTests."
-HangTimeoutSeconds 300
-CollectNativeFailureMetadata
-CaptureHostExit
- name: Run steady-resource Automations UI tests
if: ${{ !cancelled() && steps.ui-build.outcome == 'success' && steps.ui-runtime.outcome == 'success' && steps.ui-desktop.outcome == 'success' }}
timeout-minutes: 15
env:
OPENCLAW_CI_STEP_TIMEOUT_MINUTES: '15'
OPENCLAW_UI_TEST_RESOURCE_PROFILE: Production
OPENCLAW_UI_TEST_APP_THEME: Light
OPENCLAW_REPO_ROOT: ${{ github.workspace }}
OPENCLAW_RUN_KEYBOARD_PROOF: '1'
OPENCLAW_GATEWAY_FIXTURE_SCREENSHOTS: '1'
OPENCLAW_GATEWAY_FIXTURE_ARTIFACTS: ${{ github.workspace }}\TestResults\AutomationsSteadyResources\captures
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Tray.UITests
-ResultsDirectory TestResults\AutomationsSteadyResources
-TrxFileName AutomationsSteadyResources.trx
-Runtime win-x64
-Filter "Category=ProductionResources&Category!=AnimationPreferenceEnabled&Category!=AnimationPreferenceDisabled"
-RequireAllTestsPassed
-HangTimeoutSeconds 300
-CollectNativeFailureMetadata
-CaptureHostExit
- name: Capture non-memory Tray UI crash metadata
if: always() && steps.tray-ui-crash-window.outcome == 'success'
shell: pwsh
env:
TRAY_UI_TEST_STARTED_UTC: ${{ steps.tray-ui-crash-window.outputs.startedUtc }}
run: |
# This helper belongs to the workflow, not the historical product checkout.
$helperSource = & git show "${env:GITHUB_SHA}:scripts/Capture-CiTestHostCrashMetadata.ps1"
if ($LASTEXITCODE -ne 0) { throw 'Could not load pipeline crash metadata helper.' }
$helperPath = Join-Path $env:RUNNER_TEMP 'Capture-CiTestHostCrashMetadata.ps1'
$helperSource | Set-Content -LiteralPath $helperPath -Encoding utf8
& $helperPath -StartedUtc $env:TRAY_UI_TEST_STARTED_UTC
- name: Run animation-enabled reveal proof
if: ${{ !cancelled() && steps.ui-build.outcome == 'success' && steps.ui-runtime.outcome == 'success' && steps.ui-desktop.outcome == 'success' }}
timeout-minutes: 5
env:
OPENCLAW_CI_STEP_TIMEOUT_MINUTES: '5'
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Tray.UITests
-ResultsDirectory TestResults\AnimationsEnabled
-TrxFileName AnimationsEnabled.trx
-Runtime win-x64
-Filter "Category=AnimationPreferenceEnabled"
-AnimationPreference Enabled
-RequireAllTestsPassed
-HangTimeoutSeconds 120
- name: Run animations-disabled behavior proof
if: ${{ !cancelled() && steps.ui-build.outcome == 'success' && steps.ui-runtime.outcome == 'success' && steps.ui-desktop.outcome == 'success' }}
timeout-minutes: 5
env:
OPENCLAW_CI_STEP_TIMEOUT_MINUTES: '5'
run: >
./scripts/Invoke-CiTest.ps1
-Project tests/OpenClaw.Tray.UITests
-ResultsDirectory TestResults\AnimationsDisabled
-TrxFileName AnimationsDisabled.trx
-Runtime win-x64
-Filter "FullyQualifiedName~PageHeroAnimationsDisabledTests"
-AnimationPreference Disabled
-RequireAllTestsPassed
-HangTimeoutSeconds 120
# Accessibility Insights CI pass: scans each page in the real app process.
- name: Run Accessibility Tests (Axe.Windows)
id: a11y
if: ${{ !cancelled() && steps.ui-build.outcome == 'success' && steps.ui-runtime.outcome == 'success' && steps.ui-desktop.outcome == 'success' }}
run: >
dotnet test tests/OpenClaw.Tray.UITests
--no-build
-c Debug
-r win-x64
--verbosity normal
--results-directory TestResults\Accessibility
--logger "trx;LogFileName=Accessibility.trx"
--filter Category=Accessibility
- name: Accessibility test summary
if: always() && steps.a11y.outcome != 'skipped'
shell: pwsh
run: |
if ("${{ steps.a11y.outcome }}" -eq "failure") {
"### :x: Accessibility violations detected" >> $env:GITHUB_STEP_SUMMARY
"" >> $env:GITHUB_STEP_SUMMARY
"Axe.Windows scans found WCAG violations in one or more pages." >> $env:GITHUB_STEP_SUMMARY
"See the `Accessibility.trx` artifact for details." >> $env:GITHUB_STEP_SUMMARY
} else {
"### :white_check_mark: Accessibility scans passed" >> $env:GITHUB_STEP_SUMMARY
"" >> $env:GITHUB_STEP_SUMMARY
"All pages passed Axe.Windows accessibility validation." >> $env:GITHUB_STEP_SUMMARY
}
- name: Verify DevBuild identity marker
shell: pwsh
run: |
dotnet build src/OpenClaw.Tray.WinUI -c Debug -r win-x64 -p:DevBuild=true --no-restore
$marker = Get-ChildItem -Path src\OpenClaw.Tray.WinUI\bin\Debug -Recurse -Filter app-identity.txt |
Where-Object { $_.FullName -like '*\win-x64\app-identity.txt' } |
Sort-Object LastWriteTimeUtc -Descending |
Select-Object -First 1
if ($null -eq $marker) {
throw "Dev identity marker was not produced by the DevBuild."
}
$identity = (Get-Content -LiteralPath $marker.FullName -Raw).Trim()
if ($identity -ne "dev") {
throw "Expected DevBuild identity marker 'dev' but found '$identity' at $($marker.FullName)."
}
Write-Host "DevBuild identity marker verified at $($marker.FullName): $identity"
- name: Capture Local AI hardware profiles before and after
# Runs after earlier UI test failures so they cannot hide this independent native proof.
if: ${{ !cancelled() && steps.ui-build.outcome == 'success' && steps.ui-runtime.outcome == 'success' && steps.ui-desktop.outcome == 'success' }}
timeout-minutes: 20
env:
LOCAL_AI_PROOF_BASELINE: ${{ inputs.local_ai_proof_baseline }}
run: ./scripts/Invoke-LocalAiVisualProof.ps1 -BaselineRef $env:LOCAL_AI_PROOF_BASELINE
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-ui
path: TestResults/
if-no-files-found: warn
# Second half of the ordinary Tray UI suite (see "Run Tray UI Tests" in
# ui-tests). It runs in parallel on its own runner and only builds what the
# Tray UI tests need. CI Gate requires it whenever ui-tests is required.
tray-ui-shard:
name: Tray UI tests (workspace and chat layout shard)
needs: change-classification
if: ${{ !cancelled() && needs.change-classification.result == 'success' && needs.change-classification.outputs.ui_tests == 'true' }}
runs-on: windows-latest
env:
OPENCLAW_CI_COLLECT_COVERAGE: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
OPENCLAW_REPO_ROOT: ${{ github.workspace }}
OPENCLAW_TRAY_DATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayUITests
OPENCLAW_TRAY_APPDATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayUITests-Roaming
OPENCLAW_TRAY_LOCALAPPDATA_DIR: ${{ github.workspace }}\TestData\OpenClawTrayUITests-Local
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.promotion_source_sha || github.sha }}
persist-credentials: false
- *tag-version-source
- *promotion-version-tag