Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ jobs:

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

test_visual_android_rntester:
needs: build_android
if: ${{ needs.build_android.result == 'success' }}
# Pause visual regression on pull requests; keep main baselines up to date.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build_android.result == 'success' }}
uses: ./.github/workflows/visual-capture-rntester.yml
with:
platform: android
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/visual-compare-rntester.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Trusted half of RNTester visual regression testing. Runs from the default
# branch after Test All completes, including for pull requests from forks, and
# compares whatever visual-capture-rntester.yml captured in that run. The
# branch after Test All completes on main and compares whatever
# visual-capture-rntester.yml captured in that run. The
# capture artifacts are treated as inert data: they are validated before any
# image is decoded, and nothing in them is executed.
#
# Pull requests: compare with the baseline for the base commit (or its
# nearest ancestor with one), upload a report, and set check runs.
# Pushes to the default branch: as above, then publish the captures as the
# immutable baseline for that commit.
# Pull request comparisons are temporarily paused; pushes to the default
# branch compare captures and publish the immutable baseline for that commit.
name: Visual Compare RNTester

on:
Expand All @@ -33,23 +31,16 @@ env:
jobs:
find_captures:
# Test All can fail for reasons unrelated to rendering, so a failed run is
# still compared. A platform with no capture is reported as such. Pushes
# to other branches have no baseline to compare with or publish. Pull
# requests into other branches are skipped in compare-run.js, because
# workflow_run doesn't include the base branch of a pull request from a
# fork. Nothing runs until the repository has GCP credentials configured.
# still compared. A platform with no capture is reported as such. Only
# main pushes run comparisons while pull request testing is paused.
# Nothing runs until the repository has GCP credentials configured.
if: |
vars.VISUAL_GCP_PROJECT != '' &&
vars.VISUAL_WORKLOAD_IDENTITY_PROVIDER != '' &&
contains(fromJSON('["success", "failure"]'), github.event.workflow_run.conclusion) &&
(
github.event.workflow_run.event == 'pull_request' ||
(
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
github.event.workflow_run.head_repository.full_name == github.repository
)
)
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
github.event.workflow_run.head_repository.full_name == github.repository
runs-on: ubuntu-latest
permissions:
actions: read
Expand Down
Loading