-
-
Notifications
You must be signed in to change notification settings - Fork 446
179 lines (143 loc) · 4.83 KB
/
android-integration.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
name: Android Integration
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
env:
JAVA_VERSION: "17"
JAVA_DISTR: 'adopt'
jobs:
static_analysis:
name: "🔍 Static analysis (Detekt)"
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTR }}
java-version: ${{ env.JAVA_VERSION }}
- name: Run detekt
uses: gradle/[email protected]
with:
arguments: detekt
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: ${{ github.workspace }}/build/reports/detekt/detekt.sarif
checkout_path: ${{ github.workspace }}
test:
name: "🤖 Unit Tests"
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTR }}
java-version: ${{ env.JAVA_VERSION }}
- name: Run unit tests
uses: gradle/[email protected]
with:
arguments: >
testObfPlaystoreDebugUnitTest
testOffPlaystoreDebugUnitTest
testOpfPlaystoreDebugUnitTest
testOpffPlaystoreDebugUnitTest
assemble_apk:
name: "📦 Assemble APKs"
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTR }}
java-version: ${{ env.JAVA_VERSION }}
- name: Workaround for Android Gradle Plugin issue
run: 'echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" > local.properties'
- name: Assemble debug APKs
uses: gradle/[email protected]
with:
arguments: assembleDebug
- name: Upload OBF APKs
uses: actions/upload-artifact@v3
with:
name: OBF
path: |
./app/build/outputs/apk/obfPlaystore/debug/app-obf-playstore-debug.apk
./app/build/outputs/apk/obfFdroid/debug/app-obf-fdroid-debug.apk
- name: Upload OFF APK
uses: actions/upload-artifact@v3
with:
name: OFF
path: |
./app/build/outputs/apk/offPlaystore/debug/app-off-playstore-debug.apk
./app/build/outputs/apk/offFdroid/debug/app-off-fdroid-debug.apk
- name: Upload OPF APK
uses: actions/upload-artifact@v3
with:
name: OPF
path: |
./app/build/outputs/apk/opfPlaystore/debug/app-opf-playstore-debug.apk
./app/build/outputs/apk/opfFdroid/debug/app-opf-fdroid-debug.apk
- name: Upload OPFF APK
uses: actions/upload-artifact@v3
with:
name: OPFF
path: |
./app/build/outputs/apk/opffPlaystore/debug/app-opf-playstore-debug.apk
./app/build/outputs/apk/opffFdroid/debug/app-opff-fdroid-debug.apk
lint_off:
name: "🔍 Android Lint"
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTR }}
java-version: ${{ env.JAVA_VERSION }}
- name: Workaround for Android Gradle Plugin issue
run: "echo \"ndk.dir=${ANDROID_HOME}/ndk-bundle\" > local.properties"
- name: Increase gradle daemon memory
run: "echo \"org.gradle.jvmargs=-Xmx4096m\" >> gradle.properties"
- name: Lint sources
uses: gradle/[email protected]
with:
arguments: lint --stacktrace
- name: Generate GitHub annotations
uses: yutailang0119/action-android-lint@v3
with:
report-path: ./app/build/reports/lint-results-offPlaystoreDebug.xml
build_deploy_pages:
name: "🚀 Deploy Documentation to GitHub Pages"
runs-on: ubuntu-20.04
# Only on successful push event
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
needs:
- assemble_apk
- test
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTR }}
java-version: ${{ env.JAVA_VERSION }}
- name: Generate documentation
uses: gradle/[email protected]
with:
arguments: dokkaHtml
- name: Deploy documentation to Github Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: app/build/dokka/html/