2021-02-17 22:55:31 +01:00
|
|
|
image: reactivecircus/android-emulator-23:latest
|
2020-11-08 20:24:38 +01:00
|
|
|
|
2020-04-01 19:38:21 +02:00
|
|
|
|
|
|
|
variables:
|
2021-02-17 22:55:31 +01:00
|
|
|
API_LEVEL: "23"
|
2020-04-01 19:38:21 +02:00
|
|
|
ARCH: "x86"
|
|
|
|
TARGET: "default"
|
2020-11-08 20:24:38 +01:00
|
|
|
|
|
|
|
|
2021-05-08 22:11:04 +02:00
|
|
|
before_script:
|
|
|
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .gradle/wrapper
|
|
|
|
- .gradle/caches
|
|
|
|
|
2020-11-08 20:24:38 +01:00
|
|
|
# Basic android and gradle stuff
|
|
|
|
# Check linting
|
|
|
|
lintDebug:
|
|
|
|
interruptible: true
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- ./gradlew checkLicenses
|
|
|
|
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
|
|
|
|
|
|
|
|
# Make Project
|
|
|
|
assembleDebug:
|
|
|
|
interruptible: true
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- ./gradlew assembleDebug
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- app/build/outputs/
|
|
|
|
|
|
|
|
# Run all tests, if any fails, interrupt the pipeline(fail it)
|
|
|
|
debugTests:
|
|
|
|
interruptible: true
|
|
|
|
stage: test
|
|
|
|
script:
|
2021-03-26 10:26:00 +01:00
|
|
|
- ./gradlew -Pci --console=plain :app:testDebug -x lint
|
2020-11-08 20:24:38 +01:00
|
|
|
|
|
|
|
|
2021-02-17 22:55:31 +01:00
|
|
|
emulatorTest:
|
|
|
|
interruptible: true
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}"
|
|
|
|
- $ANDROID_SDK_ROOT/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none &
|
|
|
|
- chmod +x android-wait-for-emulator.sh
|
2021-03-26 10:26:00 +01:00
|
|
|
- ./gradlew build -x lint
|
2021-02-17 22:55:31 +01:00
|
|
|
- ./android-wait-for-emulator.sh
|
|
|
|
- adb shell settings put global window_animation_scale 0.0
|
|
|
|
- adb shell settings put global transition_animation_scale 0.0
|
|
|
|
- adb shell settings put global animator_duration_scale 0.0
|
|
|
|
|
2021-03-26 10:26:00 +01:00
|
|
|
- ./gradlew build connectedCheck connectedStagingAndroidTest jacocoTestReport -x lint
|
2021-02-17 22:55:31 +01:00
|
|
|
|
|
|
|
- cat app/build/reports/jacoco/jacocoTestReport/html/index.html | grep -o 'Total[^%]*%'
|
|
|
|
|
|
|
|
artifacts:
|
2021-04-20 14:07:18 +02:00
|
|
|
when: always
|
2021-02-17 22:55:31 +01:00
|
|
|
paths:
|
|
|
|
- ./app/build/reports/jacoco/jacocoTestReport/
|
|
|
|
expire_in: 1 week
|