From 11ff830d3d23bbc4bfcaee6e808e89f0026a7b7e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 7 Jan 2019 23:44:28 +0100 Subject: [PATCH] gitlab-ci: first jobs for KVM x86 emulators * seems that android-24-x86 emulator don't work without google_apis * -wipe-data is required to use google_apis_playstore, otherwise adb fails: https://github.com/butomo1989/docker-android/issues/87 --- .gitlab-ci.yml | 84 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2019d361..0dcdfd9bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,15 +59,17 @@ errorprone: # connectedCheck to test all the build flavors .connected-template: &connected-template script: - - ./gradlew assembleDebug + - ./gradlew assembleFullDebug - export AVD_SDK=`echo $CI_JOB_NAME | awk '{print $2}'` - export AVD_TAG=`echo $CI_JOB_NAME | awk '{print $3}'` - export AVD_ARCH=`echo $CI_JOB_NAME | awk '{print $4}'` - export AVD_PACKAGE="system-images;android-${AVD_SDK};${AVD_TAG};${AVD_ARCH}" - echo $AVD_PACKAGE + - emulator -accel-check || true - alias sdkmanager - echo y | sdkmanager "emulator" "platforms;android-$AVD_SDK" > /dev/null - if ! avdmanager list avd | grep "Name. avd$AVD_SDK$"; then + set -x; rm -rf ~/.android/avd $ANDROID_HOME/system-images; echo y | sdkmanager "$AVD_PACKAGE" > /dev/null; echo no | avdmanager create avd --name avd$AVD_SDK --tag "$AVD_TAG" --package "$AVD_PACKAGE" --sdcard 64M --device "Nexus 5"; @@ -75,21 +77,89 @@ errorprone: sed -i '/^hw\.ramSize\s*=.*/d' ~/.android/avd/*.avd/config.ini; echo "hw.ramSize=$RAMSIZE" >> ~/.android/avd/*.avd/config.ini; avdmanager list avd; + set +x; fi - - emulator64-arm -avd avd$AVD_SDK -no-audio -no-window -no-snapstorage & + - adb start-server + - ls -l ~/.android + - emulator -avd avd$AVD_SDK + -no-audio + -no-jni + -no-snapstorage + -no-window + -skip-adb-auth + -verbose + -wipe-data + & - wait-for-emulator + - adb devices - adb shell input keyevent 82 & - ./gradlew connectedFullDebugAndroidTest || (adb -e logcat -d > logcat.txt; exit 1) -connected24: +connected 24 default armeabi-v7a: retry: 1 + only: + - merge_requests <<: *test-template - variables: - AVD_SDK: "24" - AVD_TAG: "default" - AVD_PACKAGE: "system-images;android-${AVD_SDK};${AVD_TAG};armeabi-v7a" <<: *connected-template +.kvm-template: &kvm-template + tags: + - fdroid + - kvm + only: + - merge_requests + - branches@fdroid/fdroidclient + <<: *test-template + <<: *connected-template + +connected 17 default x86: + <<: *kvm-template + +connected 18 default x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 19 default x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 21 default x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 22 default x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 23 default x86: + <<: *kvm-template + +connected 24 google_apis x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 25 default x86: + <<: *kvm-template + +connected 26 google_apis x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 27 google_apis_playstore x86: + <<: *kvm-template + only: + - master@fdroid/fdroidclient + +connected 28 default x86_64: + <<: *kvm-template + + deploy_nightly: stage: deploy only: