-
Notifications
You must be signed in to change notification settings - Fork 238
65 lines (54 loc) · 1.75 KB
/
android.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
name: Build
on:
push:
branches:
- master
- develop
pull_request:
branches:
- develop
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug --stacktrace
- name: Rename output APK
run: |
DATE=$(date +'%Y%m%d-%H%M')
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/OSMTracker-debug-$DATE.apk
echo "ARTIFACT_DATE=$DATE" >> $GITHUB_ENV
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: debug-${{ env.ARTIFACT_DATE }}
path: app/build/outputs/apk/debug/OSMTracker-debug-*.apk
- name: Run unit tests and jacoco coverage
run: ./gradlew testDebugUnitTest jacocoTestReport --stacktrace
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run connected tests
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: 26
script: |
adb logcat &
./gradlew connectedCheck --no-parallel
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
with:
format: jacoco