-
-
Notifications
You must be signed in to change notification settings - Fork 77
66 lines (57 loc) · 1.7 KB
/
android-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
name: Android Test
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
pull_request:
branches:
- main
jobs:
android_test:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [23]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
- name: Make gradlew executable
run: chmod +x gradlew
- 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
ls /dev/kvm
- uses: gradle/actions/setup-gradle@v3
- name: Run Tests
id: testing
uses: reactivecircus/android-emulator-runner@v2
continue-on-error: true
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.api-level == 23 && 'x86' || 'x86_64' }}
script: |
adb logcat -c
touch app/emulator.log
chmod 777 app/emulator.log
adb logcat >> app/emulator.log &
./gradlew connectedCheck
env:
API_LEVEL: ${{ matrix.api-level }}
- name: Upload Test Results
if: steps.testing.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: logs
path: app/emulator.log
- name: Raise error on test failure
if: steps.testing.outcome != 'success'
run: exit 1