Skip to content

Commit

Permalink
Test single-backend APK when unified-backend APK fails
Browse files Browse the repository at this point in the history
  • Loading branch information
anhappdev committed Feb 3, 2025
1 parent 390f130 commit f098ff8
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
76 changes: 74 additions & 2 deletions .github/workflows/android-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ jobs:
-X POST "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/test-suite" \
-F "file=@/tmp/$HELPER_APK_NAME" \
-F "custom_id=$HELPER_APK_NAME"
- name: Trigger App Automate
- uses: nick-fields/retry@v3
name: Trigger App Automate
env:
BROWSERSTACK_CREDENTIALS: ${{ secrets.BROWSERSTACK_CREDENTIALS }}
BROWSERSTACK_APP: ${{ env.MAIN_APK_NAME }}
Expand All @@ -290,8 +291,79 @@ jobs:
"Samsung Galaxy S24 Ultra-14.0",
"Samsung Galaxy Tab S10 Plus-14.0",
"Google Pixel 9 Pro-15.0"]
with:
timeout_minutes: 60
max_attempts: 2
retry_wait_seconds: 300
retry_on_exit_code: 9
command: |
bash .github/workflows/scripts/browserstack-app-automate.sh
test-android-apk-single:
needs: test-android-apk-unified
if: failure()
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- backend: "tflite"
device: "Samsung Galaxy M32-11.0"
- backend: "pixel"
device: "Google Pixel 9 Pro-15.0"
- backend: "mtk"
device: "Samsung Galaxy Tab S10 Plus-14.0"
- backend: "qti"
device: "Samsung Galaxy S24 Ultra-14.0"
- backend: "samsung"
device: "Samsung Galaxy S24-14.0"
env:
MAIN_APK_NAME: test-main-${{ matrix.backend }}-${{ github.run_number }}.apk
HELPER_APK_NAME: test-helper-${{ matrix.backend }}-${{ github.run_number }}.apk
steps:
- uses: actions/checkout@v4
- name: Set up authentication for Google Cloud SDK
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 363.0.0'
- name: Download test APK
run: |
gsutil cp $GCLOUD_BUCKET_PATH/test-main-${{ matrix.backend }}.apk /tmp/$MAIN_APK_NAME
gsutil cp $GCLOUD_BUCKET_PATH/test-helper-${{ matrix.backend }}.apk /tmp/$HELPER_APK_NAME
- name: Upload main app
run: |
bash .github/workflows/scripts/browserstack-app-automate.sh
curl -u "${{ secrets.BROWSERSTACK_CREDENTIALS }}" \
-X POST "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/app" \
-F "file=@/tmp/$MAIN_APK_NAME" \
-F "custom_id=$MAIN_APK_NAME"
- name: Upload test suite
run: |
curl -u "${{ secrets.BROWSERSTACK_CREDENTIALS }}" \
-X POST "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/test-suite" \
-F "file=@/tmp/$HELPER_APK_NAME" \
-F "custom_id=$HELPER_APK_NAME"
- uses: nick-fields/retry@v3
name: Trigger App Automate
env:
BROWSERSTACK_CREDENTIALS: ${{ secrets.BROWSERSTACK_CREDENTIALS }}
BROWSERSTACK_APP: ${{ env.MAIN_APK_NAME }}
BROWSERSTACK_TEST_SUITE: ${{ env.HELPER_APK_NAME }}
BROWSERSTACK_BUILD_TAG: ${{ github.run_number }}
BROWSERSTACK_DEVICES: >-
["${{ matrix.device }}"]
with:
timeout_minutes: 60
max_attempts: 2
retry_wait_seconds: 300
retry_on_exit_code: 9
command: |
bash .github/workflows/scripts/browserstack-app-automate.sh
deploy-playstore:
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/browserstack-app-automate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ check_build_status() {
# Main
if ! BUILD_ID=$(trigger_build); then
echo "Trigger build failed. Message: $BUILD_ID"
exit 1
exit 9
fi

echo "Build triggered successfully. Build ID: $BUILD_ID"
Expand Down

0 comments on commit f098ff8

Please sign in to comment.