Merge branch 'ci-emulators' into 'master'
CI: speed up running of Android tests See merge request !284
This commit is contained in:
commit
e96dcd653d
@ -1,48 +1,39 @@
|
||||
image: mvdan/fdroid-ci:client-20160429
|
||||
image: mvdan/fdroid-ci:client-20160512
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .gradle/wrapper
|
||||
- .gradle/caches
|
||||
|
||||
variables:
|
||||
AVD_SDK: "17"
|
||||
SKIN: "QVGA"
|
||||
# switch glibc to a memory conserving mode
|
||||
MALLOC_ARENA_MAX: "2"
|
||||
|
||||
gradle:
|
||||
build:
|
||||
script:
|
||||
- echo y | android update sdk --no-ui --filter android-$AVD_SDK
|
||||
- echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-$AVD_SDK
|
||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||
- ./gradlew assemble -PdisablePreDex
|
||||
# always report on lint errors to the build log
|
||||
- sed -i -e 's,textReport .*,textReport true,' app/build.gradle
|
||||
# 'build' means assemble and check
|
||||
- ./gradlew build -PdisablePreDex || {
|
||||
- ./gradlew lint -PdisablePreDex
|
||||
- ./gradlew test -PdisablePreDex || {
|
||||
for log in app/build/reports/*ests/*/*ml; do
|
||||
echo "read $log here:";
|
||||
cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
|
||||
done;
|
||||
exit 1;
|
||||
}
|
||||
# emulators will only start if they have tiny amounts of RAM
|
||||
- sed -i -e 's,^hw.ramSize=.*,hw.ramSize=384,'
|
||||
-e 's,^vm.heapSize=.*,vm.heapSize=48,'
|
||||
-e 's,^hw.gpu.enabled.*,hw.gpu.enabled = false,'
|
||||
$ANDROID_HOME/platforms/android-$AVD_SDK/skins/$SKIN/hardware.ini
|
||||
- echo "hw.gpu.enabled = false" >>
|
||||
$ANDROID_HOME/platforms/android-$AVD_SDK/skins/$SKIN/hardware.ini
|
||||
- echo no | android --verbose create avd
|
||||
--force
|
||||
--name fcl-test
|
||||
--skin $SKIN
|
||||
--target android-$AVD_SDK
|
||||
- emulator64-arm -avd fcl-test -no-skin -no-audio -no-window &
|
||||
# this file changes every time but should not be cached
|
||||
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
|
||||
|
||||
connectedCheck:
|
||||
variables:
|
||||
AVD_SDK: "17"
|
||||
# switch glibc to a memory conserving mode
|
||||
MALLOC_ARENA_MAX: "2"
|
||||
script:
|
||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||
- emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
|
||||
- ./tools/wait-for-emulator
|
||||
- adb shell input keyevent 82 &
|
||||
- export EXITVALUE=0
|
||||
- ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck -PdisablePreDex || {
|
||||
- ./gradlew connectedCheck -PdisablePreDex || {
|
||||
adb -e logcat -d '*:E';
|
||||
echo "get the full logcat here:";
|
||||
adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com;
|
||||
@ -53,7 +44,6 @@ gradle:
|
||||
echo "read $log here:";
|
||||
cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
|
||||
done
|
||||
- sed -n 's/.*"ctr2">\([0-9]*\)%<.*/Coverage - \1.0% covered\n/p' app/build/reports/coverage/debug/index.html
|
||||
# this file changes every time but should not be cached
|
||||
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
|
||||
- exit $EXITVALUE
|
||||
@ -62,11 +52,15 @@ pmd:
|
||||
script:
|
||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||
- ./gradlew pmd -PdisablePreDex
|
||||
# this file changes every time but should not be cached
|
||||
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
|
||||
|
||||
checkstyle:
|
||||
script:
|
||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||
- ./gradlew checkstyle -PdisablePreDex
|
||||
# this file changes every time but should not be cached
|
||||
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
|
||||
|
||||
tools:
|
||||
script:
|
||||
|
@ -139,9 +139,6 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'src/androidTest/proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
testCoverageEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
Loading…
x
Reference in New Issue
Block a user