-
Notifications
You must be signed in to change notification settings - Fork 104
133 lines (112 loc) · 4.16 KB
/
android_ci.yml
File metadata and controls
133 lines (112 loc) · 4.16 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
name: Android CI
on:
pull_request:
branches:
- main
types: [opened, reopened, synchronize]
permissions:
pull-requests: write
contents: read
jobs:
lint:
runs-on: ubuntu-latest
name: Run Ktlint and Detekt
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Prepare App
uses: ./.github/composite/prepareApp
- name: Run Ktlint
run: ./gradlew lintKotlin
- name: Run Detekt
run: ./gradlew detekt
test:
runs-on: ubuntu-latest
name: Run Tests
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Prepare App
uses: ./.github/composite/prepareApp
- name: Run Ktlint
run: ./gradlew test
collect_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant Execute Permission for Gradle Wrapper
run: chmod +x gradlew
- name: Get Coverage
run: ./gradlew koverReport
- name: Run File-wise Coverage Parser Script
run: python3 scripts/coverage_parser.py
build:
runs-on: ubuntu-latest
name: build app
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Prepare App
uses: ./.github/composite/prepareApp
- name: Build App
run: ./gradlew assembleDebug
- name: Upload Debug APK
uses: actions/upload-artifact@v4
if: success()
with:
name: latest-apk
path: "app/build/outputs/apk/core/debug/app-core-debug.apk"
instrumentation_test:
runs-on: ubuntu-latest
name: Run Android Instrumentation Tests
timeout-minutes: 50
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Prepare App
uses: ./.github/composite/prepareApp
- name: Enable KVM Group Permissions
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 UI Tests on Emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
target: google_apis
arch: x86_64
profile: Nexus 6
ram-size: 2048M
heap-size: 512M
disk-size: 6000M
emulator-options: "-no-window -no-audio -no-boot-anim -camera-back none -camera-front none -gpu swiftshader_indirect -no-snapshot -wipe-data -accel on"
disable-animations: true
force-avd-creation: false
script: |
adb wait-for-device
sleep 30
adb shell input keyevent 82
adb shell settings put global window_animation_scale 0.0
adb shell settings put global transition_animation_scale 0.0
adb shell settings put global animator_duration_scale 0.0
adb shell pm list packages >/dev/null
sleep 10
adb shell getprop sys.boot_completed
./gradlew connectedConjugateDebugAndroidTest --stacktrace
./gradlew connectedKeyboardsDebugAndroidTest --stacktrace