|
1 | 1 | # Trusted half of RNTester visual regression testing. Runs from the default |
2 | | -# branch after Test All completes on main and compares whatever |
3 | | -# visual-capture-rntester.yml captured in that run. The |
| 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 |
4 | 4 | # capture artifacts are treated as inert data: they are validated before any |
5 | 5 | # image is decoded, and nothing in them is executed. |
6 | 6 | # |
7 | | -# Pull request comparisons are temporarily paused; pushes to the default |
8 | | -# branch compare captures and publish the immutable baseline for that commit. |
| 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. |
9 | 11 | name: Visual Compare RNTester |
10 | 12 |
|
11 | 13 | on: |
|
31 | 33 | jobs: |
32 | 34 | find_captures: |
33 | 35 | # Test All can fail for reasons unrelated to rendering, so a failed run is |
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. |
| 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. |
37 | 41 | if: | |
38 | 42 | vars.VISUAL_GCP_PROJECT != '' && |
39 | 43 | vars.VISUAL_WORKLOAD_IDENTITY_PROVIDER != '' && |
40 | 44 | contains(fromJSON('["success", "failure"]'), github.event.workflow_run.conclusion) && |
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 |
| 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 | + ) |
44 | 53 | runs-on: ubuntu-latest |
45 | 54 | permissions: |
46 | 55 | actions: read |
|
0 commit comments