Skip to content

Commit

Permalink
Publish artifacts from running multiple orientations per device (#168)
Browse files Browse the repository at this point in the history
* Enable multiple orientations per device feature

* Fix doc error

* Publish artifacts on every push

* Fixed syntax

* Reverted to remove orientation in CI (requires user permission on mac)

* Run imagemagick install in background

* Removed multiple locales

* Removed attempt to tag in build

* Removed start of emulator in CI

* Added android test on cirrus

* Added custom docker build dependency to cirrus build

* Removed emulator on CI start test

* Set default config.ini

* Change to Nexus 6 with no skin

* Corrected name of emulator

* Adjust emulator config

* Fixed syntax

* Change to supported Nexus 6P

* Run only android task

* Fix emulator name

* Added hardware acceleration and configure emulator

* Change name of device to match running emulator

* Fix isEmulator from flutter daemon when emulator is running

* Publish screenshots from linux

* Collect artifacts

* Verbose emulator

* Removed override of emulator bool

* Added progress indicator

* Removed start emulator in CI

* Added test for clearing fastlane directories

* Improved test

* Use check for CI to tests only

* Fixed test

* Fixed test

* Add check for valid emulator id for debug on CI

* Remove old arm support when on CI

* When no orientation specified in config, default to Portrait

* Fix publishing artifacts

* Remove use of headless emulator

* Try another emulator config

* Replace hack for running emulator in CI

* Wait for emulator right before testing

* Quote path to artifacts

* Add gradle caching

* Add more gradle caching

* Remove bogus command

* Fix cache cleanup

* Run in landscape

* Get arch of running emulator

* Removed reconfig

* Changed caching

* Fixed syntax

* Fixed syntax

* Changed from git to path

* Accept licenses

* Ignore licenses

* Add multiple orientations

* Clean cache

* Compare with matched case

* Fix cache cleanup

* Change emulator name to upper case

* Reconfig emulator

* Ignore cd and EMULATOR_NAME

* Fixed name of avd and cat config

* Fixed name of artifacts bundle

* Add checks for type of device

* Fixed emulator comparison

* Look at ini file

* Added hack to daemon client for CI

* Removed isCI() from tests

* Cleanup test

* Added device, emulator equality

* Relocated imagemagick installed check

* Updated README

* Added more expects

* Re-implemented image processor test

* Re-enabled other builds

* Fixed test on CI

* Run imagemagick install in background

* Install imagemagick earlier

* Set fake operating system earlier

* Fixed typo

* Remove a log message

* Minor change

* Re-ordered guides

* Cleanup test

* Allow failure on macos

* Fix issue with guide test

* Add fake process calls to guide test

* Pin version of dart for unit tests

* Add coverage

* Pin version of coverage

* If verbose set run driver with verbose

* Fix imagemagick install on macos, pin coverage

* Set emulator name to upper case

* set verbose default to false

* Removed unused code and tests

* Run log in background

* Added comments

* Improved tests

* Extend hack to work on windows

* Fix for appveyor

* Fix for cirrus

* Debug on cirrus

* Fix for appveyor

* Default to no CI, removed test for CI

* Change config on cirrus

* Removed debug

* Reverted to known working config
  • Loading branch information
mmcc007 authored Nov 30, 2019
1 parent b24c16a commit ed88f1a
Show file tree
Hide file tree
Showing 35 changed files with 1,450 additions and 758 deletions.
13 changes: 13 additions & 0 deletions .ci/Dockerfile.x86
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM cirrusci/flutter:stable

ENV EMULATOR_API_LEVEL=28 ABI="default;x86" EMULATOR_NAME='NEXUS_6P_API_28'

RUN sudo apt-get update && \
sudo apt-get install -y imagemagick && \
sudo rm -rf /var/lib/apt/lists/*

RUN sdkmanager --update && sdkmanager "system-images;android-$EMULATOR_API_LEVEL;$ABI"

RUN echo no | avdmanager create avd -n $EMULATOR_NAME -k "system-images;android-$EMULATOR_API_LEVEL;$ABI"

#ADD .ci/config.ini $HOME/.android/avd/$EMULATOR_NAME.avd/config.ini
49 changes: 49 additions & 0 deletions .ci/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
AvdId=Nexus_6P_API_28
PlayStore.enabled=false
abi.type=x86_64
avd.ini.displayname=Nexus 6P API 28
avd.ini.encoding=UTF-8
disk.dataPartition.size=800M
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes
hw.accelerometer=no
hw.arc=false
hw.audioInput=yes
hw.battery=yes
hw.camera.back=none
hw.camera.front=none
hw.cpu.arch=x86_64
hw.cpu.ncore=2
hw.dPad=no
hw.device.hash2=MD5:869d76256fcdae165862720ddb8343f9
hw.device.manufacturer=Google
hw.device.name=Nexus 6P
hw.gps=no
hw.gpu.enabled=yes
hw.gpu.mode=auto
hw.initialOrientation=Portrait
hw.keyboard=yes
hw.lcd.density=480
hw.lcd.height=2560
hw.lcd.width=1440
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=no
hw.sensors.proximity=no
hw.trackBall=no
image.sysdir.1=system-images/android-28/default/x86_64/
runtime.network.latency=none
runtime.network.speed=full
sdcard.path=$HOME/.android/avd/$EMULATOR_NAME.avd/sdcard.img
sdcard.size=100M
showDeviceFrame=no
skin.dynamic=yes
skin.name=1440x2560
skin.path=_no_skin
skin.path.backup=_no_skin
tag.display=Default Android System Image
tag.id=default
vm.heapSize=256
144 changes: 138 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
unit_task:
container:
image: cirrusci/flutter:latest
image: cirrusci/flutter:stable
pub_cache:
folder: ~/.pub-cache
imagemagic_script:
imagemagic_install_script:
- sudo apt-get update -y
- sudo apt-get install -y imagemagick
pub_get_script:
Expand All @@ -12,23 +12,155 @@ unit_task:
- pub get # because no pubspec.lock
test_script:
- pub run test test/all_tests.dart
activate_coverage_script:
- pub global activate coverage 0.13.3
coverage_test_script:
- script/code_coverage.sh

integration_task:
ios_integration_task:
osx_instance:
image: mojave-xcode-11.2.1-flutter
# image: mojave-xcode-10.1-flutter
pub_cache:
folder: ~/.pub-cache
simulators_script:
- xcrun simctl list devicetypes
- xcrun simctl list runtimes
simulators_json_script:
- xcrun simctl list devices --json
imagemagick_install_script:
- brew install imagemagick
- convert -version || echo -n
doctor_script: flutter doctor -v
activate_script: pub global activate --source path .
imagemagick_script: brew install imagemagick
test_script:
- export PATH="$HOME/.pub-cache/bin:$PATH" # needed to find screenshots
- cd example
- screenshots -c screenshots_ios.yaml -v
find_artifacts: find ios/fastlane/screenshots
screenshot_artifacts:
path: ios/fastlane/screenshots
path: example/ios/fastlane/screenshots/*

android_integration_task:
container:
dockerfile: .ci/Dockerfile.x86
cpu: 4
memory: 10G
kvm: true
pub_cache:
folder: ~/.pub-cache
gradle_cache:
folder: ~/.gradle/caches
gradle_wrapper_cache:
folder: ~/.gradle/wrapper
emulator_config_script:
# - EMULATOR_NAME=Nexus_6P_API_28
- cat $HOME/.android/avd/$EMULATOR_NAME.ini
- cat $HOME/.android/avd/$EMULATOR_NAME.avd/config.ini
# - rm $HOME/.android/avd/$EMULATOR_NAME.avd/config.ini
# - |
# cat << EOF >> $HOME/.android/avd/$EMULATOR_NAME.avd/config.ini
# hw.lcd.width=1440
# hw.lcd.height=2560
# hw.device.name=Nexus 6P
# hw.device.manufacturer=Google
# avd.ini.displayname=Nexus 6P API 28
# EOF
# - |
# cat << EOF >> $HOME/.android/avd/$EMULATOR_NAME.avd/config.ini
# AvdId=$EMULATOR_NAME
# PlayStore.enabled=false
# abi.type=x86_64
# avd.ini.displayname=Nexus 6P API 28
# avd.ini.encoding=UTF-8
# disk.dataPartition.size=800M
# fastboot.chosenSnapshotFile=
# fastboot.forceChosenSnapshotBoot=no
# fastboot.forceColdBoot=no
# fastboot.forceFastBoot=yes
# hw.accelerometer=no
# hw.arc=false
# hw.audioInput=yes
# hw.battery=yes
# hw.camera.back=virtualscene
# hw.camera.front=emulated
# hw.cpu.arch=x86_64
# hw.cpu.ncore=2
# hw.dPad=no
# hw.device.hash2=MD5:210d8492b0d8f56499facd30fdda7669
# hw.device.manufacturer=Google
# hw.device.name=Nexus 6P
# hw.gps=no
# hw.gpu.enabled=yes
# hw.gpu.mode=auto
# hw.initialOrientation=Portrait
# hw.keyboard=yes
# hw.lcd.density=480
# hw.lcd.height=2560
# hw.lcd.width=1440
# hw.mainKeys=no
# hw.ramSize=1536
# hw.sdCard=yes
# hw.sensors.orientation=no
# hw.sensors.proximity=no
# hw.trackBall=no
# image.sysdir.1=system-images/android-28/default/x86_64/
# runtime.network.latency=none
# runtime.network.speed=full
# sdcard.path=$HOME/.android/avd/$EMULATOR_NAME.avd/sdcard.img
# sdcard.size=100M
# showDeviceFrame=no
# skin.dynamic=yes
# skin.name=1440x2560
# skin.path=_no_skin
# skin.path.backup=_no_skin
# tag.display=Default Android System Image
# tag.id=default
# vm.heapSize=256
# EOF
# - cat $HOME/.android/avd/$EMULATOR_NAME.avd/config.ini
# android_licenses_script:
# - yes | sdkmanager --licenses >/dev/null
start_emulator_background_script:
- sudo chown cirrus:cirrus /dev/kvm
- $ANDROID_HOME/emulator/emulator-headless -version
- $ANDROID_HOME/emulator/emulator-headless -avd $EMULATOR_NAME -no-audio -no-window -verbose
activate_script:
- pub global activate --source path .
wait_for_emulator_script:
- ./script/android-wait-for-emulator.sh
# checks made by daemon to decide if running device is emulator or real
- adb shell getprop ro.product.cpu.abi # 'x86_64' (device)
- adb shell getprop ro.hardware # 'ranchu' (emulator)
- adb shell getprop ro.build.characteristics # 'emulator' (emulator)
- adb shell getprop ro.build.version.release # '9' (emulator)
- adb shell getprop ro.build.version.sdk # '28' (emulator))
- adb shell getprop
# logcat_background_script: adb logcat -e flutter\|Observatory *:I
logcat_background_script: adb logcat -e flutter\|Observatory
doctor_script:
- flutter doctor -v
test_script:
- export PATH="$HOME/.pub-cache/bin:$PATH" # needed to find screenshots
- (cd example; screenshots -c screenshots_android.yaml -v)
screenshots_artifacts:
# path: example/android/fastlane/screenshots/*
path: "example/android/fastlane/metadata/android/*"
cleanup_before_cache_script:
- env
- pwd
- echo GRADLE_VERSION = $GRADLE_VERSION
- ls -la
- find .
- GRADLE_VERSION=$(./example/android/gradlew -version | grep Gradle | awk '{print $2}')
- echo GRADLE_VERSION = $GRADLE_VERSION
- echo $HOME
- echo ~
- find ${HOME}/.gradle/caches || echo -n
- |
if [[ ! -z "$GRADLE_VERSION" ]];
then
rm -rfv ${HOME}/.gradle/caches/$GRADLE_VERSION/
fi
- rm -rfv ${HOME}/.gradle/caches/transforms-1
- rm -rfv ${HOME}/.gradle/caches/journal-1
- find ${HOME}/.gradle/caches/ -name "*.lock" -type f -delete || echo -n
Loading

0 comments on commit ed88f1a

Please sign in to comment.