Files
App/.github/workflows/maestro-test.yml
Brys 9d2e10e996 Switch from Yarn/Node.js to bun for faster dev install (#704)
* refactor: change from yarn to bun for package management

* feat: change workflows all to bun instead of node/yarn.

* refactor: change from node repl to bun repl

* fix: re-add nodejs as an applicable engine to package.json

* fix: remove bun.lock from hash in android-build workflow

---------

Co-authored-by: Ritesh Shukla <riteshshukla2381@gmail.com>
2025-11-23 17:31:24 -06:00

145 lines
4.1 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:
runs-on: macos-15
outputs:
version: ${{ steps.setver.outputs.version }}
steps:
- name: 🛒 Checkout
uses: actions/checkout@v4
- name: 🖥 Setup Bun 1.3.2
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.2
- name: 💎 Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: actions/cache@v3
with:
path: |
node_modules
~/.gradle/caches
~/.gradle/wrapper
~/.cache/turbo
android/.gradle
android/app/build
key: ${{ runner.os }}-gradle-turbo-${{ hashFiles('**/bun.lock', '**/build.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-turbo-
- 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:
runs-on: ubuntu-latest
needs: build-android
steps:
- name: 🛒 Checkout
uses: actions/checkout@v4
- name: 🖥 Setup Bun 1.3.2
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.2
- 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/
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4' # Not needed with a .ruby-version, .tool-versions or mise.toml
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- 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: '8192M'
heap-size: '4096M'
disk-size: '10G'
cores: '4'
disable-animations: false
avd-name: e2e_emulator
script: bash scripts/maestro-android-retry.sh "https://jellyfin.jellify.app" "jerry"
- name: 🗣️ Notify Success on Discord
if: success()
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()
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