diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index c2b85d86..d4213b64 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -1,6 +1,12 @@ name: Build Android APK on: pull_request: + paths: + - '.github/workflows/build-android.yml' + - 'android/**' + - 'package.json' + + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 3728a4c4..baab475c 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -2,6 +2,10 @@ name: Build iOS IPA on: workflow_dispatch: pull_request: + paths: + - '.github/workflows/build-ios.yml' + - 'ios/**' + - 'package.json' concurrency: diff --git a/.github/workflows/maestro-test.yml b/.github/workflows/maestro-test.yml index f7d11ae8..3fb029e2 100644 --- a/.github/workflows/maestro-test.yml +++ b/.github/workflows/maestro-test.yml @@ -1,8 +1,9 @@ name: Run Maestro Tests on: - pull_request: - + workflow_dispatch: + schedule: + - cron: "0 3 * * *" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -122,7 +123,54 @@ jobs: disable-animations: false avd-name: e2e_emulator script: | - node scripts/maestro-android.js "https://jellyfin.jellify.app" "jerry" + attempt=1 + max_attempts=3 + success=false + + while [ $attempt -le $max_attempts ]; do + echo "Attempt $attempt of $max_attempts..." + + if node scripts/maestro-android.js "https://jellyfin.jellify.app" "jerry"; then + echo "Tests passed on attempt $attempt" + success=true + break + else + echo "Tests failed on attempt $attempt" + + if [ $attempt -lt $max_attempts ]; then + echo "Cleaning up and retrying..." + rm -rf *.mp4 || true + pkill -f maestro || true + sleep 5 + fi + + attempt=$((attempt + 1)) + fi + done + + if [ "$success" = false ]; then + echo "All $max_attempts attempts failed" + exit 1 + fi + + + - name: 🗣️ Notify Success on Discord + if: success() + run: | + cd ios + bundle install && bundle exec fastlane notifyOnDiscord title:"✅ Maestro Tests Passed" description:"Maestro tests completed successfully" + cd .. + env: + DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }} + + - name: 🗣️ Notify Failure on Discord + if: failure() + run: | + cd ios + bundle install && bundle exec fastlane notifyOnDiscord title:"❌ Maestro Tests Failed" description:"Maestro tests failed. Check the workflow logs for details." + cd .. + env: + DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }} - name: Store tests result uses: actions/upload-artifact@v4.3.4 if: always() diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 93a72312..76be080f 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -331,7 +331,7 @@ jobs: - name: 🗣️ Notify on Discord run: | cd ios - bundle install && bundle exec fastlane notifyOnDiscord + bundle install && bundle exec fastlane notifyOnDiscordForRelease cd .. env: DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 3a267fb5..be063bef 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -74,7 +74,7 @@ platform :ios do ) end - lane :notifyOnDiscord do + lane :notifyOnDiscordForRelease do app_version = ENV["APP_VERSION"] || "N/A" changelog = sh("git log -n 3 --pretty=format:'• %s (%h) - %an'").split("\n").join("\n") discord_url = ENV["DISCORD_WEBHOOK_URL"] || "N/A" @@ -108,4 +108,17 @@ platform :ios do ) end + + lane :notifyOnDiscord do |options| + title = options[:title] + description = options[:description] + + discord_notifier( + webhook_url: ENV["DISCORD_WEBHOOK_URL"], + title: title, + description: description, + success:true + ) + + end end diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md index dae2bd42..b0dd47b0 100644 --- a/ios/fastlane/README.md +++ b/ios/fastlane/README.md @@ -31,6 +31,14 @@ Push a new beta build to TestFlight +### ios notifyOnDiscordForRelease + +```sh +[bundle exec] fastlane ios notifyOnDiscordForRelease +``` + + + ### ios notifyOnDiscord ```sh