Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test single-backend APK when unified-backend APK fails #956

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 76 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,81 @@ 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:
- build-android-apk
- 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: |
bash .github/workflows/scripts/browserstack-app-automate.sh
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: |
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
5 changes: 4 additions & 1 deletion .github/workflows/scripts/browserstack-app-automate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,16 @@ check_build_status() {
elif [[ "$status" == "failed" ]]; then
echo "Build failed."
exit 1
elif [[ "$status" == "error" ]]; then
echo "Build has error."
exit 9
fi
}

# 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
Loading