-
-
Notifications
You must be signed in to change notification settings - Fork 31
80 lines (69 loc) · 2.22 KB
/
androidTest.yaml
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
69
70
71
72
73
74
75
76
77
78
79
name: androidTest
on:
pull_request:
branches: [ '*' ]
push:
branches: [ master, v0.3.0 ]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-cache-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
restore-keys: gradle-cache-${{ runner.os }}-
- name: Run local tests
run: ./gradlew testDebug --stacktrace
- name: Cache AVD
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-cache-${{ runner.os }}-${{ hashFiles('**/*.avd') }}
restore-keys: avd-cache-${{ runner.os }}-
- name: Create AVD and generate snapshot for caching and Run androidTest
uses: reactivecircus/android-emulator-runner@v2
continue-on-error: true
env:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 500
with:
api-level: 29
emulator-build: 7425822
force-avd-creation: true
emulator-options: -wipe-data -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: |
echo "Generated AVD snapshot for caching."
./gradlew connectedCheck
- name: Upload Failing Test Report Log
if: steps.testing.outcome != 'success'
uses: actions/upload-artifact@v2
with:
name: logs
path: app/emulator.log
- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v3
with:
name: build-outputs
path: ./app/build/outputs
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: ./app/build/reports