Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codecov and run android tests via travis #526

Merged
merged 6 commits into from Jan 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
29 changes: 25 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,50 @@ jdk: oraclejdk8
env:
global:
- secure: fMBUkSsCBTw/U907w7Xm/yNzw4lq9yt7zFy0JyEZrA543LI7zQRIclIOtsDTUs0bwY+4KI08MNoYPLJ4TQhSJaH4wQ8b9C5TRsqXNfc0V718TcuYqSXqU6VPRVtX46/fCEWv/HAs0ksUKrHIlpWOwLPQpYDcKxwwlUndaakYKJ8=

before_cache:
- cd ${TRAVIS_BUILD_DIR}/gradle/caches/
- find . -name "*.lock" -exec rm -rfv {} \;
- cd ${TRAVIS_BUILD_DIR}

cache:
directories:
- "${TRAVIS_BUILD_DIR}/gradle/caches/"
- "${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/"

notifications:
email: false

android:
components:
- tools
- build-tools-25.0.2
- platform-tools
- tools
- android-22
- sys-img-armeabi-v7a-android-22
Copy link
Member

Choose a reason for hiding this comment

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

What about adding some extras, which should probably enable voice recognition? However, this is not based on facts, just an idea :P I'm also not sure, which of these extras are already included :/ Also: We should first somehow make sure, that it's related to the play services :D

    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository
    - extra-android-support

Copy link
Member

Choose a reason for hiding this comment

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

Can we somehow check a build with these extras to see, if the voice recognition test is still skipped?


install:
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
- "./gradlew --version"
- ./gradlew --version
- sdkmanager --list || true

# Emulator Management: Create, Start and Wait
before_script:
- android list device
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a -d "5.4in FWVGA"
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, this doesn't solve the problem itself, it just works around it :/ What happens, if the demo sitemap changes slightly and the widgets we use in this test are again outside of the view?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a check for "exists, but not visible"?

Copy link
Member

Choose a reason for hiding this comment

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

It seems there isn't :/ Then this should be fine for now :D

- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- android list target

script:
- "./gradlew clean build"
- "./gradlew test"
- ./gradlew build connectedCheck test jacocoTestReport

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

before_deploy:
- openssl aes-256-cbc -K $encrypted_903a93ed2309_key -iv $encrypted_903a93ed2309_iv
-in keystore.enc -out keystore -d
Expand All @@ -35,7 +55,8 @@ before_deploy:
- jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $HOME/keystore
-storepass $storepass mobile-full-release-unsigned.apk sign
- jarsigner -verify mobile-full-release-unsigned.apk
- "${ANDROID_HOME}/build-tools/25.0.2/zipalign -v 4 mobile-full-release-unsigned.apk mobile-full-release.apk"
- ${ANDROID_HOME}/build-tools/25.0.2/zipalign -v 4 mobile-full-release-unsigned.apk mobile-full-release.apk

deploy:
provider: releases
prerelease: true
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.24.4'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 2 additions & 0 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'jacoco-android'

android {
buildToolsVersion '26.0.2'
Expand Down Expand Up @@ -28,6 +29,7 @@ android {
buildConfigField 'boolean', IS_DEVELOPER, 'true'
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + System.currentTimeMillis() + "L)"
pseudoLocalesEnabled true
testCoverageEnabled true
}
}
productFlavors {
Expand Down