Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit e761278

Browse files
committed
Check different version of android image, to check which is the fastes
1 parent b0cbe64 commit e761278

File tree

5 files changed

+135
-22
lines changed

5 files changed

+135
-22
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- release/*
9+
pull_request:
10+
branches:
11+
- main
12+
- develop
13+
- release/*
14+
15+
workflow_dispatch:
16+
17+
jobs:
18+
build-macos-android-23:
19+
name: Flutter Run test on android 23
20+
runs-on: macos-12
21+
env:
22+
FLUTTER_VERSION: "3.0.3"
23+
ANDROID_SDK_ROOT: "/Users/runner/android-sdk"
24+
ANDROID_HOME: "~/.android"
25+
steps:
26+
- name: Checkout 🛎️
27+
uses: actions/checkout@v3
28+
with:
29+
persist-credentials: false
30+
- name: Checkout submodules
31+
run: git submodule update --init --recursive
32+
- name: Set up Java
33+
uses: actions/setup-java@v2
34+
with:
35+
java-version: 17
36+
distribution: 'zulu'
37+
- name: Set up Flutter version 🔧
38+
uses: ./.github/actions/flutter-action
39+
with:
40+
flutter-version: $FLUTTER_VERSION
41+
- name: Fetch dependencies
42+
run: |
43+
flutter pub get
44+
- name: Set up android enviroment
45+
run: |
46+
./scripts/macos_setup_android_env.sh
47+
- name: Configure sdkmanager
48+
run: |
49+
./scripts/macos_configure-sdkmanager.sh 32 32.0.0 "android-23;default;x86"
50+
- name: Run android integration tests
51+
run: |
52+
./scripts/run-mocked-integration-tests-android.sh "android-23;default;x86"
53+
54+
build-macos-android-27:
55+
name: Flutter Run test on android 27
56+
runs-on: macos-12
57+
env:
58+
FLUTTER_VERSION: "3.0.3"
59+
ANDROID_SDK_ROOT: "/Users/runner/android-sdk"
60+
ANDROID_HOME: "~/.android"
61+
steps:
62+
- name: Checkout 🛎️
63+
uses: actions/checkout@v3
64+
with:
65+
persist-credentials: false
66+
- name: Checkout submodules
67+
run: git submodule update --init --recursive
68+
- name: Set up Java
69+
uses: actions/setup-java@v2
70+
with:
71+
java-version: 17
72+
distribution: 'zulu'
73+
- name: Set up Flutter version 🔧
74+
uses: ./.github/actions/flutter-action
75+
with:
76+
flutter-version: $FLUTTER_VERSION
77+
- name: Fetch dependencies
78+
run: |
79+
flutter pub get
80+
- name: Set up android enviroment
81+
run: |
82+
./scripts/macos_setup_android_env.sh
83+
- name: Configure sdkmanager
84+
run: |
85+
./scripts/macos_configure-sdkmanager.sh 32 32.0.0 "android-23;default;x86"
86+
- name: Run android integration tests
87+
run: |
88+
./scripts/run-mocked-integration-tests-android.sh "android-23;default;x86"

.github/workflows/ci.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ jobs:
3434
with:
3535
java-version: 15
3636
distribution: 'adopt'
37-
- name: Enable KVM group perms
38-
run: |
39-
sudo apt -y update
40-
sudo apt-get install -y qemu-kvm
41-
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
42-
sudo udevadm control --reload-rules
43-
sudo udevadm trigger --name-match=kvm
4437
- name: Set up Flutter version 🔧
4538
uses: ./.github/actions/flutter-action
4639
with:
@@ -61,8 +54,8 @@ jobs:
6154
run: |
6255
flutter analyze
6356
64-
build-macos-android:
65-
name: flutter build macos android
57+
build-macos-android-21:
58+
name: flutter build macos android 21
6659
runs-on: macos-12
6760
env:
6861
FLUTTER_VERSION: "3.0.3"
@@ -78,7 +71,7 @@ jobs:
7871
- name: Set up Java
7972
uses: actions/setup-java@v2
8073
with:
81-
java-version: 15
74+
java-version: 17
8275
distribution: 'zulu'
8376
- name: Set up Flutter version 🔧
8477
uses: ./.github/actions/flutter-action
@@ -92,10 +85,10 @@ jobs:
9285
./scripts/macos_setup_android_env.sh
9386
- name: Configure sdkmanager
9487
run: |
95-
./scripts/macos_configure-sdkmanager.sh
88+
./scripts/macos_configure-sdkmanager.sh 32 32.0.0 "android-21;default;x86"
9689
- name: Run android integration tests
9790
run: |
98-
./scripts/run-mocked-integration-tests-android.sh
91+
./scripts/run-mocked-integration-tests-android.sh "android-21;default;x86"
9992
10093
build-macos-ios:
10194
name: flutter build macos ios

scripts/macos_configure-sdkmanager.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
#! /usr/bin/env bash
22

3-
build_tools_version="build-tools;32.0.0"
4-
platform_version="platforms;android-32"
5-
system_image="system-images;android-29;default;x86"
3+
ANDROID_VERSION="32"
4+
if [ "$2" ]
5+
then ANDROID_TOOLS=$1
6+
fi
7+
8+
ANDROID_TOOLS="$ANDROID_VERSION"
9+
if [ "$2" ]
10+
then ANDROID_TOOLS=$2
11+
fi
12+
13+
ANDROID_IMAGE="android-29;default;x86"
14+
if [ "$3" ]
15+
then ANDROID_IMAGE=$3
16+
fi
17+
18+
echo $ANDROID_VERSION
19+
20+
build_tools_version="build-tools;$ANDROID_TOOLS"
21+
platform_version="platforms;android-$ANDROID_VERSION"
22+
system_image="system-images;$ANDROID_IMAGE"
23+
24+
echo $platform_version
25+
echo $build_tools_version
26+
echo $system_image
627

728
export ANDROID_SDK_ROOT=~/android-sdk
829

scripts/macos_setup_android_env.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
echo "Setup android"
44

5-
wget https://dl.google.com/android/repository/commandlinetools-mac-9123335_latest.zip
5+
#TOOLS_VERSION=9123335
6+
TOOLS_VERSION=10406996
67

7-
unzip commandlinetools-mac-9123335_latest.zip
8+
wget "https://dl.google.com/android/repository/commandlinetools-mac-${TOOLS_VERSION}_latest.zip"
9+
10+
unzip "commandlinetools-mac-${TOOLS_VERSION}_latest.zip"
811

912
mkdir ~/android-sdk/
1013
mkdir ~/android-sdk/cmdline-tools

scripts/run-mocked-integration-tests-android.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#! /usr/bin/env bash
22

3+
ANDROID_IMAGE="android-29;default;x86"
4+
if [ "$1" ]
5+
then ANDROID_IMAGE=$1
6+
fi
7+
38
device_name="testAVD"
4-
system_image="system-images;android-29;default;x86"
9+
system_image="system-images;$ANDROID_IMAGE"
510
device_port="5554"
611
serial_no="emulator-$device_port"
712
gpu_mode="swiftshader_indirect"
13+
#gpu_mode="guest"
814

915

1016
export ANDROID_HOME=~/.android/
@@ -21,8 +27,8 @@ avdmanager list avd
2127
echo "Create system image: $system_image"
2228

2329
echo "no" | avdmanager --verbose create avd --force --name $device_name --abi "default/x86" --package "$system_image"
24-
echo "disk.dataPartition.size=8G" >> ~/.android/avd/$device_name.avd/config.ini
25-
echo "hw.ramSize = 3.072MB" >> ~/.android/avd/$device_name.avd/config.ini
30+
echo "disk.dataPartition.size=5G" >> ~/.android/avd/$device_name.avd/config.ini
31+
echo "hw.ramSize = 3072MB" >> ~/.android/avd/$device_name.avd/config.ini
2632
touch ~/.android/emu-update-last-check.ini
2733

2834
ls -la ~/.android/
@@ -38,7 +44,9 @@ echo "check emulator list:"
3844
emulator -list-avds
3945

4046
echo "start: $device_name"
41-
$ANDROID_SDK_ROOT/emulator/emulator -avd $device_name -port $device_port -noaudio -no-window -no-snapshot -no-boot-anim &
47+
$ANDROID_SDK_ROOT/emulator/emulator -avd $device_name -port $device_port -noaudio -no-window -no-snapshot -no-boot-anim -no-snapshot-load &
48+
49+
adb devices
4250

4351
echo "Device name: $device_name"
4452

@@ -65,7 +73,7 @@ currentFolder=`pwd`
6573

6674
cd test_app
6775

68-
USE_SDK_MOCK=true flutter test integration_tests/mocked/master_test.dart -d $serial_no
76+
USE_SDK_MOCK=true flutter test integration_tests/mocked/master_test.dart -d $serial_no -r expanded
6977
test_exit_code=$?
7078

7179
cd $currentFolder

0 commit comments

Comments
 (0)