-
Notifications
You must be signed in to change notification settings - Fork 50
85 lines (69 loc) · 2.43 KB
/
android_ci.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
name: Android CI
on:
pull_request:
branches:
- main
types: [opened, reopened, synchronize]
jobs:
lint:
runs-on: ubuntu-latest
name: Run lint and detekt
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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
- name: prepare app
uses: ./.github/composite/prepareApp
- name: Run ktlint
run: ./gradlew test
coverage:
runs-on: ubuntu-latest
name: Run coverage
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: prepare app
uses: ./.github/composite/prepareApp
- name: Generate coverage report
run: ./gradlew jacocoCoreDebugCodeCoverage -x connectedCoreDebugAndroidTest
- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
${{ github.workspace }}/**/jacocoCoreDebugCodeCoverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
title: Code Coverage
update-comment: true
debug-mode: true
build:
runs-on: ubuntu-latest
name: build app
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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"