From 14101229cc2e0c0208bce63f1fc8f482842a03c7 Mon Sep 17 00:00:00 2001 From: Anh Date: Sun, 2 Mar 2025 14:27:24 +0700 Subject: [PATCH 1/6] Add CodeQL analysis --- .github/workflows/code-analysis.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml index 54905ed7c..09713949c 100644 --- a/.github/workflows/code-analysis.yml +++ b/.github/workflows/code-analysis.yml @@ -83,3 +83,22 @@ jobs: cache-to: type=gha,mode=max - name: Scan code run: make docker/scanner/scan + + codeql: + name: CodeQL + runs-on: ubuntu-latest + permissions: + security-events: write + packages: read + actions: read + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: java-kotlin, javascript-typescript, python, actions + build-mode: none + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 From ea5f3018a852eaf41676c6e7c9af991384ec174d Mon Sep 17 00:00:00 2001 From: Anh Date: Sun, 2 Mar 2025 17:02:41 +0700 Subject: [PATCH 2/6] Remove _CE_MACHINE_TYPE from flutter-windows.yaml so we can set it on GCP --- .github/cloudbuild/flutter-windows.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/cloudbuild/flutter-windows.yaml b/.github/cloudbuild/flutter-windows.yaml index 4c64d3e13..540857749 100644 --- a/.github/cloudbuild/flutter-windows.yaml +++ b/.github/cloudbuild/flutter-windows.yaml @@ -7,7 +7,6 @@ substitutions: # This allows to use more resources simultaneously as different machine types in different regions don't share quotas. _CE_REGION: us-central1 _CE_ZONE: us-central1-f - _CE_MACHINE_TYPE: n2-standard-4 steps: # We need this step to correctly identify dockerfile tag From b59eadc9f61bac2c63047d0e7cf29beb5f8f2e0c Mon Sep 17 00:00:00 2001 From: Anh Date: Sun, 2 Mar 2025 20:02:52 +0700 Subject: [PATCH 3/6] Update expected_throughput for Windows --- flutter/integration_test/expected_throughput.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flutter/integration_test/expected_throughput.dart b/flutter/integration_test/expected_throughput.dart index f3925faa7..6de169957 100644 --- a/flutter/integration_test/expected_throughput.dart +++ b/flutter/integration_test/expected_throughput.dart @@ -39,8 +39,8 @@ const _kIphoneOnMacbookM1 = 'iPhone14,7'; const Map> _imageClassificationV2 = { _kTFLiteBackend: { - _kCloudBuildX23: Interval(min: 1, max: 9), - _kCloudBuildX28: Interval(min: 1, max: 9), + _kCloudBuildX23: Interval(min: 0.5, max: 9), + _kCloudBuildX28: Interval(min: 0.5, max: 9), _kRyzen5600: Interval(min: 1, max: 37), _kPixel5: Interval(min: 20, max: 75), _kPixel6: Interval(min: 100, max: 600), @@ -70,8 +70,8 @@ const Map> _imageClassificationV2 = { const Map> _objectDetection = { _kTFLiteBackend: { - _kCloudBuildX23: Interval(min: 4, max: 7), - _kCloudBuildX28: Interval(min: 3.5, max: 8), + _kCloudBuildX23: Interval(min: 2, max: 7), + _kCloudBuildX28: Interval(min: 2, max: 8), _kRyzen5600: Interval(min: 14, max: 22), _kPixel5: Interval(min: 40, max: 60), _kPixel6: Interval(min: 100, max: 450), @@ -226,8 +226,8 @@ const Map> _stableDiffusion = { const Map> _imageClassificationOfflineV2 = { _kTFLiteBackend: { - _kCloudBuildX23: Interval(min: 1, max: 9), - _kCloudBuildX28: Interval(min: 1, max: 9), + _kCloudBuildX23: Interval(min: 0.8, max: 9), + _kCloudBuildX28: Interval(min: 0.8, max: 9), _kRyzen5600: Interval(min: 20, max: 60), _kPixel5: Interval(min: 20, max: 180), _kPixel6: Interval(min: 100, max: 700), From e07c91d13fc5ba25c7a65a35e1ff563892104452 Mon Sep 17 00:00:00 2001 From: Anh Date: Mon, 3 Mar 2025 08:45:56 +0700 Subject: [PATCH 4/6] Use var DEPLOY_PLAYSTORE to control deploy-playstore job --- .github/workflows/android-build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-build-test.yml b/.github/workflows/android-build-test.yml index 470d4db2b..1b71d5f48 100644 --- a/.github/workflows/android-build-test.yml +++ b/.github/workflows/android-build-test.yml @@ -381,7 +381,7 @@ jobs: - build-android-apk - test-android-apk-unified runs-on: ubuntu-22.04 - # if: github.ref == 'refs/heads/master' + if: vars.DEPLOY_PLAYSTORE == 'true' steps: - uses: actions/checkout@v4 - name: Set up authentication for Google Cloud SDK From a3ed11ff7df0bde40236d270aaf81ba9dc87db02 Mon Sep 17 00:00:00 2001 From: Anh Date: Mon, 3 Mar 2025 09:00:50 +0700 Subject: [PATCH 5/6] Add BROWSERSTACK_PROJECT to differentiate build between repos --- .github/workflows/android-build-test.yml | 2 ++ .github/workflows/scripts/browserstack-app-automate.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-build-test.yml b/.github/workflows/android-build-test.yml index 1b71d5f48..c2a38e50f 100644 --- a/.github/workflows/android-build-test.yml +++ b/.github/workflows/android-build-test.yml @@ -291,6 +291,7 @@ jobs: 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: ${{ github.run_number }} @@ -363,6 +364,7 @@ jobs: 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: ${{ github.run_number }} diff --git a/.github/workflows/scripts/browserstack-app-automate.sh b/.github/workflows/scripts/browserstack-app-automate.sh index 2489d221a..311b8a5e1 100644 --- a/.github/workflows/scripts/browserstack-app-automate.sh +++ b/.github/workflows/scripts/browserstack-app-automate.sh @@ -3,7 +3,6 @@ # This script is used to trigger a build on BrowserStack App Automate and monitor its status. # Build parameters -PROJECT="mobile-app-build-290400" DEVICE_LOGS=true RETRY_INTERVAL=10 @@ -13,6 +12,7 @@ STATUS_URL="https://api-cloud.browserstack.com/app-automate/flutter-integration- # Retrieve vars from environment variables CREDENTIALS="${BROWSERSTACK_CREDENTIALS:-}" +PROJECT="${BROWSERSTACK_PROJECT:-}" APP="${BROWSERSTACK_APP:-}" TEST_SUITE="${BROWSERSTACK_TEST_SUITE:-}" BUILD_TAG="${BROWSERSTACK_BUILD_TAG:-}" @@ -26,7 +26,7 @@ fi if [[ -z "$APP" || -z "$TEST_SUITE" || -z "$BUILD_TAG" || -z "$DEVICES" ]]; then echo "Error: Environment variables"\ - "BROWSERSTACK_APP, BROWSERSTACK_TEST_SUITE, BROWSERSTACK_BUILD_TAG and BROWSERSTACK_DEVICES"\ + "BROWSERSTACK_PROJECT, BROWSERSTACK_APP, BROWSERSTACK_TEST_SUITE, BROWSERSTACK_BUILD_TAG and BROWSERSTACK_DEVICES"\ "must be set." exit 1 fi From db4959cdbe49b6121d53688ce06997266c992c39 Mon Sep 17 00:00:00 2001 From: Anh Date: Wed, 26 Feb 2025 07:58:57 +0700 Subject: [PATCH 6/6] Show app name in browserstack log --- .../workflows/scripts/browserstack-app-automate.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scripts/browserstack-app-automate.sh b/.github/workflows/scripts/browserstack-app-automate.sh index 311b8a5e1..cc2ead96c 100644 --- a/.github/workflows/scripts/browserstack-app-automate.sh +++ b/.github/workflows/scripts/browserstack-app-automate.sh @@ -67,11 +67,13 @@ check_build_status() { # Display device status if [[ "$status" != "running" ]]; then echo "$response" | jq -r ' - .devices[] | - "Device: " + .device + - ", OS Version: " + .os_version + - ", Duration: " + (.sessions[0].duration | tostring) + "s" + - ", Status: " + (.sessions[0].status) + "App: " + .input_capabilities.app + + ( .devices[] | + ", Device: " + .device + + ", OS Version: " + .os_version + + ", Duration: " + (.sessions[0].duration | tostring) + "s" + + ", Status: " + (.sessions[0].status) + ) ' fi