-
-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (66 loc) · 2.07 KB
/
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
name: Build
on:
push:
branches:
- master
pull_request:
jobs:
ANDROID_BASE_CHECKS:
name: Base Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Perform base checks
run: ./gradlew app:assembleDebug --stacktrace
ANDROID_UNIT_TESTS:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Execute unit tests
run: ./gradlew library:testDebugUnitTest --stacktrace
ANDROID_BUILD_APK:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# required for telegram notifications on PRs
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Setup custom keystore file
run: |
mkdir -p $HOME/.android
cp ./.ci/debug.keystore $HOME/.android/debug.keystore
- name: Execute APK build
run: ./gradlew app:assembleDebug --stacktrace
- uses: actions/upload-artifact@v3
with:
name: apk-files
path: app/build/outputs/apk/**/*.apk
- name: Notify
# make sure this step runs, regardless of whether the preceding steps were successful or not
if: always()
env:
# "failure", "success" or "cancelled"
# see: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-context
RUN_RESULT: ${{ job.status }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
MATRIX_HOMESERVER: ${{ secrets.MATRIX_HOMESERVER }}
MATRIX_ACCESS_TOKEN: ${{ secrets.MATRIX_ACCESS_TOKEN }}
run: .ci/notify.sh