Skip to content

Commit 60e7809

Browse files
authored
Pause RNTester visual regression checks on pull requests (#59629)
1 parent 9c7b0f5 commit 60e7809

2 files changed

Lines changed: 14 additions & 21 deletions

File tree

‎.github/workflows/test-all.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ jobs:
213213

214214
test_visual_ios_rntester:
215215
needs: test_ios_rntester
216-
if: ${{ needs.test_ios_rntester.result == 'success' }}
216+
# Pause visual regression on pull requests; keep main baselines up to date.
217+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.test_ios_rntester.result == 'success' }}
217218
uses: ./.github/workflows/visual-capture-rntester.yml
218219
with:
219220
platform: ios
@@ -419,7 +420,8 @@ jobs:
419420

420421
test_visual_android_rntester:
421422
needs: build_android
422-
if: ${{ needs.build_android.result == 'success' }}
423+
# Pause visual regression on pull requests; keep main baselines up to date.
424+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build_android.result == 'success' }}
423425
uses: ./.github/workflows/visual-capture-rntester.yml
424426
with:
425427
platform: android

‎.github/workflows/visual-compare-rntester.yml‎

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Trusted half of RNTester visual regression testing. Runs from the default
2-
# branch after Test All completes, including for pull requests from forks, and
3-
# compares whatever visual-capture-rntester.yml captured in that run. The
2+
# branch after Test All completes on main and compares whatever
3+
# visual-capture-rntester.yml captured in that run. The
44
# capture artifacts are treated as inert data: they are validated before any
55
# image is decoded, and nothing in them is executed.
66
#
7-
# Pull requests: compare with the baseline for the base commit (or its
8-
# nearest ancestor with one), upload a report, and set check runs.
9-
# Pushes to the default branch: as above, then publish the captures as the
10-
# immutable baseline for that commit.
7+
# Pull request comparisons are temporarily paused; pushes to the default
8+
# branch compare captures and publish the immutable baseline for that commit.
119
name: Visual Compare RNTester
1210

1311
on:
@@ -33,23 +31,16 @@ env:
3331
jobs:
3432
find_captures:
3533
# Test All can fail for reasons unrelated to rendering, so a failed run is
36-
# still compared. A platform with no capture is reported as such. Pushes
37-
# to other branches have no baseline to compare with or publish. Pull
38-
# requests into other branches are skipped in compare-run.js, because
39-
# workflow_run doesn't include the base branch of a pull request from a
40-
# fork. Nothing runs until the repository has GCP credentials configured.
34+
# still compared. A platform with no capture is reported as such. Only
35+
# main pushes run comparisons while pull request testing is paused.
36+
# Nothing runs until the repository has GCP credentials configured.
4137
if: |
4238
vars.VISUAL_GCP_PROJECT != '' &&
4339
vars.VISUAL_WORKLOAD_IDENTITY_PROVIDER != '' &&
4440
contains(fromJSON('["success", "failure"]'), github.event.workflow_run.conclusion) &&
45-
(
46-
github.event.workflow_run.event == 'pull_request' ||
47-
(
48-
github.event.workflow_run.event == 'push' &&
49-
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
50-
github.event.workflow_run.head_repository.full_name == github.repository
51-
)
52-
)
41+
github.event.workflow_run.event == 'push' &&
42+
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
43+
github.event.workflow_run.head_repository.full_name == github.repository
5344
runs-on: ubuntu-latest
5445
permissions:
5546
actions: read

0 commit comments

Comments
 (0)