-
Notifications
You must be signed in to change notification settings - Fork 19
54 lines (46 loc) · 1.83 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
unit-test:
name: Perform Unit Testing
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- name: Load Google Service file
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA | base64 -di > app/google-services.json
- name: Setup Local properties
env:
STORE_FILE: ${{ secrets.STORE_FILE }}
IR_STORE_FILE: ${{ secrets.IR_STORE_FILE }}
run: echo $STORE_FILE | base64 -di > keys/store_key.jks && \
echo $IR_STORE_FILE | base64 -di > keys/ir_store_key.jks && \
echo 'STORE_FILE=keys/store_key.jks' > ./local.properties && \
echo 'STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}' > ./local.properties && \
echo 'KEY_ALIAS=${{ secrets.KEY_ALIAS }}' > ./local.properties && \
echo 'KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}' > ./local.properties && \
echo 'IR_STORE_FILE=keys/ir_store_key.jks' > ./local.properties && \
echo 'IR_STORE_PASSWORD=${{ secrets.IR_STORE_PASSWORD }}' > ./local.properties && \
echo 'IR_KEY_ALIAS=${{ secrets.IR_KEY_ALIAS }}' > ./local.properties && \
echo 'IR_KEY_PASSWORD=${{ secrets.IR_KEY_PASSWORD }}' > ./local.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run unit tests
run: ./gradlew testDebug
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: unit_test_report
path: app/build/reports/test/testDebugUnitTest/