mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-20 16:50:33 -05:00
05cf340e8f
* feat: Add new Maestro tests for album, playlist, artist, and favorites, and enhance existing tests with additional screenshots and refined playback flows. * feat: Enhance Maestro CI/CD with improved caching, updated Maestro version, and refined emulator configurations for better performance and artifact collection. * feat: Run Maestro Android tests using a single orchestrated flow file and collect project screenshots. * fix: Add extended wait conditions to login test to improve stability and prevent flakiness. * feat: Add test IDs to login, authentication, and library selection screens and update Maestro tests to use them. * test: make sign out confirmation assertion optional * feat: Improve login flow robustness by delegating app launch to the login test, increasing wait times, and adding more optional dialog dismissals. * feat: Add APK caching to Maestro test workflow and conditionally run build steps. * feat: make sign-out and cancellation steps in test more robust with optional taps and back key presses, and update login page assertion. * test: remove optional flag from `pressKey: back` action in settings test. --------- Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com> Co-authored-by: Ritesh Shukla <riteshshukla2381@gmail.com>
222 lines
6.8 KiB
YAML
222 lines
6.8 KiB
YAML
name: Run Maestro Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 3 * * *"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-android:
|
|
if: github.repository == 'Jellify-Music/App'
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
cache-hit: ${{ steps.apk-cache.outputs.cache-hit }}
|
|
steps:
|
|
- name: 🛒 Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 📦 Check APK Cache
|
|
id: apk-cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ./android/app/build/outputs/apk/release/app-universal-release.apk
|
|
key: android-apk-${{ runner.os }}-${{ hashFiles('src/**', 'android/**', 'package.json', 'bun.lock') }}
|
|
restore-keys: |
|
|
android-apk-${{ runner.os }}-
|
|
|
|
- name: 🖥 Setup Bun
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.4
|
|
|
|
- name: 📦 Cache node_modules
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
node_modules
|
|
~/.cache/turbo
|
|
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-
|
|
|
|
- name: ☕ Setup JDK 17
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: 🐘 Setup Gradle with caching
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
uses: gradle/actions/setup-gradle@v5
|
|
with:
|
|
cache-read-only: false
|
|
|
|
- name: 📦 Cache Gradle
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: 📥 Install dependencies
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
run: bun i
|
|
|
|
- name: 💬 Disable OTA Updates and Enable Maestro Build
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
run: bun scripts/updateEnv.js OTA_UPDATE_ENABLED=false IS_MAESTRO_BUILD=true
|
|
|
|
- name: ✅ Validate Config Files
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
bun -p "JSON.parse(require('fs').readFileSync('telemetrydeck.json'))"
|
|
bun -p "JSON.parse(require('fs').readFileSync('glitchtip.json'))"
|
|
|
|
- name: 🚀 Build Android APK
|
|
if: steps.apk-cache.outputs.cache-hit != 'true'
|
|
run: bun run android-build
|
|
|
|
- name: 📤 Upload Android Artifacts
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: android-artifacts
|
|
path: ./android/app/build/outputs/apk/release/app-universal-release.apk
|
|
retention-days: 7
|
|
|
|
run-maestro-tests:
|
|
if: github.repository == 'Jellify-Music/App'
|
|
runs-on: ubuntu-latest
|
|
needs: build-android
|
|
timeout-minutes: 45
|
|
|
|
steps:
|
|
- name: 🧹 Free Disk Space
|
|
uses: jlumbroso/free-disk-space@main
|
|
with:
|
|
tool-cache: true
|
|
android: false
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: true
|
|
docker-images: true
|
|
swap-storage: true
|
|
|
|
- name: 🛒 Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 🖥 Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.4
|
|
|
|
- name: 📦 Cache node_modules
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
node_modules
|
|
~/.cache/turbo
|
|
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-
|
|
|
|
- name: 📥 Install dependencies
|
|
run: bun i
|
|
|
|
- name: 🎭 Install Maestro
|
|
shell: bash
|
|
run: |
|
|
export MAESTRO_VERSION=2.0.3
|
|
curl -Ls "https://get.maestro.mobile.dev" | bash
|
|
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
|
|
|
|
- name: ☕ Setup JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'zulu'
|
|
|
|
- name: 📦 Cache AVD
|
|
uses: actions/cache@v5
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
key: avd-api-34-x86_64-${{ runner.os }}
|
|
|
|
- name: ⬇️ Download Android Artifacts
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: android-artifacts
|
|
path: artifacts/
|
|
|
|
- name: 🔧 Enable KVM
|
|
shell: bash
|
|
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 Maestro Tests
|
|
id: run-tests
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 34
|
|
target: google_apis
|
|
arch: x86_64
|
|
profile: pixel_6
|
|
ram-size: 4096M
|
|
heap-size: 1024M
|
|
disk-size: 6G
|
|
cores: 4
|
|
disable-animations: true
|
|
disable-spellchecker: true
|
|
disable-linux-hw-accel: false
|
|
emulator-boot-timeout: 600
|
|
avd-name: maestro_emulator
|
|
force-avd-creation: false
|
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
|
|
script: bash scripts/maestro-android-retry.sh "https://jellyfin.jellify.app" "jerry"
|
|
|
|
- name: 📸 Collect Screenshots
|
|
if: always()
|
|
run: |
|
|
mkdir -p test-artifacts
|
|
cp -r screenshots/* test-artifacts/ 2>/dev/null || true
|
|
cp -r .maestro/screenshots/* test-artifacts/ 2>/dev/null || true
|
|
cp *.mp4 test-artifacts/ 2>/dev/null || true
|
|
|
|
- name: 🗣️ Notify Success on Discord
|
|
if: success() && github.repository == 'Jellify-Music/App'
|
|
run: |
|
|
bun scripts/sendDiscordMessage.js "__**## ✅ Maestro Test Passed**__All checks completed successfully!"
|
|
env:
|
|
DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }}
|
|
|
|
- name: 🗣️ Notify Failure on Discord
|
|
if: failure() && github.repository == 'Jellify-Music/App'
|
|
run: |
|
|
bun scripts/sendDiscordMessage.js "__**## ❌ Maestro Test Failed**__Some tests did not pass. Check artifacts for details."
|
|
env:
|
|
DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }}
|
|
|
|
- name: 📤 Upload Test Artifacts
|
|
uses: actions/upload-artifact@v6
|
|
if: always()
|
|
with:
|
|
name: maestro-test-results
|
|
path: |
|
|
test-artifacts/
|
|
retention-days: 14
|