-
-
Notifications
You must be signed in to change notification settings - Fork 6
113 lines (101 loc) · 2.82 KB
/
pr_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
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
name: Android CI (PR)
on:
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/[email protected]
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
files: |
.github/workflows/pr_ci.yml
gradle/libs.versions.toml
**/*.kt
**/*.kts
**/*.xml
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
check-codestyle:
needs: [ file-changes ]
runs-on: ubuntu-latest
if: needs.file-changes.outputs.any == 'true'
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Check codestyle
uses: gradle/[email protected]
with:
arguments: spotlessCheck
gradle-home-cache-cleanup: true
lint-debug:
needs: [ file-changes ]
runs-on: ubuntu-latest
if: needs.file-changes.outputs.any == 'true'
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Run lint on debug variants
uses: gradle/[email protected]
with:
arguments: lintDebug
gradle-home-cache-cleanup: true
build-apks:
needs: [ check-codestyle, lint-debug ]
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
if: needs.file-changes.outputs.any == 'true'
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Build debug APKs
uses: gradle/[email protected]
with:
arguments: assembleDebug
gradle-home-cache-cleanup: true
- name: Upload debug APKs
uses: actions/upload-artifact@v3
with:
name: Debug APKs
path: |
app/build/outputs/apk/free/debug/*.apk
app/build/outputs/apk/nonFree/debug/*.apk