-
Notifications
You must be signed in to change notification settings - Fork 13
74 lines (65 loc) · 2.52 KB
/
run-webdriver-tests.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
name: Run WebDriver Tests
on:
workflow_dispatch:
workflow_run:
workflows: [Build Latest Preview]
types:
- completed
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [33]
arch: [x86_64]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Enable KVM
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: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ 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 }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Download latest WebDriver Preview
run: wget https://github.com/Igalia/wpe-android/releases/download/latest-preview/webdriver-latest.apk -O webdriver-latest.apk
- name: Install ADB
run: sudo apt install adb
- name: Run Selenium and W3C tests
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
adb install --abi x86_64 webdriver-latest.apk
adb shell am start -W -n org.wpewebkit.tools.webdriver/.WebDriverActivity
sleep 5
adb shell am force-stop org.wpewebkit.tools.webdriver
python3 -m venv .venv
. .venv/bin/activate
pip install -r tools/scripts/webkitpy/requirements.txt
tools/scripts/run-webdriver-tests --json-output=results.json
- name: Test results
run: tools/scripts/print-webdriver-json-results ./results.json