-
Notifications
You must be signed in to change notification settings - Fork 199
70 lines (61 loc) · 2.38 KB
/
screenshot-comparison.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: screenshot-comparison
on:
pull_request:
paths-ignore:
- 'app-ios/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: { }
jobs:
screenshot-comparison:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read # for clone
actions: write # for upload-artifact
checks: read # for wait-on-check-action
steps:
- name: Checkout for getting base branch HEAD commit
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ github.base_ref }}
- name: Get base branch HEAD commit for comparison
id: get_base_branch_head
run: echo "sha=$(git rev-parse origin/${{ github.base_ref }})" >> "$GITHUB_OUTPUT"
- name: Checkout merged commit with base and pull-request branch
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: ./.github/actions/setup-java
- name: Wait for base unit-test to succeed before downloading base branch screenshot artifact
uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc # v1.3.4
with:
ref: ${{ steps.get_base_branch_head.outputs.sha }}
check-name: 'unit-test'
repo-token: ${{ github.token }}
wait-interval: 10
- name: Download screenshot artifact from base branch for comparison
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3
continue-on-error: true
with:
name: test-reports
workflow: unit-test.yml
commit: ${{ steps.get_base_branch_head.outputs.sha }}
if_no_artifact_found: fail
- run: ./gradlew compareRoborazziDebug compareRoborazziDevDebug --stacktrace
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
name: screenshot-diff-reports
path: |
**/reports
**/build/outputs/roborazzi
retention-days: 30
- name: Save PR number for comment
if: ${{ github.event_name == 'pull_request' }}
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: pr
path: pr/