-
Notifications
You must be signed in to change notification settings - Fork 63
59 lines (49 loc) · 1.5 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
name: Build
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
api-level:
- 21
- 24
- 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Enable KVM group perms
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: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
script: |
adb logcat -c
adb logcat > logcat.log &
./gradlew createDebugCoverageReport
env:
API_LEVEL: ${{ matrix.api-level }}
- name: Load logs if failed
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logcat-${{ matrix.api-level }}
path: logcat.log
- name: Load code coverage report
if: success() && matrix.api-level == '24'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew coveralls