LLM pipeline implementation #636
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android Build & Test | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ master, submission-v* ] | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| workflow_dispatch: | |
| env: | |
| GCLOUD_BUCKET_PATH: gs://mobile-app-build-290400_github-actions/build/${{ github.run_number }} | |
| BROWSERSTACK_CREDENTIALS: ${{ secrets.BROWSERSTACK_CREDENTIALS }} | |
| jobs: | |
| build-android-image: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image (bake) | |
| uses: docker/bake-action@4a9a8d494466d37134e2bfca2d3a8de8fb2681ad # v5.13.0 | |
| with: | |
| push: true | |
| files: | | |
| docker-bake.hcl | |
| targets: android | |
| set: | | |
| android.tags=ghcr.io/mlcommons/mobile_app_open-android:${{ github.run_number }} | |
| android.tags=ghcr.io/mlcommons/mobile_app_open-android:latest | |
| android.cache-from=type=registry,ref=ghcr.io/mlcommons/mobile_app_open-android:buildcache | |
| android.cache-to=type=registry,ref=ghcr.io/mlcommons/mobile_app_open-android:buildcache,mode=max | |
| build-android-apk: | |
| needs: build-android-image | |
| runs-on: ubuntu-22.04-4core | |
| container: | |
| image: ghcr.io/mlcommons/mobile_app_open-android:${{ github.run_number }} | |
| timeout-minutes: 120 | |
| env: | |
| BAZEL_OUTPUT_ROOT_ARG: "--output_user_root=/tmp/bazel_output" | |
| BAZEL_CACHE_ARG: "--disk_cache=/tmp/bazel_cache" | |
| FLUTTER_BUILD_NUMBER: ${{ github.run_number }} | |
| FIREBASE_ANDROID_API_KEY: ${{ secrets.FIREBASE_ANDROID_API_KEY }} | |
| FIREBASE_ANDROID_APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }} | |
| FIREBASE_PROJECT_ID: mobile-app-build-290400 | |
| FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }} | |
| FIREBASE_DATABASE_URL: ${{ secrets.FIREBASE_DATABASE_URL }} | |
| FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }} | |
| SIGNING_FOR_RELEASE: true | |
| SIGNING_STORE_FILE: /tmp/mlperf-keystore.jks | |
| SIGNING_STORE_FILE_BASE64: ${{ secrets.SIGNING_STORE_FILE_BASE64 }} | |
| SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} | |
| SIGNING_KEY_ALIAS: upload | |
| SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| # Preinstalled tools from host at `/opt/hostedtoolcache` is not needed since we run commands inside our own Docker container. | |
| # `/opt/hostedtoolcache` is mounted to `/__t`. We delete it to free up disk space. | |
| - name: Free up disk space | |
| run: | | |
| echo BEFORE: | |
| df -h | |
| rm -rf /__t/* | |
| echo AFTER: | |
| df -h | |
| - name: Configure Git | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Create keystore file | |
| run: | | |
| echo "$SIGNING_STORE_FILE_BASE64" | base64 -d > "$SIGNING_STORE_FILE" | |
| echo e4699f58310b85cbcb9e835e569e7e17 "$SIGNING_STORE_FILE" | md5sum --check - | |
| - name: Set up authentication for Google Cloud SDK | |
| uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13 | |
| with: | |
| credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }} | |
| - name: Set up Google Cloud SDK | |
| uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2.2.1 | |
| with: | |
| version: '>= 363.0.0' | |
| project_id: mobile-app-build-290400 | |
| - name: Download Samsung libraries | |
| env: | |
| SAMSUNG_LIB: samsung_libs_v5.0_20250906 | |
| run: | | |
| gsutil cp gs://mobile-app-build-290400_github-actions/lib/v5.0/${SAMSUNG_LIB}.zip /tmp/ && \ | |
| unzip /tmp/${SAMSUNG_LIB}.zip -d /tmp/${SAMSUNG_LIB} && \ | |
| rm /tmp/${SAMSUNG_LIB}.zip && \ | |
| mkdir -p mobile_back_samsung/samsung/lib/internal && \ | |
| mv /tmp/${SAMSUNG_LIB}/* mobile_back_samsung/samsung/lib/internal/ | |
| - name: Download QTI SDK | |
| env: | |
| QTI_SDK: qairt-2.29.0.241129-linux | |
| run: | | |
| gsutil cp gs://mobile-app-build-290400_github-actions/lib/v5.0/${QTI_SDK}.zip /tmp/ && \ | |
| unzip /tmp/${QTI_SDK}.zip -d /tmp/${QTI_SDK} && \ | |
| rm /tmp/${QTI_SDK}.zip && \ | |
| mv /tmp/${QTI_SDK}/* mobile_back_qti/ | |
| - name: Download QTI libraries | |
| env: | |
| QTI_LIB: StableDiffusionShared.0.1.1.250124 | |
| run: | | |
| gsutil cp gs://mobile-app-build-290400_github-actions/lib/v5.0/${QTI_LIB}.zip /tmp/ && \ | |
| unzip /tmp/${QTI_LIB}.zip -d /tmp/${QTI_LIB} && \ | |
| rm /tmp/${QTI_LIB}.zip && \ | |
| mv /tmp/${QTI_LIB}/* mobile_back_qti/cpp/backend_qti/StableDiffusionShared/ | |
| - name: Cache bazel | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: /tmp/bazel_cache | |
| key: ${{ runner.os }}-bazel_cache-${{ hashFiles('**/BUILD', '**/WORKSPACE') }} | |
| restore-keys: ${{ runner.os }}-bazel_cache- | |
| - name: Run Flutter unit tests | |
| run: | | |
| make flutter/prepare && make flutter/test/unit | |
| - name: Build and upload test APK for TFLite | |
| env: | |
| OFFICIAL_BUILD: false | |
| PERF_TEST: true | |
| WITH_TFLITE: 1 | |
| run: | | |
| make flutter/android/release flutter/android/apk flutter/android/test-apk | |
| gsutil mv output/android-apks/test-main.apk $GCLOUD_BUCKET_PATH/test-main-tflite.apk | |
| gsutil mv output/android-apks/test-helper.apk $GCLOUD_BUCKET_PATH/test-helper-tflite.apk | |
| - name: Build and upload test APK for Pixel | |
| env: | |
| OFFICIAL_BUILD: false | |
| PERF_TEST: true | |
| WITH_TFLITE: 0 | |
| WITH_PIXEL: 1 | |
| run: | | |
| make flutter/android/release flutter/android/apk flutter/android/test-apk | |
| gsutil mv output/android-apks/test-main.apk $GCLOUD_BUCKET_PATH/test-main-pixel.apk | |
| gsutil mv output/android-apks/test-helper.apk $GCLOUD_BUCKET_PATH/test-helper-pixel.apk | |
| - name: Build and upload test APK for QTI | |
| env: | |
| OFFICIAL_BUILD: false | |
| PERF_TEST: true | |
| WITH_TFLITE: 0 | |
| WITH_QTI: 1 | |
| WITH_STABLEDIFFUSION: 1 | |
| run: | | |
| make flutter/android/release flutter/android/apk flutter/android/test-apk | |
| gsutil mv output/android-apks/test-main.apk $GCLOUD_BUCKET_PATH/test-main-qti.apk | |
| gsutil mv output/android-apks/test-helper.apk $GCLOUD_BUCKET_PATH/test-helper-qti.apk | |
| - name: Build and upload test APK for MediaTek | |
| env: | |
| OFFICIAL_BUILD: false | |
| PERF_TEST: true | |
| WITH_TFLITE: 0 | |
| WITH_MEDIATEK: 1 | |
| run: | | |
| make flutter/android/release flutter/android/apk flutter/android/test-apk | |
| gsutil mv output/android-apks/test-main.apk $GCLOUD_BUCKET_PATH/test-main-mtk.apk | |
| gsutil mv output/android-apks/test-helper.apk $GCLOUD_BUCKET_PATH/test-helper-mtk.apk | |
| - name: Build and upload test APK for Samsung | |
| env: | |
| OFFICIAL_BUILD: false | |
| PERF_TEST: true | |
| WITH_TFLITE: 0 | |
| WITH_SAMSUNG: 1 | |
| run: | | |
| make flutter/android/release flutter/android/apk flutter/android/test-apk | |
| gsutil mv output/android-apks/test-main.apk $GCLOUD_BUCKET_PATH/test-main-samsung.apk | |
| gsutil mv output/android-apks/test-helper.apk $GCLOUD_BUCKET_PATH/test-helper-samsung.apk | |
| - name: Build and upload test APK for all backends | |
| env: | |
| OFFICIAL_BUILD: false | |
| PERF_TEST: true | |
| WITH_TFLITE: 1 | |
| WITH_PIXEL: 1 | |
| WITH_MEDIATEK: 1 | |
| WITH_QTI: 1 | |
| WITH_SAMSUNG: 1 | |
| WITH_APPLE: 0 | |
| run: | | |
| make flutter/android/release flutter/android/apk flutter/android/test-apk | |
| gsutil mv output/android-apks/test-main.apk $GCLOUD_BUCKET_PATH/test-main-unified.apk | |
| gsutil mv output/android-apks/test-helper.apk $GCLOUD_BUCKET_PATH/test-helper-unified.apk | |
| - name: Build Android release APK with all backends | |
| env: | |
| OFFICIAL_BUILD: true | |
| FIREBASE_CRASHLYTICS_ENABLED: true | |
| WITH_TFLITE: 1 | |
| WITH_PIXEL: 1 | |
| WITH_MEDIATEK: 1 | |
| WITH_QTI: 1 | |
| WITH_SAMSUNG: 1 | |
| WITH_APPLE: 0 | |
| WITH_STABLEDIFFUSION: 1 | |
| run: | | |
| make flutter/android/release | |
| gsutil cp flutter/build/app/outputs/bundle/release/app-release.aab $GCLOUD_BUCKET_PATH/app-release.aab | |
| gsutil cp flutter/build/app/outputs/flutter-apk/app-release.apk $GCLOUD_BUCKET_PATH/app-release.apk | |
| - name: Archive APK with TFLite backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-apk-tflite-${{ github.run_number }} | |
| path: output/android-apks/*-t-${{ github.run_number }}.apk | |
| retention-days: 28 | |
| if-no-files-found: error | |
| - name: Archive APK with Pixel backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-apk-pixel-${{ github.run_number }} | |
| path: output/android-apks/*-g-${{ github.run_number }}.apk | |
| retention-days: 28 | |
| if-no-files-found: error | |
| - name: Archive APK with QTI backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-apk-qti-${{ github.run_number }} | |
| path: output/android-apks/*-q-${{ github.run_number }}.apk | |
| retention-days: 28 | |
| if-no-files-found: error | |
| - name: Archive APK with MediaTek backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-apk-mtk-${{ github.run_number }} | |
| path: output/android-apks/*-m-${{ github.run_number }}.apk | |
| retention-days: 28 | |
| if-no-files-found: error | |
| - name: Archive APK with Samsung backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-apk-samsung-${{ github.run_number }} | |
| path: output/android-apks/*-s-${{ github.run_number }}.apk | |
| retention-days: 28 | |
| if-no-files-found: error | |
| - name: Archive APK with unified backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-apk-unified-${{ github.run_number }} | |
| path: output/android-apks/*-qsmgt-${{ github.run_number }}.apk | |
| retention-days: 28 | |
| if-no-files-found: error | |
| - name: Archive AAB with unified backend | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: android-aab-unified-${{ github.run_number }} | |
| path: output/android-apks/*-qsmgt-${{ github.run_number }}.aab | |
| retention-days: 28 | |
| if-no-files-found: error | |
| test-android-apk-unified: | |
| name: ${{ matrix.backend }}-${{ matrix.device }} (unified) | |
| needs: build-android-apk | |
| if: github.event_name != 'workflow_dispatch' | |
| 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: "qti" | |
| device: "Samsung Galaxy S25 Ultra-15.0" | |
| - backend: "samsung" | |
| device: "Samsung Galaxy S24-14.0" | |
| - backend: "mtk" | |
| device: "Samsung Galaxy Tab S10 Plus-15.0" | |
| env: | |
| MAIN_APK_NAME: test-main-unified-${{ github.run_number }}.apk | |
| HELPER_APK_NAME: test-helper-unified-${{ github.run_number }}.apk | |
| BROWSERSTACK_LOGS_DIR: /tmp/browserstack-device-logs | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Set up authentication for Google Cloud SDK | |
| uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13 | |
| with: | |
| credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }} | |
| - name: Set up Google Cloud SDK | |
| uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2.2.1 | |
| with: | |
| version: '>= 363.0.0' | |
| - name: Download test APK | |
| run: | | |
| gsutil cp $GCLOUD_BUCKET_PATH/test-main-unified.apk /tmp/$MAIN_APK_NAME | |
| gsutil cp $GCLOUD_BUCKET_PATH/test-helper-unified.apk /tmp/$HELPER_APK_NAME | |
| - name: Upload main app | |
| run: | | |
| curl -u "$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 "$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@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | |
| name: Trigger App Automate | |
| env: | |
| BROWSERSTACK_CREDENTIALS: ${{ secrets.BROWSERSTACK_CREDENTIALS }} | |
| BROWSERSTACK_PROJECT: ${{ github.event.repository.name }} | |
| BROWSERSTACK_APP: ${{ env.MAIN_APK_NAME }} | |
| BROWSERSTACK_TEST_SUITE: ${{ env.HELPER_APK_NAME }} | |
| BROWSERSTACK_BUILD_TAG: ${{ matrix.device }} | |
| BROWSERSTACK_LOGS_DIR: ${{ env.BROWSERSTACK_LOGS_DIR }} | |
| 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 | |
| - name: Upload BrowserStack logs | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: always() | |
| with: | |
| name: logs-${{ matrix.backend }}-${{ matrix.device }}-${{ github.run_number }} | |
| path: ${{ env.BROWSERSTACK_LOGS_DIR }} | |
| retention-days: 28 | |
| if-no-files-found: error | |
| test-android-apk-unified-extended: | |
| name: ${{ matrix.backend }}-${{ matrix.device }} (unified-extended) | |
| needs: | |
| - build-android-apk | |
| - test-android-apk-unified | |
| if: github.ref == 'refs/heads/master' || vars.EXTENDED_TESTS_ON_PR == 'true' | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 2 | |
| matrix: | |
| include: | |
| - backend: "qti" | |
| device: "Samsung Galaxy S25-15.0" | |
| # Comment out S24 Ultra-14.0 until we have a fix for it. | |
| # - backend: "qti" | |
| # device: "Samsung Galaxy S24 Ultra-14.0" | |
| - backend: "qti" | |
| device: "Samsung Galaxy S23 Ultra-13.0" | |
| - backend: "qti" | |
| device: "Samsung Galaxy S23-13.0" | |
| - backend: "qti" | |
| device: "Samsung Galaxy Tab S9-13.0" | |
| - backend: "samsung" | |
| device: "Samsung Galaxy S22 Ultra-12.0" | |
| - backend: "samsung" | |
| device: "Samsung Galaxy S22 Plus-12.0" | |
| - backend: "samsung" | |
| device: "Samsung Galaxy S22-12.0" | |
| - backend: "samsung" | |
| device: "Samsung Galaxy S21-12.0" | |
| env: | |
| MAIN_APK_NAME: test-main-unified-${{ github.run_number }}.apk | |
| HELPER_APK_NAME: test-helper-unified-${{ github.run_number }}.apk | |
| BROWSERSTACK_LOGS_DIR: /tmp/browserstack-device-logs | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Set up authentication for Google Cloud SDK | |
| uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13 | |
| with: | |
| credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }} | |
| - name: Set up Google Cloud SDK | |
| uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2.2.1 | |
| with: | |
| version: '>= 363.0.0' | |
| - name: Download test APK | |
| run: | | |
| gsutil cp $GCLOUD_BUCKET_PATH/test-main-unified.apk /tmp/$MAIN_APK_NAME | |
| gsutil cp $GCLOUD_BUCKET_PATH/test-helper-unified.apk /tmp/$HELPER_APK_NAME | |
| - name: Upload main app | |
| run: | | |
| curl -u "$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 "$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@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | |
| name: Trigger App Automate | |
| env: | |
| BROWSERSTACK_CREDENTIALS: ${{ secrets.BROWSERSTACK_CREDENTIALS }} | |
| BROWSERSTACK_PROJECT: ${{ github.event.repository.name }} | |
| BROWSERSTACK_APP: ${{ env.MAIN_APK_NAME }} | |
| BROWSERSTACK_TEST_SUITE: ${{ env.HELPER_APK_NAME }} | |
| BROWSERSTACK_BUILD_TAG: ${{ matrix.device }} | |
| BROWSERSTACK_LOGS_DIR: ${{ env.BROWSERSTACK_LOGS_DIR }} | |
| 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 | |
| - name: Upload BrowserStack logs | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: always() | |
| with: | |
| name: logs-${{ matrix.backend }}-${{ matrix.device }}-${{ github.run_number }} | |
| path: ${{ env.BROWSERSTACK_LOGS_DIR }} | |
| retention-days: 28 | |
| if-no-files-found: error | |
| test-android-apk-single: | |
| name: ${{ matrix.backend }}-${{ matrix.device }} (single) | |
| needs: | |
| - build-android-apk | |
| - test-android-apk-unified | |
| if: github.event_name == 'workflow_dispatch' | |
| 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-15.0" | |
| - backend: "qti" | |
| device: "Samsung Galaxy S25 Ultra-15.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 | |
| BROWSERSTACK_LOGS_DIR: /tmp/browserstack-device-logs | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Set up authentication for Google Cloud SDK | |
| uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13 | |
| with: | |
| credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }} | |
| - name: Set up Google Cloud SDK | |
| uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2.2.1 | |
| 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: | | |
| curl -u "$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 "$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@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | |
| name: Trigger App Automate | |
| env: | |
| BROWSERSTACK_CREDENTIALS: ${{ secrets.BROWSERSTACK_CREDENTIALS }} | |
| BROWSERSTACK_PROJECT: ${{ github.event.repository.name }} | |
| BROWSERSTACK_APP: ${{ env.MAIN_APK_NAME }} | |
| BROWSERSTACK_TEST_SUITE: ${{ env.HELPER_APK_NAME }} | |
| BROWSERSTACK_BUILD_TAG: ${{ matrix.device }} | |
| BROWSERSTACK_LOGS_DIR: ${{ env.BROWSERSTACK_LOGS_DIR }} | |
| 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 | |
| - name: Upload BrowserStack logs | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: always() | |
| with: | |
| name: logs-${{ matrix.backend }}-${{ matrix.device }}-${{ github.run_number }} | |
| path: ${{ env.BROWSERSTACK_LOGS_DIR }} | |
| retention-days: 28 | |
| if-no-files-found: error | |
| deploy-playstore: | |
| needs: | |
| - build-android-apk | |
| - test-android-apk-unified | |
| runs-on: ubuntu-22.04 | |
| if: vars.DEPLOY_PLAYSTORE == 'true' | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Set up authentication for Google Cloud SDK | |
| uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13 | |
| with: | |
| credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }} | |
| - name: Set up Google Cloud SDK | |
| uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2.2.1 | |
| with: | |
| version: '>= 363.0.0' | |
| project_id: mobile-app-build-290400 | |
| - name: Download Android release app | |
| run: | | |
| gsutil cp $GCLOUD_BUCKET_PATH/app-release.aab /tmp/app-release.aab | |
| - name: Upload Android release app to Google Play | |
| uses: r0adkll/upload-google-play@935ef9c68bb393a8e6116b1575626a7f5be3a7fb # v1.1.3 | |
| with: | |
| releaseFiles: /tmp/app-release.aab | |
| packageName: org.mlcommons.android.mlperfbench | |
| serviceAccountJsonPlainText: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }} | |
| track: internal # "alpha", "beta", "internal" or "production" | |
| status: draft | |
| changesNotSentForReview: ${{ vars.CHANGES_NOT_SENT_FOR_REVIEW }} |