-
Notifications
You must be signed in to change notification settings - Fork 14
59 lines (52 loc) · 1.71 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
name: Android Test
on:
push:
pull-request:
branches:
- main
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
api-level: [21, 26, 31]
arch: ['x86_64', 'x86']
steps:
- name: checkout
uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: make gradlew executable
run: chmod +x ./gradlew
- name: gradle cache
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
disable-animations: true
force-avd-creation: false
emulator-options: -no-window -camera-back emulated -camera-front emulated -gpu swiftshader_indirect -no-boot-anim
script: echo "Generated AVD snapshot for caching."
- name: run android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
disable-animations: true
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -camera-back emulated -camera-front emulated -gpu swiftshader_indirect -no-boot-anim
script: ./gradlew connectedDebugAndroidTest