Skip to content

Commit

Permalink
Fix Android dependencies and emulator in Circle CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vgaidarji committed Jan 7, 2018
1 parent d9ad3b9 commit f9ef855
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@ jobs:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Install Android dependencies
command: sdkmanager "system-images;android-25;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-25;default;armeabi-v7a"
command: |
sdkmanager "platform-tools"
sdkmanager "platforms;android-15"
sdkmanager "platforms;android-21"
sdkmanager "platforms;android-22"
sdkmanager "platforms;android-25"
sdkmanager "build-tools;24.0.3"
sdkmanager "extras;android;m2repository"
sdkmanager "extras;google;m2repository"
sdkmanager "extras;google;google_play_services"
sdkmanager "system-images;android-21;default;armeabi-v7a"
- run:
name: Setup emulator
command: sdkmanager "system-images;android-21;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-21;default;armeabi-v7a"
- run:
name: Launch emulator
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
Expand All @@ -30,13 +43,18 @@ jobs:
name: Wait for emulator
command: |
./wait_for_emulator.sh
# emulator isn't ready yet, wait 1 min more
# prevents APK installation error
sleep 60
# unlock the Lock Screen
adb shell input keyevent 82 &
adb shell input keyevent 4 &
- run:
name: Run UI tests
command: |
sleep 120
# manually install APK's and run instrumentation tests
./gradlew assembleDebug -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
./gradlew assembleDebugAndroidTest -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
adb install app/build/outputs/apk/app-debug.apk
adb install app/build/outputs/apk/app-debug-androidTest.apk
adb shell am instrument -w -r -e debug false -e class com.vgaidarji.cimatters.LoginActivityTest com.vgaidarji.cimatters.test/android.support.test.runner.AndroidJUnitRunner
Expand Down

0 comments on commit f9ef855

Please sign in to comment.