256 lines
8.6 KiB
YAML
256 lines
8.6 KiB
YAML
name: E2E - Maestro
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: maestro-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
android-maestro:
|
|
name: Android Maestro suites
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 150
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
FLUTTER_VERSION: "3.44.0"
|
|
MAESTRO_VERSION: "2.6.1"
|
|
MAESTRO_CLI_NO_ANALYTICS: "1"
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
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: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: "17"
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
cache: true
|
|
pub-cache: false
|
|
|
|
- name: Cache Pub dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.pub-cache
|
|
key: ${{ runner.os }}-pub-v3-${{ hashFiles('**/pubspec.yaml', '**/pubspec.lock') }}
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-e2e-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-e2e-
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Build debug APK
|
|
run: flutter build apk --debug
|
|
|
|
- name: Cache Maestro CLI
|
|
id: maestro-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.maestro/bin
|
|
~/.maestro/lib
|
|
key: ${{ runner.os }}-maestro-${{ env.MAESTRO_VERSION }}
|
|
|
|
- name: Install Maestro CLI
|
|
if: steps.maestro-cache.outputs.cache-hit != 'true'
|
|
run: curl -fsSL "https://get.maestro.mobile.dev" | bash
|
|
|
|
- name: Add Maestro to PATH
|
|
run: |
|
|
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
|
|
"$HOME/.maestro/bin/maestro" --version
|
|
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Build and cache deterministic Jellyfin image
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: .maestro/jellyfin-demo/Dockerfile
|
|
load: true
|
|
tags: plezy-jellyfin-demo:local
|
|
cache-from: type=gha,scope=maestro-jellyfin
|
|
cache-to: type=gha,mode=max,scope=maestro-jellyfin
|
|
|
|
- name: Cache Android 15 AVD
|
|
id: api35-avd-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.android/avd/maestro-api35.avd
|
|
~/.android/avd/maestro-api35.ini
|
|
key: ${{ runner.os }}-avd-v1-api35-x86_64-pixel_6
|
|
|
|
- name: Generate Android 15 AVD snapshot
|
|
if: steps.api35-avd-cache.outputs.cache-hit != 'true'
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 35
|
|
arch: x86_64
|
|
profile: pixel_6
|
|
avd-name: maestro-api35
|
|
force-avd-creation: false
|
|
disable-animations: false
|
|
emulator-options: >-
|
|
-no-window -gpu swiftshader_indirect -noaudio
|
|
-no-boot-anim -camera-back none
|
|
script: echo "Generated Android 15 AVD snapshot."
|
|
|
|
- name: Cache Android 9 AVD
|
|
id: api28-avd-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.android/avd/maestro-api28.avd
|
|
~/.android/avd/maestro-api28.ini
|
|
key: ${{ runner.os }}-avd-v1-api28-x86-pixel_2-playstore
|
|
|
|
- name: Generate Android 9 AVD snapshot
|
|
if: steps.api28-avd-cache.outputs.cache-hit != 'true'
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 28
|
|
target: google_apis_playstore
|
|
arch: x86
|
|
profile: pixel_2
|
|
avd-name: maestro-api28
|
|
force-avd-creation: false
|
|
disable-animations: false
|
|
emulator-options: >-
|
|
-no-window -gpu swiftshader_indirect -noaudio
|
|
-no-boot-anim -camera-back none
|
|
script: echo "Generated Android 9 AVD snapshot."
|
|
|
|
- name: Run Android 15 suites
|
|
id: api35
|
|
continue-on-error: true
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
env:
|
|
MAESTRO_SKIP_BUILD: "1"
|
|
MAESTRO_SKIP_JELLYFIN_BUILD: "1"
|
|
MAESTRO_DEVICE_ID: emulator-5554
|
|
with:
|
|
api-level: 35
|
|
arch: x86_64
|
|
profile: pixel_6
|
|
avd-name: maestro-api35
|
|
force-avd-creation: false
|
|
disable-animations: true
|
|
emulator-options: >-
|
|
-no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio
|
|
-no-boot-anim -camera-back none
|
|
script: |
|
|
status=0
|
|
run_flow() {
|
|
"$@" || status=1
|
|
}
|
|
|
|
run_flow python3 scripts/run_maestro.py basic
|
|
run_flow python3 scripts/run_maestro.py catalog
|
|
run_flow python3 scripts/run_maestro.py media
|
|
run_flow python3 scripts/run_maestro.py basic \
|
|
--flow .maestro/regression_flows/03_tv_library_focus.yaml \
|
|
--jellyfin-log build/maestro-tv/library-focus.log \
|
|
--diagnostics-dir build/maestro-tv/library-focus-diagnostics
|
|
run_flow python3 scripts/run_maestro.py basic \
|
|
--flow .maestro/regression_flows/04_tv_player_keys.yaml \
|
|
--jellyfin-log build/maestro-tv/player-keys.log \
|
|
--diagnostics-dir build/maestro-tv/player-keys-diagnostics
|
|
run_flow python3 scripts/run_maestro.py basic \
|
|
--flow .maestro/regression_flows/05_tv_next_episode_back.yaml \
|
|
--jellyfin-log build/maestro-tv/next-episode.log \
|
|
--diagnostics-dir build/maestro-tv/next-episode-diagnostics
|
|
run_flow python3 scripts/run_maestro.py basic \
|
|
--fault music-failure \
|
|
--flow .maestro/real_flows/02_music_browse.yaml \
|
|
--jellyfin-log build/maestro-recovery/music-jellyfin.log \
|
|
--proxy-journal build/maestro-recovery/music-proxy-journal.jsonl \
|
|
--diagnostics-dir build/maestro-recovery/music-diagnostics
|
|
run_flow python3 scripts/run_maestro.py basic \
|
|
--fault recovery \
|
|
--flow .maestro/regression_flows/06_playback_recovery.yaml \
|
|
--jellyfin-log build/maestro-recovery/jellyfin.log \
|
|
--proxy-journal build/maestro-recovery/proxy-journal.jsonl \
|
|
--diagnostics-dir build/maestro-recovery/diagnostics
|
|
exit "$status"
|
|
|
|
- name: Run Android 9 legacy playback
|
|
id: api28
|
|
continue-on-error: true
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
env:
|
|
MAESTRO_SKIP_BUILD: "1"
|
|
MAESTRO_SKIP_JELLYFIN_BUILD: "1"
|
|
MAESTRO_DEVICE_ID: emulator-5554
|
|
with:
|
|
api-level: 28
|
|
target: google_apis_playstore
|
|
arch: x86
|
|
profile: pixel_2
|
|
avd-name: maestro-api28
|
|
force-avd-creation: false
|
|
disable-animations: true
|
|
emulator-options: >-
|
|
-no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio
|
|
-no-boot-anim -camera-back none
|
|
script: |
|
|
python3 scripts/run_maestro.py basic \
|
|
--flow .maestro/flows/05_playback.yaml \
|
|
--jellyfin-log build/maestro-legacy/jellyfin.log \
|
|
--diagnostics-dir build/maestro-legacy/diagnostics
|
|
|
|
- name: Upload Maestro diagnostics
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: maestro-android-diagnostics
|
|
path: |
|
|
build/maestro
|
|
build/maestro-real-jellyfin
|
|
build/maestro-media
|
|
build/maestro-tv
|
|
build/maestro-recovery
|
|
build/maestro-legacy
|
|
~/.maestro/tests
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
- name: Report suite failures
|
|
if: ${{ always() && (steps.api35.outcome != 'success' || steps.api28.outcome != 'success') }}
|
|
run: |
|
|
echo "Android 15 outcome: ${{ steps.api35.outcome }}"
|
|
echo "Android 9 outcome: ${{ steps.api28.outcome }}"
|
|
exit 1
|