This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (67 loc) · 2.34 KB
/
ci-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
name: Test Builds ## name of the workflow
on: pull_request ## trigger the workflow on pull request
jobs:
#<<android app build>>
android-build:
name: Android Build
runs-on: ubuntu-latest
steps:
#checkout the code
- name: Check out Git repository
uses: actions/checkout@v2
#setup java
- name: Set up our JDK environment
uses: actions/[email protected]
with:
java-version: 11.0.19
#setup node
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
#install dependencies
- name: Install dependencies
run: yarn install --frozen-lockfile
#run tests and coverage
- name: Run tests and coverage
run: yarn test && yarn test:coverage
#upload coverage reports to codecov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
#gradle setup
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
#build android app
- name: Generate App APK
run: |
cd android && ./gradlew assembleRelease --no-daemon
## sign generated apk
- name: Sign APK
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
alias: ${{ secrets.ANDROID_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
#upload generated apk
- uses: actions/upload-artifact@v3
with:
name: android-build-release
path: android/app/build/outputs/apk/release