-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (96 loc) · 3.06 KB
/
android.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
name: Android CI
on:
push:
branches: [ "main" ]
paths:
- 'android/**'
pull_request:
branches: [ "main" ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: "checkout"
uses: actions/[email protected]
- name: Kotlin Linter
uses: vroy/gha-kotlin-linter@v4
build:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Delete unnecessary tools 🔧
uses: jlumbroso/[email protected]
with:
android: false # Don't remove Android tools
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY"
dotnet: true # rm -rf /usr/share/dotnet
haskell: true # rm -rf /opt/ghc...
swap-storage: true # rm -f /mnt/swapfile (4GiB)
docker-images: false # Takes 16s, enable if needed in the future
large-packages: false # includes google-cloud-sdk and it's slow
- name: Enable KVM group perms
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
ls /dev/kvm
- name: Checkout
uses: actions/[email protected]
- name: set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Set up Android SDK
uses: android-actions/[email protected]
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug
- name: Unit tests
run: ./gradlew testDebugUnitTest
- name: Run instrumented test
uses: ReactiveCircus/[email protected]
with:
arch: 'x86_64'
api-level: 33
script: ./gradlew connectedDebugAndroidTest
- name: Generate kover coverage report
run: ./gradlew koverXmlReportDebug
- name: Add coverage report to PR
id: kover
uses: mi-kas/[email protected]
with:
path: |
app/build/reports/kover/reportDebug.xml
core/data/build/reports/kover/reportDebug.xml
core/database/build/reports/kover/reportDebug.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: Code Coverage
update-comment: true
- name: Upload Test Reports Folder
uses: actions/[email protected]
if: ${{ always() }}
with:
name: reports
path: |
app/build/reports
app/build/test-results
core/data/build/reports
core/data/build/test-results
core/database/build/reports
core/database/build/test-results
report:
runs-on: ubuntu-latest
needs: build
if: ${{ always() }}
steps:
- name: Download Test Reports Folder
uses: actions/[email protected]
with:
name: reports
- name: Android Test Report
uses: asadmansr/[email protected]