-
-
Notifications
You must be signed in to change notification settings - Fork 199
131 lines (120 loc) · 3.52 KB
/
main.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Main workflow
on:
workflow_call:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- main
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ${{ matrix.os }}
env:
JAVA_TOOL_OPTIONS: -Xmx4g
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest]
api-level: [23, 29]
target: [default, google_apis]
arch: [x86]
exclude:
- target: google_apis
api-level: 16
- target: google_apis
api-level: 23
- target: google_apis
api-level: 29
include:
- os: ubuntu-latest
api-level: 24
target: playstore
arch: x86
- os: ubuntu-latest
api-level: 30
target: aosp_atd
arch: x86
- os: macos-latest
api-level: 31
target: google_apis
arch: x86_64
- os: ubuntu-latest
api-level: 34
target: aosp_atd
arch: x86_64
steps:
- name: checkout
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: build, test and lint
run: |
npm install
npm run build
npm run lint
npm test
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
~/.android/debug.keystore
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
- uses: gradle/actions/setup-gradle@v3
- name: assemble tests
working-directory: test-fixture
run: ./gradlew assembleAndroidTest
- name: enable KVM for linux runners
if: runner.os == 'Linux'
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
- name: run emulator to generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Galaxy Nexus
cores: 2
sdcard-path-or-size: 100M
avd-name: test
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
working-directory: ./test-fixture/
channel: canary
script: echo "Generated AVD snapshot for caching."
- name: run action
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Galaxy Nexus
cores: 2
ram-size: 2048M
sdcard-path-or-size: 100M
avd-name: test
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: ./test-fixture/
channel: canary
pre-emulator-launch-script: |
echo "Running pre emulator launch script. Printing the working directory now:"
pwd
script: |
echo $GITHUB_REPOSITORY
adb devices
./gradlew connectedDebugAndroidTest