-
-
Notifications
You must be signed in to change notification settings - Fork 29
68 lines (63 loc) · 1.88 KB
/
main.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
name: 🔧 Build main branch and PRs
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create local properties
run: touch local.properties
- name: Copy mock google services
run: cp mock-google-services.json app/google-services.json
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }}
run: ./gradlew testDebugUnitTest assembleDebug # sonarqube
- name: Test Reporter
uses: dorny/[email protected]
if: success() || failure()
with:
name: Tests
path: "**/TEST-*.xml"
reporter: java-junit
# - name: run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 30
# arch: x86
# script: ./gradlew connectedCheck
- name: Archive apk
uses: actions/upload-artifact@v4
with:
name: apk
path: |
app/build/outputs/apk/debug