-
Notifications
You must be signed in to change notification settings - Fork 38
209 lines (162 loc) · 5.65 KB
/
main.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
name: CI
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install asdf
uses: asdf-vm/actions/setup@v3.0.2
- name: Install local CLI tooling
shell: bash
run: ./scripts/setup-asdf.sh
- name: Check Kotlin sources
run: ./scripts/code-style-kotlin.sh all
- name: Check Bash sources
run: ./scripts/code-style-bash.sh
- name: Check typos on code
uses: crate-ci/typos@v1.27.3
unit-tests:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: [code-quality]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Android Build
uses: ./.github/actions/setup-android-build
- name: Run unit tests
uses: nick-fields/retry@v3.0.0
with:
command: ./gradlew clean test --no-daemon
timeout_minutes: 8
max_attempts: 5
- name: Collect all test results from all modules
if: always()
run: ./scripts/aggregate-test-reports.sh build/test-reports
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4.4.3
with:
name: unit-tests-reports
path: build/test-reports
assemble-apk:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [code-quality]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Android Build
uses: ./.github/actions/setup-android-build
- name: Assemble APKs
run: ./gradlew app:assembleRelease -PtestMode=true --no-daemon
- name: Archive Release APK
if: success()
uses: actions/upload-artifact@v4.4.3
with:
name: release-apk
path: app/build/outputs/apk/release
- name: Archive R8 mappings
if: success()
uses: actions/upload-artifact@v4.4.3
with:
name: release-mappings
path: app/build/outputs/mapping/release
functional-tests:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [assemble-apk]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install asdf
uses: asdf-vm/actions/setup@v3.0.2
- name: Install local CLI tooling
shell: bash
run: ./scripts/setup-asdf.sh
- name: Fetch Instrumentation artefacts
uses: actions/download-artifact@v4.1.8
- name: Run E2E tests on mobile.dev clould
run: ./scripts/maestro.sh release-apk/app-release.apk
env:
MOBILE_DEV_CLOUD_TOKEN: ${{ secrets.MOBILE_DEV_CLOUD_TOKEN }}
instrumentation-tests:
runs-on: ubuntu-24.04
needs: [code-quality]
timeout-minutes: 20
strategy:
matrix:
feature: [ 'facts', 'search' ]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Fetch Instrumentation artefacts
uses: actions/download-artifact@v4.1.8
- name: Install asdf
uses: asdf-vm/actions/setup@v3.0.2
- name: Install local CLI tooling
run: ./scripts/setup-asdf.sh
- name: Setup Android Build
uses: ./.github/actions/setup-android-build
- name: Run instrumentation tests
run: ./gradlew features:${{ matrix.feature }}:testDebugWithEmulatorWtf
env:
EW_API_TOKEN: ${{ secrets.EMULATOR_WTF_TOKEN }}
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ matrix.feature }}-instrumentation-tests-reports
path: features/${{ matrix.feature }}/build/test-results
security-analysis:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: assemble-apk
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install asdf
uses: asdf-vm/actions/setup@v3.0.2
- name: Install local CLI tooling
run: ./scripts/setup-asdf.sh
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3.5.0
- name: Fetch APK from previous build
uses: actions/download-artifact@v4.1.8
- name: Compare APK with baseline
run: aaw compare -a release-apk/app-release.apk -b .config/norris-watchdog.toml
- name: Scan APK for vulnerabilities with Appsweep
uses: dotanuki-labs/appsweep-scan-action@v0.1.0
with:
archive-file: release-apk/app-release.apk
symbols: release-mappings/mapping.txt
wait-for-summary: true
env:
APPSWEEP_API_KEY: ${{ secrets.APP_SWEEP_TOKEN }}
test-results-analysis:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [unit-tests, instrumentation-tests, functional-tests]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Fetch all artefacts
uses: actions/download-artifact@v4.1.8
- name: Copy all test results
run: mkdir all-reports && mv *-tests-reports/ all-reports
- name: Report test results
uses: dorny/test-reporter@v1.9.1
with:
name: 'Test Reports'
reporter: java-junit
path: all-reports/**/*.xml