mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-23 19:39:35 -05:00
163 lines
4.5 KiB
YAML
163 lines
4.5 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:
|
|
version: ${{ steps.setver.outputs.version }}
|
|
steps:
|
|
- name: 🛒 Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 🖥 Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.4
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
node_modules
|
|
~/.cache/turbo
|
|
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-turbo-
|
|
|
|
- name: ☕ Setup JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: 🐘 Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
|
|
- name: 🍎 Run bun init-android
|
|
run: bun i
|
|
|
|
- name: 💬 Disable OTA Updates and Enable Maestro Build
|
|
run: bun scripts/updateEnv.js OTA_UPDATE_ENABLED=false IS_MAESTRO_BUILD=true
|
|
|
|
|
|
- name: ✅ Validate Config Files
|
|
run: |
|
|
bun -p "JSON.parse(require('fs').readFileSync('telemetrydeck.json'))"
|
|
bun -p "JSON.parse(require('fs').readFileSync('glitchtip.json'))"
|
|
|
|
- name: 🚀 Run Android fastlane build
|
|
run: bun run android-build
|
|
|
|
- name: 📤 Upload Android Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: android-artifacts
|
|
path: ./android/app/build/outputs/apk/release/*.apk
|
|
|
|
|
|
run-maestro-tests:
|
|
if: github.repository == 'Jellify-Music/App'
|
|
runs-on: ubuntu-latest
|
|
needs: build-android
|
|
|
|
|
|
steps:
|
|
- name: Free Disk Space (Ubuntu)
|
|
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
|
|
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
node_modules
|
|
~/.cache/turbo
|
|
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-turbo-
|
|
|
|
- name: Installing Maestro
|
|
shell: bash
|
|
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'zulu'
|
|
|
|
- name: ⬇️ Download Android Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: android-artifacts
|
|
path: artifacts/
|
|
|
|
- name: Enable KVM group perms
|
|
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 e2e tests
|
|
id: run-tests
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: '34'
|
|
target: google_apis
|
|
arch: x86_64
|
|
profile: Nexus 6
|
|
ram-size: '3072M'
|
|
heap-size: '1024M'
|
|
disk-size: '4G'
|
|
cores: '3'
|
|
disable-animations: true
|
|
avd-name: e2e_emulator
|
|
script: bash scripts/maestro-android-retry.sh "https://jellyfin.jellify.app" "jerry"
|
|
|
|
|
|
- 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."
|
|
env:
|
|
DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }}
|
|
|
|
- name: Store tests result
|
|
uses: actions/upload-artifact@v4.3.4
|
|
if: always()
|
|
with:
|
|
name: TestResult
|
|
path: |
|
|
*.mp4
|