-
Notifications
You must be signed in to change notification settings - Fork 108
142 lines (125 loc) · 4.88 KB
/
android.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Android CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
# Key inspired from here -
# https://medium.com/@ychescale9/running-android-instrumented-tests-on-ci-from-bitrise-io-to-github-actions-a611e57ce71f
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Run Checks
run: ./gradlew check --stacktrace
paparazi-screenshot-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Branch
uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
# Key inspired from here -
# https://medium.com/@ychescale9/running-android-instrumented-tests-on-ci-from-bitrise-io-to-github-actions-a611e57ce71f
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Run Paparazzi Screenshot Tests
run: ./gradlew :showkase-screenshot-testing-paparazzi-sample:verifyPaparazziDebug -PuseKsp=true --stacktrace
- name: Upload Screenshot Test Report
uses: actions/upload-artifact@v3
if: always()
with:
name: reports
path: showkase-screenshot-testing-paparazzi-sample/build/reports/tests/testDebugUnitTest/
retention-days: 1
- name: Upload Screenshot Failure Differences
uses: actions/upload-artifact@v3
if: failure()
with:
name: reports
path: showkase-screenshot-testing-paparazzi-sample/out/failures/
retention-days: 1
ui-testing:
runs-on: macos-11
strategy:
matrix:
api-level: [ 26, 29 ]
target: [ default, google_apis ]
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Branch
uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
# Key inspired from here -
# https://medium.com/@ychescale9/running-android-instrumented-tests-on-ci-from-bitrise-io-to-github-actions-a611e57ce71f
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Run UI Tests w/ KAPT
uses: reactivecircus/android-emulator-runner@v2
with:
emulator-build: 7425822
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
script: ./gradlew connectedCheck --no-daemon --stacktrace --debug
- name: Run UI Tests w/ KSP
uses: reactivecircus/android-emulator-runner@v2
with:
emulator-build: 7425822
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
script: ./gradlew connectedCheck --no-daemon --stacktrace -PuseKsp=true --debug
- name: Run Screenshot Tests
uses: reactivecircus/android-emulator-runner@v2
with:
emulator-build: 7425822
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
script: ./gradlew executeScreenshotTests -PdirectorySuffix=Api${{ matrix.api-level }} -PprintBase64
- name: Upload screenshot testing report
uses: actions/upload-artifact@v3
with:
name: reports
path: sample/build/reports/shot/debug/Api${{ matrix.api-level }}/verification/
retention-days: 1
### Uncomment the jobs below if you want to generate and record screenshots. Once you download the
### artifact, place them under sample/screenshots/debug/
# - name: Record screenshots
# uses: reactivecircus/android-emulator-runner@v2
# with:
# emulator-build: 7425822
# api-level: ${{ matrix.api-level }}
# target: ${{ matrix.target }}
# arch: x86_64
# script: ./gradlew executeScreenshotTests -PdirectorySuffix=Api${{ matrix.api-level }} -Precord
#
# - name: Upload screenshots in an artifact
# uses: actions/upload-artifact@v3
# with:
# name: Api${{ matrix.api-level }}
# path: sample/screenshots/debug/Api${{ matrix.api-level }}
# retention-days: 1