Skip to content

list tidying

list tidying #1372

Workflow file for this run

name: Run Maestro Tests
on:
pull_request:
workflow_dispatch:
inputs:
flow:
description: 'Test flow to run (smoke or full)'
required: false
default: 'smoke'
type: choice
options:
- smoke
- full
schedule:
- cron: "0 3 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
maestro-tests:
if: github.repository == 'Jellify-Music/App'
runs-on: [self-hosted, macOS]
timeout-minutes: 45
env:
# Scheduled runs use full regression; manual dispatch respects input (default: full)
MAESTRO_FLOW: ${{ github.event_name == 'schedule' && 'full' || inputs.flow || 'full' }}
steps:
- name: 🛒 Checkout
uses: actions/checkout@v6
- name: 🧭 Resolve Emulator ABI
id: resolve-abi
shell: bash
run: |
if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
echo "emulator_arch=arm64-v8a" >> "$GITHUB_OUTPUT"
echo "apk_filename=app-arm64-v8a-release.apk" >> "$GITHUB_OUTPUT"
else
echo "emulator_arch=x86_64" >> "$GITHUB_OUTPUT"
echo "apk_filename=app-x86_64-release.apk" >> "$GITHUB_OUTPUT"
fi
echo "apk_dir=release" >> "$GITHUB_OUTPUT"
- name: 📦 Check APK Cache
id: apk-cache
uses: actions/cache@v5
with:
path: ./android/app/build/outputs/apk/${{ steps.resolve-abi.outputs.apk_dir }}/${{ steps.resolve-abi.outputs.apk_filename }}
key: android-release-apk-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('android/**', 'package.json', 'bun.lock', 'patches/**', '.env', 'scripts/updateEnv.js') }}
- name: 🖥 Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.4
- name: 🟩 Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- 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: ☕ 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@v6
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: 💬 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: 🚀 Build Android Release APK
if: steps.apk-cache.outputs.cache-hit != 'true'
run: cd android && ./gradlew assembleRelease -PreactNativeArchitectures=${{ steps.resolve-abi.outputs.emulator_arch }}
- name: 🎭 Install Maestro
shell: bash
run: |
export MAESTRO_VERSION=2.5.1
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: 📦 Cache AVD
uses: actions/cache@v5
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-api-34-${{ steps.resolve-abi.outputs.emulator_arch }}-${{ runner.os }}
- name: 🔧 Enable KVM (Linux only)
if: runner.os == 'Linux'
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: ${{ steps.resolve-abi.outputs.emulator_arch }}
profile: pixel_6
ram-size: 4096M
heap-size: 1024M
disk-size: 6G
cores: 4
disable-animations: true
disable-spellchecker: true
disable-linux-hw-accel: ${{ runner.os != 'Linux' }}
emulator-boot-timeout: 600
avd-name: maestro_emulator_${{ steps.resolve-abi.outputs.emulator_arch }}
force-avd-creation: false
emulator-options: ${{ runner.os == 'macOS' && '-no-window -gpu host -noaudio -no-boot-anim' || '-no-window -gpu swiftshader_indirect -noaudio -no-boot-anim' }}
script: bash ./scripts/run-maestro-ci.sh "${{ runner.os }}" "${{ runner.arch }}" "${{ steps.resolve-abi.outputs.emulator_arch }}" "./android/app/build/outputs/apk/${{ steps.resolve-abi.outputs.apk_dir }}/${{ steps.resolve-abi.outputs.apk_filename }}" "${{ env.MAESTRO_FLOW == 'full' && './maestro/flow-full.yaml' || './maestro/flow-smoke.yaml' }}"
- name: 📸 Collect Screenshots and Logs
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
cp logcat.txt test-artifacts/ 2>/dev/null || true
cp maestro-output.log test-artifacts/ 2>/dev/null || true
cp ui_hierarchy.xml test-artifacts/ 2>/dev/null || true
cp -r debug-output/* test-artifacts/ 2>/dev/null || true
- name: 🗣️ Notify Success on Discord
if: success() && github.repository == 'Jellify-Music/App' && github.ref == 'refs/heads/main'
run: |
bun scripts/sendDiscordMessage.js "__**## ✅ Maestro Test Passed (${{ env.MAESTRO_FLOW }})**__All checks completed successfully!"
env:
DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }}
- name: 🗣️ Notify Failure on Discord
if: failure() && github.repository == 'Jellify-Music/App' && github.ref == 'refs/heads/main'
run: |
bun scripts/sendDiscordMessage.js "__**## ❌ Maestro Test Failed (${{ env.MAESTRO_FLOW }})**__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@v7
if: always()
with:
name: maestro-test-results
path: |
test-artifacts/
retention-days: 14