-
-
Notifications
You must be signed in to change notification settings - Fork 168
102 lines (99 loc) · 3.16 KB
/
functional-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
93
94
95
96
97
98
99
100
101
102
name: Functional Tests
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
include:
- platformVersion: "12.0"
apiLevel: 32
emuTag: google_apis
arch: x86_64
- platformVersion: "11.0"
apiLevel: 30
emuTag: google_apis
arch: x86
- platformVersion: "9.0"
apiLevel: 28
emuTag: default
arch: x86
- platformVersion: "7.1"
apiLevel: 25
emuTag: default
arch: x86
- platformVersion: "5.1"
apiLevel: 22
emuTag: default
arch: x86
fail-fast: false
env:
CI: true
ANDROID_AVD: emulator
ANDROID_SDK_VERSION: "${{ matrix.apiLevel }}"
PLATFORM_VERSION: "${{ matrix.platformVersion }}"
EMU_TAG: "${{ matrix.emuTag }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Enable KVM group perms
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
- uses: actions/setup-node@v3
with:
node-version: lts/*
check-latest: true
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- run: npm install --no-package-lock
name: Install dev dependencies
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.apiLevel }}
# https://github.com/marketplace/actions/android-emulator-runner
- uses: reactivecircus/android-emulator-runner@v2
if: steps.avd-cache.outputs.cache-hit != 'true'
name: Generate AVD snapshot for caching
with:
script: echo "Generated AVD snapshot for caching."
avd-name: $ANDROID_AVD
force-avd-creation: false
api-level: ${{ matrix.apiLevel }}
disable-spellchecker: true
target: ${{ matrix.emuTag }}
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
arch: ${{ matrix.arch }}
disable-animations: true
- run: nohup adb logcat > logcat.log &
name: Capture Logcat
- uses: reactivecircus/android-emulator-runner@v2
name: api${{ matrix.apiLevel }}_e2e
with:
script: npm run e2e-test
avd-name: $ANDROID_AVD
force-avd-creation: false
api-level: ${{ matrix.apiLevel }}
disable-spellchecker: true
target: ${{ matrix.emuTag }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
arch: ${{ matrix.arch }}
disable-animations: true
- name: Save logcat output
if: ${{ always() }}
uses: actions/upload-artifact@master
with:
name: logcat-api${{ matrix.apiLevel }}
path: logcat.log