mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-04 01:50:09 -06:00
Maestro Setup for app (#407)
Implementing Maestro tests against onboarding process
This commit is contained in:
86
.github/workflows/maestro-test.yml
vendored
86
.github/workflows/maestro-test.yml
vendored
@@ -4,11 +4,69 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
runs-on: macos-15
|
||||
outputs:
|
||||
version: ${{ steps.setver.outputs.version }}
|
||||
steps:
|
||||
- name: 🛒 Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.SIGNING_REPO_PAT }}
|
||||
|
||||
- name: 🖥 Setup Node 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: 💎 Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.0'
|
||||
bundler-cache: true
|
||||
|
||||
- name: 🍎 Run yarn init-android
|
||||
run: yarn install --network-concurrency 1
|
||||
|
||||
- name: 💬 Disable OTA Updates and Enable Maestro Build
|
||||
run: node scripts/updateEnv.js OTA_UPDATE_ENABLED=false IS_MAESTRO_BUILD=true
|
||||
|
||||
- name: 🤫 Output TelemetryDeck Secrets to TelemetryDeck.json
|
||||
run: |
|
||||
echo "{" > telemetrydeck.json
|
||||
echo "\"appID\": \"${{ secrets.TELEMETRYDECK_APPID }}\"," >> telemetrydeck.json
|
||||
echo "\"clientUser\": \"anonymous\"," >> telemetrydeck.json
|
||||
echo "\"app\": \"Jellify\"" >> telemetrydeck.json
|
||||
echo "}" >> telemetrydeck.json
|
||||
|
||||
|
||||
- name: 🤫 Output Glitchtip Secrets to Glitchtip.json
|
||||
run: |
|
||||
echo "{" > glitchtip.json
|
||||
echo "\"dsn\": \"${{ secrets.GLITCHTIP_DSN }}\"" >> glitchtip.json
|
||||
echo "}" >> glitchtip.json
|
||||
|
||||
- name: ✅ Validate Config Files
|
||||
run: |
|
||||
node -e "JSON.parse(require('fs').readFileSync('telemetrydeck.json'))"
|
||||
node -e "JSON.parse(require('fs').readFileSync('glitchtip.json'))"
|
||||
|
||||
- name: 🚀 Run Android fastlane build
|
||||
run: yarn fastlane: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
|
||||
env:
|
||||
JELLYFIN_TEST_ADDRESS: ${{ secrets.JELLYFIN_TEST_ADDRESS }}
|
||||
JELLYFIN_TEST_ADDRESS: ${{ secrets.JELLYFIN_TEST_URL }}
|
||||
JELLYFIN_TEST_USERNAME: ${{ secrets.JELLYFIN_TEST_USERNAME }}
|
||||
JELLYFIN_TEST_PASSWORD: ${{ secrets.JELLYFIN_TEST_PASSWORD }}
|
||||
|
||||
steps:
|
||||
- name: 🛒 Checkout
|
||||
@@ -24,12 +82,23 @@ jobs:
|
||||
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
|
||||
- name: Set up JDK 17
|
||||
if: ${{ inputs.install-java == 'true' }}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
|
||||
- name: 💎 Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.0'
|
||||
bundler-cache: true
|
||||
|
||||
- name: ⬇️ Download Android Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: android-artifacts
|
||||
path: artifacts/
|
||||
|
||||
- name: Enable KVM group perms
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -41,7 +110,7 @@ jobs:
|
||||
id: run-tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 24
|
||||
api-level: '24'
|
||||
arch: x86
|
||||
ram-size: '8192M'
|
||||
heap-size: '4096M'
|
||||
@@ -50,6 +119,11 @@ jobs:
|
||||
disable-animations: false
|
||||
avd-name: e2e_emulator
|
||||
script: |
|
||||
maestro test maestro-tests/flow.yaml \
|
||||
--env server_address=${{ env.JELLYFIN_TEST_ADDRESS }} \
|
||||
--env username=${{ env.JELLYFIN_TEST_USERNAME }}
|
||||
node scripts/maestro-android.js ${{ env.JELLYFIN_TEST_ADDRESS }} ${{ env.JELLYFIN_TEST_USERNAME }} ${{ env.JELLYFIN_TEST_PASSWORD }}
|
||||
- name: Store tests result
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
if: always()
|
||||
with:
|
||||
name: TestResult
|
||||
path: |
|
||||
video.mp4
|
||||
|
||||
Reference in New Issue
Block a user