-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (163 loc) · 4.22 KB
/
build.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: 🔨 Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build with gradle
run: ./gradlew build --stacktrace
- name: Run Testts
run: ./gradlew test
- name: Build Project
run: ./gradlew assemble
lint-check:
name: 🔍 Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Lint check
run: ./gradlew lint
- name: Generate lint report
uses: actions/upload-artifact@v2
with:
name: lint_report.html
path: app/build/reports/lint-results-debug.html
unit-tests:
name: 🧪 Unit Tests
needs: [ lint-check ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Execute unit tests
run: ./gradlew test --stacktrace
- name: Generate test report
uses: actions/upload-artifact@v2
with:
name: unit_tests_report.html
path: app/build/reports/tests/testDebugUnitTest/
# generate-apk:
# name: ⚙️Generate APK
# needs: [ build, lint-check, unit-tests ]
# runs-on: ubuntu-latest
# steps:
#
# - name: Checkout code
# uses: actions/checkout@v2
#
# - name: Set up JDK 11
# uses: actions/setup-java@v1
# with:
# java-version: '11'
#
# - name: Build debug apk
# run: ./gradlew assembleDebug --stacktrace
#
# - name: Upload debug apk
# uses: actions/upload-artifact@v1
# with:
# name: KmmCaching
# path: app/build/outputs/apk/debug/app-debug.apk
#
# create-release:
# name: 🎉 Create Release
# needs: [ generate-apk ]
# runs-on: ubuntu-latest
# steps:
#
# - name: Download APK from build
# uses: actions/download-artifact@v1
# with:
# name: Yummy
#
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
#
# - name: Upload Release APK
# id: upload_release_asset
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: KmmCaching/app-debug.apk
# asset_name: KmmCaching.apk
# asset_content_type: application/zip
#
# firebase-deploy:
# name: 📨 Deploy to Firebase App Distribution
# needs: [ generate-apk ]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v1
#
# - name: Download APK from build
# uses: actions/download-artifact@v1
# with:
# name: Android-CI-CD
#
# - name: Upload Artifact to Firebase App Distribution
# uses: wzieba/[email protected]
# with:
# appId: ${{secrets.FIREBASE_APP_ID}}
# token: ${{secrets.FIREBASE_TOKEN}}
# groups: testers
# file: Android-CI-CD/app-debug.apk
# playstore-deploy:
# name: 🚀 Deploy to Play Store
# needs: [ generate-apk ]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v1
#
# send-message:
# name: 📢 Send Message
# needs: [ create-release, firebase-deploy, playstore-deploy ]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v1
#name: Android Build
#
#on: pull_request
#
#jobs:
# build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v1
#
# - name: Set Up JDK
# uses: actions/setup-java@v1
# with:
# java-version: 11
#
# - name: Run Tests
# run: ./gradlew test
#
# - name: Build Project
# run: ./gradlew assemble
#
#