-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (92 loc) · 3.07 KB
/
android_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
# This is a basic workflow to help you get started with Actions
name: Android Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "lint-build"
lint-build:
name: Run lint check
#The type of runner that the job will run on
runs-on: ubuntu-latest
#Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout code for lint build
uses: actions/checkout@v2
- name: Run Lint
run: ./gradlew lintDebug
- name: Upload lint report
uses: actions/upload-artifact@v2
with:
name: Lint Report
path: app/build/reports/lint-results-debug.html
ui-testing:
name: Run UI tests
needs: [lint-build]
runs-on: macos-latest
continue-on-error: true
steps:
- name: Checkout code for UI test
uses: actions/checkout@v2
- name: Run UI Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: |
adb logcat -c
adb logcat &./gradlew connectedDebugAndroidTest
- name: Upload ui test report
uses: actions/upload-artifact@v2
with:
name: UI Test Report
path: app/build/reports/androidTests/connected/
package-debug-apk:
name: Generate debug apk
needs: [ui-testing]
runs-on: ubuntu-latest
steps:
- name: Checkout code for debug release
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build debug APK
run: ./gradlew assembleDebug --stacktrace
- name: Upload debug APK
uses: actions/upload-artifact@v2
with:
name: inews-debug.apk
path: app/build/outputs/apk/debug/app-debug.apk
package-release-apk:
needs: [package-debug-apk]
name: Generate release apk
runs-on: ubuntu-latest
steps:
- name: Checkout code for app release
uses: actions/checkout@v2
- name: Generate release APK
run: ./gradlew assembleRelease --stacktrace
- name: Sign APK with keystore
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEY_STORE }}
alias: ${{ secrets.KEY_STORE_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASS }}
keyPassword: ${{ secrets.KEY_STORE_PASS }}
env:
BUILD_TOOLS_VERSION: "30.0.2"
- name: Upload release APK
uses: actions/upload-artifact@v2
with:
name: inews-release.apk
path: ${{steps.sign_app.outputs.signedReleaseFile}}