-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (65 loc) · 1.8 KB
/
build_and_test.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
name: Build and Test app module
on:
push:
branches:
- main
paths:
- app/**
workflow_dispatch:
jobs:
java_version:
name: Use Java
runs-on: ubuntu-latest
# Runs only when commit message startsWith 'Update'
# if: startsWith(github.event.head_commit.message, 'Update')
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/[email protected]
with:
java-version: 17
distribution: 'temurin'
# Print Hello, world!
- name: Run a one-line script
run: echo Hello, world!
# Print Java compiler version
- name: Print Java
run: javac -version
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Run Debug Tests
run: ./gradlew :app:testDebugUnitTest
build_job:
name: Building the APK
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/[email protected]
with:
java-version: 17
distribution: 'temurin'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Assemble Debug
run: ./gradlew :app:assembleDebug
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk
path: app/build/outputs/apk/debug/**.apk