forked from AnySoftKeyboard/AnySoftKeyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
318 lines (305 loc) · 11.3 KB
/
checks.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
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
---
name: checks
on:
push:
paths-ignore:
- deployment/halt_deployment_marker
branches:
- main
- 'release-branch-*-v*.*-r*'
pull_request:
paths-ignore:
- deployment/halt_deployment_marker
branches:
- '*'
env:
TERM: dumb
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
GRADLE_USER_HOME: ".github_cache_gradle/user_home/"
GRADLE_HOME: ".github_cache_gradle/gradle_home/"
TMPDIR: "/tmp"
jobs:
js-checks:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- uses: pnpm/[email protected]
with:
version: 8.6.9
run_install: true
- uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
cache: 'pnpm'
- run: pnpm lint
- run: pnpm pretty
- run: pnpm build
- run: pnpm test
static-checks:
runs-on: ubuntu-22.04
container: ghcr.io/menny/android_ndk:1.20.0
timeout-minutes: 15
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- uses: actions/[email protected]
with:
path: .github_cache_gradle/
key: global-v9-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}
restore-keys: |
global-v9
- name: setup
run: ./scripts/ci/ci_setup.sh
- name: check
run: ./scripts/ci/ci_check.sh
- name: check-all-yamls
run: ./scripts/ci/ci_check_yamls.sh
- name: verify-version-classes-greps
run: ./scripts/ci/third-party-update/verify-third-party-update-greps.sh
- name: fix-fs
if: always()
run: ./scripts/ci/ci_fix_fs.sh
- uses: ./.github/actions/collect-reports
if: always()
with:
file_pattern: checkstyle*.html
output_folder: collected_reports/checkstyle
- uses: actions/[email protected]
if: always()
continue-on-error: true
with:
name: checks-reports
path: collected_reports
linters:
runs-on: ubuntu-22.04
container: ghcr.io/menny/android_ndk:1.20.0
timeout-minutes: 20
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- uses: actions/[email protected]
with:
path: .github_cache_gradle/
key: global-v9-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}
restore-keys: |
global-v9
- name: setup
run: ./scripts/ci/ci_setup.sh
- name: check
run: ./scripts/ci/ci_check_lint.sh
- name: check-oom-due-to-lint-issue
if: always()
continue-on-error: true
run: |
echo "repo ls:"
ls -al
echo "logs ls:"
ls /var/log
grep -i 'killed process' /var/log/messages || true
grep -i 'killed process' /var/log/syslog || true
grep -i 'oom' /var/log/messages || true
grep -i 'oom' /var/log/syslog || true
grep -i 'out of memory' /var/log/messages || true
grep -i 'out of memory' /var/log/syslog || true
- name: fix-fs
if: always()
run: ./scripts/ci/ci_fix_fs.sh
- uses: ./.github/actions/collect-reports
if: always()
with:
file_pattern: lint-results-*.html
output_folder: collected_reports/lint
- uses: ./.github/actions/collect-reports
if: always()
with:
file_pattern: java_*.hprof
output_folder: oom_dumps
- uses: actions/[email protected]
if: always()
continue-on-error: true
with:
name: linters-reports
path: collected_reports
tests:
runs-on: ubuntu-22.04
container: ghcr.io/menny/android_ndk:1.20.0
timeout-minutes: 15
strategy:
matrix:
shard_variant: [addons_0, addons_1, addons_2, app, app_all_sdks, app_all_addons, non_app]
include:
- extra_args: ""
tasks: "testDebugUnitTest,testDebugUnitTestCoverage"
- shard_variant: app_all_sdks
tasks: "testDebugUnitTest"
extra_args: "--tests=\"*AllSdkTest*\" ime:app:testDebugUnitTestCoverage"
actual_shard: app
- shard_variant: app
tasks: "testDebugUnitTest"
extra_args: "-PexcludeTestClasses=\"**/*AllSdkTest*\" ime:app:testDebugUnitTestCoverage"
- shard_variant: app_all_addons
extra_args: "--tests=\"*LoadedKeyboardsVerificationTest*\" ime:app:testAllAddOnsUnitTestCoverage"
tasks: "testAllAddOnsUnitTest"
actual_shard: app
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- uses: actions/[email protected]
with:
path: .github_cache_gradle/
key: tests-v9-${{ matrix.actual_shard }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}
restore-keys: |
tests-v9-${{ matrix.actual_shard }}
global-v9
- name: setup
run: ./scripts/ci/ci_setup.sh
- name: setup robolectric
run: ./scripts/download_robolectric_jars_to_machine.sh
- name: generate projects list for sharding
run: ./gradlew projects | grep Project > /tmp/projects.lst
- name: shard
run: python3 scripts/modules_sharder.py /tmp/projects.lst "$PWD" ${{ matrix.actual_shard || matrix.shard_variant }} ${{ matrix.tasks }} /tmp/gradle.tasks.lst
- name: tests
run: ./gradlew $(cat /tmp/gradle.tasks.lst) ${{ matrix.extra_args }}
- uses: ./.github/actions/codecov
- name: fix-fs
if: always()
run: ./scripts/ci/ci_fix_fs.sh
- uses: ./.github/actions/collect-reports
if: always()
with:
file_pattern: "**/build/reports/tests/**"
- uses: actions/[email protected]
if: always()
continue-on-error: true
with:
name: tests-${{ matrix.shard_variant }}
path: collected_reports
- uses: actions/[email protected]
if: always()
continue-on-error: true
with:
name: tests-build-logging-${{ matrix.shard_variant }}
path: build/build-logging
deploy-dry-run:
runs-on: ubuntu-22.04
container: ghcr.io/menny/android_ndk:1.20.0
timeout-minutes: 30
env:
KEY_STORE_FILE_PASSWORD: password
KEY_STORE_FILE_DEFAULT_ALIAS_PASSWORD: alias_password
strategy:
matrix:
shard_type: [binaries_0, binaries_1, binaries_2, app]
include:
- supports_canary: false
supports_logo: true
- shard_type: app
supports_canary: true
supports_logo: false
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- uses: actions/[email protected]
with:
path: .github_cache_gradle/
key: deploy-v9-${{ matrix.shard_type }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}
restore-keys: |
deploy-v9-${{ matrix.shard_type }}
global-v9
- name: setup
run: ./scripts/ci/ci_setup.sh
- name: generate projects list for sharding
run: ./gradlew projects | grep Project > /tmp/projects.lst
- name: addons-logos
if: ${{ matrix.supports_logo }}
run: |
python3 scripts/modules_sharder.py /tmp/projects.lst "$PWD" ${{ matrix.shard_type }} generateStoreLogoIcon /tmp/gradle.tasks_logo.lst
./gradlew $(cat /tmp/gradle.tasks_logo.lst)
- name: setup-keystore
run: |
mkdir -p /root/.android/ || true
cp ./.github/actions/deploy/debug.keystore /root/.android/
cp .github/actions/deploy/release_test.keystore /tmp/anysoftkeyboard.keystore
- name: shard
run: |
python3 scripts/modules_sharder.py /tmp/projects.lst "$PWD" ${{ matrix.shard_type }} assembleRelease /tmp/gradle.tasks_assemble.lst
python3 scripts/modules_sharder.py /tmp/projects.lst "$PWD" ${{ matrix.shard_type }} bundleRelease,signDebugBundle /tmp/gradle.tasks_bundle.lst
python3 scripts/modules_sharder.py /tmp/projects.lst "$PWD" ${{ matrix.shard_type }} generateReleasePlayResources /tmp/gradle.tasks_play.lst
- name: dry-run-release-build
run: |
./gradlew -PwithAutoVersioning -DdeployChannel=production -PonlyPublishSupporting=production \
$(cat /tmp/gradle.tasks_assemble.lst)
./gradlew -PwithAutoVersioning -DdeployChannel=production -PonlyPublishSupporting=production \
$(cat /tmp/gradle.tasks_bundle.lst)
./gradlew -PwithAutoVersioning -DdeployChannel=production -PonlyPublishSupporting=production \
$(cat /tmp/gradle.tasks_play.lst)
- name: dry-run-canary-build
if: ${{ matrix.supports_canary }}
run: |
python3 scripts/modules_sharder.py /tmp/projects.lst "$PWD" ${{ matrix.shard_type }} assembleCanary,bundleCanary,generateCanaryPlayResources /tmp/gradle.tasks_canary.lst
./gradlew -PwithAutoVersioning -DdeployChannel=canart -PonlyPublishSupporting=canary \
$(cat /tmp/gradle.tasks_canary.lst)
- name: fix-fs
if: always()
run: ./scripts/ci/ci_fix_fs.sh
- uses: actions/[email protected]
continue-on-error: true
with:
name: fdroid-metadata-dry-run-${{ matrix.shard_type }}
path: outputs/fdroid
all-green-requirement:
needs: [static-checks, linters, tests, deploy-dry-run, js-checks]
runs-on: ubuntu-22.04
steps:
- name: ready
run: echo "DONE"
deploy-request:
if: github.event_name == 'push'
needs: [all-green-requirement]
runs-on: ubuntu-22.04
container: ghcr.io/menny/android_base:1.20.0
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- uses: ./.github/actions/deploy-request
name: request-new-deploys
with:
sha: ${{ github.sha }}
ref: ${{ github.ref }}
new_deploy: true
api_username: ${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }}
api_token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
merge-to-main:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-branch-')
needs: [all-green-requirement]
runs-on: ubuntu-22.04
container: ghcr.io/menny/android_base:1.20.0
steps:
- uses: actions/[email protected]
with:
token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
fetch-depth: 0
ref: main
- name: create-merge-commit
run: ./scripts/ci/ci_merge_to_default_branch.sh ${{ github.ref }}
- name: Create pull request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
commit-message: 'Merge to default branch from ${{ github.ref_name }}.'
title: 'Automated Merge to default branch from ${{ github.ref_name }}.'
committer: 'Polyglot <[email protected]>'
author: 'Polyglot <[email protected]>'
body: 'Generated from commit ${{ github.sha }} on ${{ github.ref }}.'
team-reviewers: maintainers
branch: 'bot-pr/merge-to-default-branch-from-${{ github.ref_name }}'
base: main
delete-branch: true