diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 12e4d50c79d..4c50e91a465 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -171,8 +171,7 @@ jobs: test_visual_ios_rntester: needs: test_ios_rntester - # 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' }} + if: ${{ needs.test_ios_rntester.result == 'success' }} uses: ./.github/workflows/visual-capture-rntester.yml with: platform: ios @@ -386,8 +385,7 @@ jobs: test_visual_android_rntester: needs: build_android - # 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' }} + if: ${{ needs.build_android.result == 'success' }} uses: ./.github/workflows/visual-capture-rntester.yml with: platform: android diff --git a/.github/workflows/visual-compare-rntester.yml b/.github/workflows/visual-compare-rntester.yml index 986a4d50a16..fc3b753df8e 100644 --- a/.github/workflows/visual-compare-rntester.yml +++ b/.github/workflows/visual-compare-rntester.yml @@ -1,11 +1,13 @@ # Trusted half of RNTester visual regression testing. Runs from the default -# branch after Test All completes on main and compares whatever -# visual-capture-rntester.yml captured in that run. The +# branch after Test All completes, including for pull requests from forks, 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 request comparisons are temporarily paused; pushes to the default -# branch compare captures and publish the immutable baseline for that commit. +# 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. name: Visual Compare RNTester on: @@ -31,16 +33,23 @@ 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. Only - # main pushes run comparisons while pull request testing is paused. - # Nothing runs until the repository has GCP credentials configured. + # 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. if: | vars.VISUAL_GCP_PROJECT != '' && vars.VISUAL_WORKLOAD_IDENTITY_PROVIDER != '' && contains(fromJSON('["success", "failure"]'), github.event.workflow_run.conclusion) && - 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 == '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 + ) + ) runs-on: ubuntu-latest permissions: actions: read