From 95ae43bbf9b24d2ac42335472e735aa14308b935 Mon Sep 17 00:00:00 2001 From: kbetl-dlb Date: Thu, 17 Aug 2023 13:09:55 +0200 Subject: [PATCH] Check different version of android image, to check which is the fastes --- .github/workflows/android_ci_upgrade.yml | 52 +++++++++++++++++++ .github/workflows/ci.yml | 4 +- scripts/macos_configure-sdkmanager.sh | 27 ++++++++-- .../run-mocked-integration-tests-android.sh | 7 ++- 4 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/android_ci_upgrade.yml diff --git a/.github/workflows/android_ci_upgrade.yml b/.github/workflows/android_ci_upgrade.yml new file mode 100644 index 00000000..64738e38 --- /dev/null +++ b/.github/workflows/android_ci_upgrade.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: + - main + - develop + - release/* + pull_request: + branches: + - main + - develop + - release/* + + workflow_dispatch: + +jobs: + build-macos-android: + name: Flutter android new build test + runs-on: macos-12 + env: + FLUTTER_VERSION: "3.0.3" + ANDROID_SDK_ROOT: "/Users/runner/android-sdk" + ANDROID_HOME: "~/.android" + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Checkout submodules + run: git submodule update --init --recursive + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: 15 + distribution: 'zulu' + - name: Set up Flutter version 🔧 + uses: ./.github/actions/flutter-action + with: + flutter-version: $FLUTTER_VERSION + - name: Fetch dependencies + run: | + flutter pub get + - name: Set up android enviroment + run: | + ./scripts/macos_setup_android_env.sh + - name: Configure sdkmanager + run: | + ./scripts/macos_configure-sdkmanager.sh 32 32.0.0 "android-23;default;x86" + - name: Run android integration tests + run: | + ./scripts/run-mocked-integration-tests-android.sh "android-23;default;x86" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa18d671..70982885 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,10 +92,10 @@ jobs: ./scripts/macos_setup_android_env.sh - name: Configure sdkmanager run: | - ./scripts/macos_configure-sdkmanager.sh + ./scripts/macos_configure-sdkmanager.sh 32 32.0.0 "android-28;default;x86" - name: Run android integration tests run: | - ./scripts/run-mocked-integration-tests-android.sh + ./scripts/run-mocked-integration-tests-android.sh "android-28;default;x86" build-macos-ios: name: flutter build macos ios diff --git a/scripts/macos_configure-sdkmanager.sh b/scripts/macos_configure-sdkmanager.sh index d20050aa..d6bac6b0 100755 --- a/scripts/macos_configure-sdkmanager.sh +++ b/scripts/macos_configure-sdkmanager.sh @@ -1,8 +1,29 @@ #! /usr/bin/env bash -build_tools_version="build-tools;32.0.0" -platform_version="platforms;android-32" -system_image="system-images;android-29;default;x86" +ANDROID_VERSION="32" +if [ "$2" ] + then ANDROID_TOOLS=$1 +fi + +ANDROID_TOOLS="$ANDROID_VERSION" +if [ "$2" ] + then ANDROID_TOOLS=$2 +fi + +ANDROID_IMAGE="android-29;default;x86" +if [ "$3" ] + then ANDROID_IMAGE=$3 +fi + +echo $ANDROID_VERSION + +build_tools_version="build-tools;$ANDROID_TOOLS" +platform_version="platforms;android-$ANDROID_VERSION" +system_image="system-images;$ANDROID_IMAGE" + +echo $platform_version +echo $build_tools_version +echo $system_image export ANDROID_SDK_ROOT=~/android-sdk diff --git a/scripts/run-mocked-integration-tests-android.sh b/scripts/run-mocked-integration-tests-android.sh index 426a18d7..d59f87bb 100755 --- a/scripts/run-mocked-integration-tests-android.sh +++ b/scripts/run-mocked-integration-tests-android.sh @@ -1,7 +1,12 @@ #! /usr/bin/env bash +ANDROID_IMAGE="android-29;default;x86" +if [ "$1" ] + then ANDROID_IMAGE=$1 +fi + device_name="testAVD" -system_image="system-images;android-29;default;x86" +system_image="system-images;$ANDROID_IMAGE" device_port="5554" serial_no="emulator-$device_port" gpu_mode="swiftshader_indirect"