Commit 9c9565b5 authored by Bruno Agrizzi's avatar Bruno Agrizzi

51systems

parent 0ed198bf
image: jerbob92/gitlab-ci-android:sdk-25 image: 51systems/gitlab-ci-android:latest
before_script:
- export GRADLE_USER_HOME=/cache/.gradle
stages: stages:
- build - build
- test - test
before_script: build:debug:
- export GRADLE_USER_HOME=`pwd`/.gradle stage: build
- mkdir -p $GRADLE_USER_HOME script:
- chmod +x ./gradlew - bash ./gradlew assembleDebug
artifacts:
cache: expire_in: 1 days
paths: paths:
- .gradle/wrapper - "**/build/outputs/**/*.apk"
- .gradle/caches - "**/build/outputs/**/*.aar"
build: build:release:
tags:
- android
stage: build stage: build
script: script:
- ./gradlew assembleDebug - bash ./gradlew assemble
#- ./gradlew assembleDebugAndroidTest artifacts:
expire_in: 1 days
paths:
- "**/build/outputs/**/*.apk"
- "**/build/outputs/**/*.aar"
test:unit:
stage: test
script:
- bash ./gradlew test
artifacts: artifacts:
name: "Tests-${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}_${CI_BUILD_REF}"
when: always
expire_in: 1 weeks
paths: paths:
- app/build/outputs/ - "**/build/reports/tests"
test: test:instrumentation:21:
tags:
- android
stage: test stage: test
image: 51systems/gitlab-ci-android-emulator-21
script: script:
- echo "yes" | /sdk/tools/android update sdk -u -a -t "sys-img-armeabi-v7a-google_apis-25" - android-run-emulator nexus5_21 bash ./gradlew connectedAndroidTest
- echo "no" | /sdk/tools/android create avd -f -n test -t android-25 --abi "google_apis/armeabi-v7a" -s WXGA720
- echo "no" | /sdk/tools/emulator64-x86 -avd test -wipe-data -noaudio -no-window -gpu off -verbose -qemu -usbdevice tablet -vnc :2 &
- /helpers/wait-for-avd-boot.sh
- /sdk/platform-tools/adb install -r app/build/outputs/apk/app-debug.apk
- /sdk/platform-tools/adb install -r app/build/outputs/apk/app-debug-androidTest-unaligned.apk
- /sdk/platform-tools/adb shell pm grant [package-name] android.permission.SET_ANIMATION_SCALE
- flvrec.py -o test.flv localhost 5902 &
- /sdk/platform-tools/adb shell am instrument -w -r -e debug false [package-name]/[test-class] | tee test.log
- pkill -f flvrec
- yamdi -i test.flv -o test_recording.flv
- rm test.flv
- if grep -q "FAILURES!!!" test.log; then exit 1; fi
artifacts: artifacts:
name: "Tests-Instrumentation-21-${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}_${CI_BUILD_REF}"
when: always
expire_in: 1 weeks
paths: paths:
- test_recording.flv - "**/build/reports/androidTests"
- test.log
when: on_failure
expire_in: 1 week
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment