Skip to content

Commit 301c631

Browse files
committed
Report render comparison artifacts from CI
1 parent 9be9d6b commit 301c631

6 files changed

Lines changed: 1048 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
permissions:
1010
contents: read
1111
checks: write
12+
pull-requests: write
1213

1314
concurrency:
1415
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -43,6 +44,70 @@ jobs:
4344
run: |
4445
.\Build\Agent\Summarize-NativeTestResults.ps1 -Configuration Debug
4546
47+
- name: Collect render comparison artifacts
48+
id: render_artifacts
49+
if: ${{ !cancelled() && failure() }}
50+
shell: pwsh
51+
run: .\Build\Agent\Collect-RenderArtifacts.ps1 -SearchRoot . -OutputDirectory .\Output\RenderArtifacts
52+
53+
- name: Upload render comparison artifacts
54+
id: upload_render_artifacts
55+
if: ${{ !cancelled() && steps.render_artifacts.outputs.has_artifacts == 'true' }}
56+
uses: actions/upload-artifact@v7
57+
with:
58+
name: render-comparison-artifacts-${{ github.run_id }}-${{ github.run_attempt }}
59+
path: Output/RenderArtifacts
60+
retention-days: 30
61+
if-no-files-found: error
62+
63+
- name: Summarize render comparison artifacts
64+
if: ${{ github.event_name == 'pull_request' && !cancelled() && (success() || steps.render_artifacts.outputs.has_artifacts == 'true') }}
65+
shell: pwsh
66+
continue-on-error: true
67+
env:
68+
ARTIFACT_URL: ${{ steps.upload_render_artifacts.outputs.artifact-url }}
69+
FAILURE_COUNT: ${{ steps.render_artifacts.outputs.failure_count }}
70+
HAS_ARTIFACTS: ${{ steps.render_artifacts.outputs.has_artifacts }}
71+
run: .\Build\Agent\Report-RenderArtifacts.ps1 -SkipComment
72+
73+
- name: Build render comparison failure comment
74+
id: render_failure_comment
75+
if: ${{ github.event_name == 'pull_request' && !cancelled() && steps.render_artifacts.outputs.has_artifacts == 'true' }}
76+
shell: pwsh
77+
env:
78+
ARTIFACT_URL: ${{ steps.upload_render_artifacts.outputs.artifact-url }}
79+
FAILURE_COUNT: ${{ steps.render_artifacts.outputs.failure_count }}
80+
HAS_ARTIFACTS: ${{ steps.render_artifacts.outputs.has_artifacts }}
81+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
82+
run: .\Build\Agent\Build-RenderArtifactComment.ps1
83+
84+
- name: Update render comparison PR comment for failures
85+
if: ${{ github.event_name == 'pull_request' && !cancelled() && steps.render_artifacts.outputs.has_artifacts == 'true' }}
86+
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
87+
with:
88+
header: fieldworks-render-comparison-artifacts
89+
path: ${{ steps.render_failure_comment.outputs.comment_path }}
90+
skip_unchanged: true
91+
92+
- name: Build render comparison resolved comment
93+
id: render_clean_comment
94+
if: ${{ github.event_name == 'pull_request' && !cancelled() && success() }}
95+
shell: pwsh
96+
env:
97+
GITHUB_TOKEN: ${{ github.token }}
98+
HAS_ARTIFACTS: false
99+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
100+
run: .\Build\Agent\Build-RenderArtifactComment.ps1
101+
102+
- name: Update render comparison PR comment for clean run
103+
if: ${{ github.event_name == 'pull_request' && !cancelled() && success() }}
104+
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
105+
with:
106+
header: fieldworks-render-comparison-artifacts
107+
only_update: true
108+
path: ${{ steps.render_clean_comment.outputs.comment_path }}
109+
skip_unchanged: true
110+
46111
- name: Upload TRX test results (managed)
47112
if: ${{ !cancelled() }}
48113
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)