Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 32 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
language: android
jdk:
- oraclejdk8
sudo: required

language: android
jdk: oraclejdk8

services:
- docker

env:
- TEST_SUITE=unit
- TEST_SUITE=instrumentation

android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- tools
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-26.0.1

# The SDK version used to compile your project
- android-22
- android-26

# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-24

# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-22


- $(if [ $TEST_SUITE == "instrumentation" ]; then echo "tools,platform-tools,tools,build-tools-26.0.1,android-22,android-26,extra-google-google_play_services,extra-google-m2repository,extra-android-m2repository,addon-google_apis-google-24,sys-img-armeabi-v7a-android-22"; fi)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make the echo multiline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I create a script.sh which reads the BUILD_TOOLS_VERSION and SDK_VERSION and replace the given numbers.
These script return then all components..


before_install:
- if [ $TEST_SUITE == "unit" ]; then
docker pull stefma-docker-hub.bintray.io/android-build-env:0.1-alpha;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can we update this docker image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an open source project.
you can find it here: https://github.com/StefMa/AndroidBuildEnv

docker run -i -v $PWD:/project -t stefma-docker-hub.bintray.io/android-build-env:0.1-alpha /bin/bash -c "./gradlew build jacocoTestReport";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to the script section

fi

before_script:

# First assemble the project before launching the emulator
- ./gradlew assemble

# List available emulators
- android list targets

# Emulator Management: Create, Start and Wait
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- if [ $TEST_SUITE == "instrumentation" ]; then
./gradlew assemble;
echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a;
emulator -avd test -no-skin -no-audio -no-window &
android-wait-for-emulator;
adb shell input keyevent 82 &
fi

script:
- ./gradlew build jacocoTestReport assembleAndroidTest connectedCheck
- if [ $TEST_SUITE == "instrumentation" ]; then
./gradlew assembleAndroidTest connectedCheck;
fi
- if [ $TEST_SUITE == "unit" ]; then
echo "Everything is done already in the before_install docker...";
fi

after_success:
- bash <(curl -s https://codecov.io/bash)