-
Notifications
You must be signed in to change notification settings - Fork 8
115 lines (103 loc) · 3.72 KB
/
emulator.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Android Emulator tests
on:
pull_request:
workflow_dispatch:
inputs:
project:
description: 'Project (Gradle module) to run tests for'
required: false
type: string
video:
description: 'Record video'
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 120
jobs:
build:
uses: ./.github/workflows/setup_macos.yaml
with:
gradleTask: bundleLibRuntimeToJarDebug
project: ${{ inputs.project }}
projectBlacklist: hud
test:
needs: build
runs-on: macos-13
strategy:
fail-fast: false
matrix:
api-level: [23, 33]
project: ${{ fromJSON(needs.build.outputs.projects) }}
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup tools and cache for workspace
uses: ./.github/workflows/setup_tools_macos/
with:
kotlinVersion: ${{ needs.build.outputs.kotlinVersion }}
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd.v11-${{ 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 }}
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
arch: x86_64
disk-size: 3G
ram-size: 3G
heap-size: 1500M
profile: 3.4in WQVGA
channel: canary
cores: 6
script: ./script/check_emulator.sh
- name: install ffmpeg
if: inputs.video
uses: FedericoCarboni/setup-ffmpeg@v2
- name: pregenerate test package
if: inputs.video
run: ./gradlew :${{ matrix.project }}:packageDebugAndroidTest
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none
disable-animations: true
arch: x86_64
disk-size: 3G
ram-size: 3G
heap-size: 1500M
profile: 3.4in WQVGA
channel: canary
cores: 6
script: |
./script/check_emulator.sh
./gradlew ${{ inputs.video && 'recordAndroid' }} :${{ matrix.project }}:connectedDebugAndroidTest
- name: rename video
if: always() && inputs.video
run: mv build/video.mp4 recording-${{ matrix.project }}-${{ matrix.api-level }}.mp4
- name: upload video
if: always() && inputs.video
continue-on-error: true
uses: actions/upload-artifact@master
with:
name: recording-${{ matrix.project }}-${{ matrix.api-level }}
path: recording-${{ matrix.project }}-${{ matrix.api-level }}.mp4