Repository navigation
275 lines (231 loc) · 9 KB
/
Copy pathandroid.yml
File metadata and controls
275 lines (231 loc) · 9 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
name: Android CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
schedule:
- cron: '17 3 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: ./.github/actions/create-google-services
- name: Run tests
run: ./gradlew :app:testDebugUnitTest
- name: Build debug APK
run: ./gradlew assembleDebug
- name: Upload APK artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
retention-days: 14
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: ./.github/actions/create-google-services
- name: Run Kotlin formatting checks
run: ./gradlew ktlintCheck
- name: Run static analysis
run: ./gradlew detekt
- name: Run Android Lint
run: ./gradlew lint
- name: Upload lint report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: lint-report
path: app/build/reports/lint-results-debug.html
retention-days: 14
instrumentation-smoke:
if: github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
api-level: [28, 30, 36]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: ./.github/actions/create-google-services
- name: Enable KVM access
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run instrumentation smoke tests
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
disable-animations: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: >-
set -e;
trap 'adb logcat -d > "$GITHUB_WORKSPACE/instrumentation-smoke-logcat.txt" 2>&1 || true' EXIT;
for test_class in
com.kingpaging.qwelcome.ui.CustomerIntakeScreenTest
com.kingpaging.qwelcome.ui.templates.TemplateListScreenTest
com.kingpaging.qwelcome.ui.templates.TemplateEditorScreenTest
com.kingpaging.qwelcome.data.PreferencesToProtoMigrationTest
com.kingpaging.qwelcome.data.QrCodeImageServiceTest
com.kingpaging.qwelcome.ui.StartupRecoveryScreenTest
com.kingpaging.qwelcome.ui.UiDraftRestorationTest
com.kingpaging.qwelcome.smoke.ReleaseSmokeTest;
do ./gradlew :app:connectedDebugAndroidTest
"-Pandroid.testInstrumentationRunnerArguments.class=$test_class";
done
- name: Upload instrumentation smoke reports
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: instrumentation-smoke-reports-api-${{ matrix.api-level }}
path: |
app/build/reports/androidTests/connected/
app/build/outputs/androidTest-results/connected/
instrumentation-smoke-logcat.txt
if-no-files-found: warn
retention-days: 14
instrumentation-full:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
api-level: [28, 30, 36]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: ./.github/actions/create-google-services
- name: Enable KVM access
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run full instrumentation test suite
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
disable-animations: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: >-
set -e;
trap 'adb logcat -d > "$GITHUB_WORKSPACE/instrumentation-full-logcat.txt" 2>&1 || true' EXIT;
./gradlew :app:connectedDebugAndroidTest
- name: Upload full instrumentation reports
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: instrumentation-full-reports-api-${{ matrix.api-level }}
path: |
app/build/reports/androidTests/connected/
app/build/outputs/androidTest-results/connected/
instrumentation-full-logcat.txt
if-no-files-found: warn
retention-days: 14
instrumentation-minified:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: ./.github/actions/create-google-services
- name: Enable KVM access
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run release-derived R8 smoke tests
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2
with:
api-level: 36
target: google_apis
arch: x86_64
disable-animations: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: >-
set -e;
trap 'adb logcat -d > "$GITHUB_WORKSPACE/instrumentation-minified-logcat.txt" 2>&1 || true' EXIT;
./gradlew :app:connectedSmokeAndroidTest -PtestBuildType=smoke
-Pandroid.testInstrumentationRunnerArguments.class=com.kingpaging.qwelcome.smoke.ReleaseSmokeTest,com.kingpaging.qwelcome.navigation.DestinationViewModelScopeTest,com.kingpaging.qwelcome.data.QrCodeImageServiceTest
- name: Upload minified smoke reports and mapping
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: instrumentation-minified-reports
path: |
app/build/reports/androidTests/connected/
app/build/outputs/androidTest-results/connected/
app/build/outputs/mapping/smoke/
instrumentation-minified-logcat.txt
if-no-files-found: warn
retention-days: 14
- name: Upload debug-signed minified smoke APK
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: app-smoke-ci-only
path: app/build/outputs/apk/smoke/*.apk
retention-days: 14