-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (94 loc) · 4.68 KB
/
dev_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
# This is a workflow to run Unit and Android tests and generate code coverage reports
# It also uploads the reports to Codecov for later access
name: CI Dev Build
on:
# Triggers the workflow on push or pull request on the dev branch
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
build:
name: Build, test and upload code coverage
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
# This step installs JDK 17 using the Zulu distribution. It's necessary for building the app.
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
# Loads the Google Services configuration file from a secret, decodes it, and saves it to the app directory.
# This file is essential for making Firebase services work into the app.
- name: Load Google Services file
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA | base64 -D > app/google-services.json
# Loads the keystore.properties file from a Github secret, decodes it, and saves it to the root directory.
- name: Create keystore.properties
run: |
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > $GITHUB_WORKSPACE/keystore.properties
# Loads the secrets.properties file from a Github secret, decodes it, and saves it to the root directory.
- name: Create secrets.properties
run: |
echo "${{ secrets.SECRETS_PROPERTIES }}" > $GITHUB_WORKSPACE/secrets.properties
# Loads the sentry.properties file from a Github secret, decodes it, and saves it to the root directory.
- name: Create sentry.properties
run: |
echo "${{ secrets.SENTRY_PROPERTIES }}" > $GITHUB_WORKSPACE/sentry.properties
# Loads the keystore file from a Github secret, decodes it, and saves it to the root directory.
- name: Create keystore file
run: |
echo "${{ secrets.KEYSTORE_JKS_FILE }}" | base64 -d > $GITHUB_WORKSPACE/tangakeystore.jks
# Grant execute permission to the gradlew file.
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
# Setup Gradle Cache to improve the speed of the workflows
- name: Setup Gradle Cache
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
# This step builds the app in debug mode using Gradle.
- run: echo "Building Debug APK."
- name: Build the project with Gradle
run: ./gradlew build
- run: echo "Build status report=${{ job.status }}."
# Executes Android tests in an emulator.
# It uses an emulator with API level 29 and runs the 'jacocoTestReport' Gradle task for generating code coverage reports.
# Skipping this step for now as our android tests are not working
# - name: Android Tests with Android Emulator Runner
# uses: ReactiveCircus/[email protected]
# with:
# api-level: 29
# script: ./gradlew jacocoTestReport
# Generates a Kotlin code coverage report using the Kover tool.
# This step is crucial for assessing the coverage of unit tests written in Kotlin.
- name: Run Unit Tests with Kover (Kotlin Code Coverage)
run: ./gradlew koverXmlReportDebug
# Uploads the generated Android instrumented test coverage reports as artifacts for later access.
# This step ensures that test results are stored and retrievable.
- name: Generate report
uses: actions/upload-artifact@v4
with:
name: report
path: app/build/reports/coverage/androidTest/debug/connected/
# Uploads the Android instrumented test coverage report to Codecov using a provided token.
# If there's an error in uploading, the CI process will fail.
# Skipping this step for now as our android tests are not working
# - name: Upload Android Instrumented Test Report
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: app/build/reports/coverage/androidTest/debug/connected/report.xml, core-ui/build/reports/coverage/androidTest/debug/connected/report.xml
# flags: uitests
# fail_ci_if_error: true
# Similar to the previous step, this uploads the Kotlin unit test coverage report to Codecov.
# It also fails the CI process if an error occurs during upload.
- name: Upload Unit Test Report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: app/build/reports/kover/reportDebug.xml
flags: unittests
fail_ci_if_error: true