-
Notifications
You must be signed in to change notification settings - Fork 119
133 lines (112 loc) · 3.28 KB
/
Copy pathci_android.yaml
File metadata and controls
133 lines (112 loc) · 3.28 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: ci_android
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
push:
branches:
- main
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 Unit Tests
run: ./gradlew test
collect_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Prepare App
uses: ./.github/composite/prepareApp
- 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/*/debug/*.apk"
instrumentation_test:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [ Conjugate, Keyboards ]
fail-fast: false
name: Run Android Instrumentation Tests (${{ matrix.flavor }})
timeout-minutes: 45
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: Pre-build Android Test APKs
run: ./gradlew assemble${{ matrix.flavor }}Debug assemble${{ matrix.flavor }}DebugAndroidTest
- 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
adb shell input keyevent 82
./gradlew connected${{ matrix.flavor }}DebugAndroidTest --stacktrace