-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 3.11 KB
/
app.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
name: App
on:
push:
paths:
- 'App/**'
- 'Service/**'
- '.github/workflows/*.yml'
branches:
- '**'
tags:
- '*.*.*'
workflow_dispatch:
env:
ARTIFACT_NAME: ServerMonitor-App
jobs:
build-test-debug:
name: Build & Test (Debug)
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set Gradle permissions
run: chmod +x App/gradlew
- name: Build project
uses: gradle/gradle-build-action@v2
with:
arguments: assembleDebug --scan
build-root-directory: App
cache-disabled: true
- name: Run instrumented tests
uses: gradle/gradle-build-action@v2
with:
arguments: test --scan
build-root-directory: App
cache-disabled: true
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}-debug
path: App/app/build/outputs/apk/*/*
build-test-release:
name: Build & Test (Release)
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' && !startsWith( github.ref_name, 'dependabot/' ) }}
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set Gradle permissions
run: chmod +x App/gradlew
- name: Create key store
id: keystore
run: |
echo "${{ secrets.ANDROID_KEY_STORE }}" | base64 -d > $HOME/android-key-store.apk
echo "path=$HOME/android-key-store.apk" >> "$GITHUB_OUTPUT"
- name: Build project
env:
ANDROID_KEY_STORE_PATH: ${{ steps.keystore.outputs.path }}
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_STORE_KEY_ALIAS: ${{ secrets.ANDROID_KEY_STORE_KEY_ALIAS }}
ANDROID_KEY_STORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_KEY_PASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: assembleRelease --scan
build-root-directory: App
cache-disabled: true
- name: Run instrumented tests
env:
ANDROID_KEY_STORE_PATH: ${{ steps.keystore.outputs.path }}
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_STORE_KEY_ALIAS: ${{ secrets.ANDROID_KEY_STORE_KEY_ALIAS }}
ANDROID_KEY_STORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_KEY_PASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: test --scan
build-root-directory: App
cache-disabled: true
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}-release
path: App/app/build/outputs/apk/*/*