-
Notifications
You must be signed in to change notification settings - Fork 75
92 lines (82 loc) · 2.89 KB
/
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Run instrumentation tests
on:
push:
branches:
- android*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
instrumentation_tests:
runs-on: macos-11
strategy:
fail-fast: false
matrix:
android_target: [33, 34]
emulator_type: [default, google_apis, google_atd]
exclude:
- android_target: 34
emulator_type: default
- android_target: 34
emulator_type: google_atd
- android_target: 33
emulator_type: google_apis
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
cache: 'gradle'
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.emulator_type }}-${{ matrix.android_target }}
- name: Build Release APK
run: ./gradlew :app:assembleRelease
- name: Create AVD snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.android_target }}
target: ${{ matrix.emulator_type }}
arch: x86_64
force-avd-creation: false
emulator-options: -writable-system -no-snapshot-load -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
./app/development/scripts/provision_emulator.sh "test" "system-images;android-${{ matrix.android_target }};${{ matrix.emulator_type }};x86_64"
echo "Generated AVD snapshot for caching."
- name: Assemble tests
run: ./gradlew :app:assembleAndroidTest
- name: Run tests
uses: Wandalen/[email protected]
with:
attempt_limit: 3
action: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.android_target }}
target: ${{ matrix.emulator_type }}
arch: x86_64
force-avd-creation: false
emulator-options: -writable-system -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
profile: pixel_6a
heap-size: '512M'
ram-size: '4096M'
disk-size: '14G'
sdcard-path-or-size: '4096M'
cores: 2
disable-animations: true
script: ./.github/scripts/run_tests.sh
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.emulator_type }}-${{ matrix.android_target }}-results
path: seedvault_test_results/**/*