Run WebDriver Tests #190
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run WebDriver Tests | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: [Build Latest Preview] | |
| types: | |
| - completed | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| api-level: [35] | |
| arch: [x86_64] | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Carve-out Disk Space | |
| run: | | |
| sudo rm -rf /usr/share/{dotnet,swift} /usr/local/.ghcup /usr/local/julia* | |
| sudo rm -rf /usr/local/share/{chromium,powershell} /opt/{microsoft,google,az} | |
| - 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 }} | |
| cmake: 3.31.1 | |
| 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 }} | |
| cmake: 3.31.1 | |
| 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 |