gitlab-ci: default emulator test to F-Droid image
This also only runs one emulator test by default, then runs 3 SDK levels for final commits. The single default test is the optimized F-Droid system image included in the Docker image.
This commit is contained in:
parent
9e4e435ae5
commit
7f314d7781
@ -12,9 +12,10 @@ stages:
|
|||||||
before_script:
|
before_script:
|
||||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||||
- export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
|
- export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
|
||||||
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
|
- echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
|
||||||
|
|
||||||
.test-template: &test-template
|
.test-template: &test-template
|
||||||
|
stage: test
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
|
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
|
||||||
paths:
|
paths:
|
||||||
@ -30,7 +31,6 @@ before_script:
|
|||||||
# Run the most important first. Then we can decide whether to ignore
|
# Run the most important first. Then we can decide whether to ignore
|
||||||
# the style tests if the rest of the more meaningful tests pass.
|
# the style tests if the rest of the more meaningful tests pass.
|
||||||
test:
|
test:
|
||||||
stage: test
|
|
||||||
<<: *test-template
|
<<: *test-template
|
||||||
script:
|
script:
|
||||||
- export EXITVALUE=0
|
- export EXITVALUE=0
|
||||||
@ -44,7 +44,7 @@ test:
|
|||||||
- ./tools/check-format-strings.py
|
- ./tools/check-format-strings.py
|
||||||
- ./tools/remove-unused-and-blank-translations.py
|
- ./tools/remove-unused-and-blank-translations.py
|
||||||
- echo "These are unused or blank translations that should be removed:"
|
- echo "These are unused or blank translations that should be removed:"
|
||||||
- git --no-pager diff --ignore-all-space --name-only --exit-code || export EXITVALUE=1
|
- git --no-pager diff --ignore-all-space --name-only --exit-code app/src/*/res/values*/strings.xml || export EXITVALUE=1
|
||||||
- exit $EXITVALUE
|
- exit $EXITVALUE
|
||||||
|
|
||||||
errorprone:
|
errorprone:
|
||||||
@ -54,34 +54,34 @@ errorprone:
|
|||||||
- ./gradlew assembleDebug
|
- ./gradlew assembleDebug
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
connected14:
|
.connected-template: &connected-template
|
||||||
stage: test
|
|
||||||
<<: *test-template
|
|
||||||
variables:
|
|
||||||
AVD_SDK: "14"
|
|
||||||
script:
|
script:
|
||||||
- ./gradlew assembleDebug
|
- ./gradlew assembleDebug
|
||||||
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-$AVD_SDK"
|
- echo y | sdkmanager "platforms;android-$AVD_SDK" > /dev/null
|
||||||
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-${AVD_SDK};default;armeabi-v7a"
|
- if ! avdmanager list avd | grep "Name. avd$AVD_SDK$"; then
|
||||||
- echo no | android --verbose create avd --name fcl-test-$AVD_SDK --target android-$AVD_SDK
|
rm -rf ~/.android/avd $ANDROID_HOME/system-images;
|
||||||
- emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
|
echo y | sdkmanager "$AVD_PACKAGE" > /dev/null;
|
||||||
- ./tools/wait-for-emulator
|
echo no | avdmanager create avd --name avd$AVD_SDK --tag "$AVD_TAG" --package "$AVD_PACKAGE";
|
||||||
|
avdmanager list avd;
|
||||||
|
fi
|
||||||
|
- emulator64-arm -avd avd$AVD_SDK -no-audio -no-window -no-snapstorage &
|
||||||
|
- wait-for-emulator
|
||||||
- adb shell input keyevent 82 &
|
- adb shell input keyevent 82 &
|
||||||
- ./gradlew connectedCheck || adb -e logcat -d '*:E' > logcat.txt
|
- ./gradlew connectedCheck || (adb -e logcat -d '*:E' > logcat.txt; exit 1)
|
||||||
|
|
||||||
connected24:
|
connected24:
|
||||||
stage: test
|
only:
|
||||||
|
- fdroid/fdroidclient@master
|
||||||
|
<<: *test-template
|
||||||
variables:
|
variables:
|
||||||
AVD_SDK: "24"
|
AVD_SDK: "24"
|
||||||
|
AVD_TAG: "default"
|
||||||
|
AVD_PACKAGE: "system-images;android-${AVD_SDK};${AVD_TAG};armeabi-v7a"
|
||||||
|
<<: *connected-template
|
||||||
|
|
||||||
|
connected25:
|
||||||
<<: *test-template
|
<<: *test-template
|
||||||
script:
|
<<: *connected-template
|
||||||
- ./gradlew assembleDebug
|
|
||||||
- android list avd
|
|
||||||
- emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window &
|
|
||||||
- ./tools/wait-for-emulator
|
|
||||||
- adb shell input keyevent 82 &
|
|
||||||
- adb devices
|
|
||||||
- ./gradlew connectedCheck || adb -e logcat -d '*:E' > logcat.txt
|
|
||||||
|
|
||||||
deploy_nightly:
|
deploy_nightly:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
sec=0
|
|
||||||
timeout=360
|
|
||||||
|
|
||||||
err() {
|
|
||||||
echo "$@"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
explain() {
|
|
||||||
if [[ "$1" =~ "not found" ]]; then
|
|
||||||
printf "device not found"
|
|
||||||
elif [[ "$1" =~ "offline" ]]; then
|
|
||||||
printf "device offline"
|
|
||||||
elif [[ "$1" =~ "running" ]]; then
|
|
||||||
printf "booting"
|
|
||||||
else
|
|
||||||
printf "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
if [[ $sec -ge $timeout ]]; then
|
|
||||||
err "Timeout ($timeout seconds) reached - Failed to start emulator"
|
|
||||||
fi
|
|
||||||
out=$(adb -e shell getprop init.svc.bootanim 2>&1 | grep -v '^\*')
|
|
||||||
if [[ "$out" =~ "command not found" ]]; then
|
|
||||||
err "$out"
|
|
||||||
fi
|
|
||||||
if [[ "$out" =~ "stopped" ]]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
let "r = sec % 5"
|
|
||||||
if [[ $r -eq 0 ]]; then
|
|
||||||
echo "Waiting for emulator to start: $(explain "$out")"
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
let "sec++"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Emulator is ready"
|
|
Loading…
x
Reference in New Issue
Block a user