Commit 0cc6c5cf authored by Bruno Agrizzi's avatar Bruno Agrizzi

saeedmasoumi image

parent 61b77629
image: 51systems/gitlab-ci-android:latest
before_script:
- export GRADLE_USER_HOME=/cache/.gradle
image: saeedmasoumi/gitlab-ci-android:latest
stages:
- build
- test
build:debug:
tags:
- android
stage: build
script:
- bash ./gradlew assembleDebug
artifacts:
expire_in: 1 days
paths:
- "**/build/outputs/**/*.apk"
- "**/build/outputs/**/*.aar"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- mkdir -p $GRADLE_USER_HOME
- chmod +x ./gradlew
build:release:
tags:
- android
stage: build
script:
- bash ./gradlew assemble
artifacts:
expire_in: 1 days
paths:
- "**/build/outputs/**/*.apk"
- "**/build/outputs/**/*.aar"
cache:
paths:
- .gradle/wrapper
- .gradle/caches
test:unit:
build:
tags:
- android
stage: test
- android
stage: build
script:
- bash ./gradlew test
- ./gradlew assembleDebug
- ./gradlew assembleDebugAndroidTest
artifacts:
name: "Tests-${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}_${CI_BUILD_REF}"
when: always
expire_in: 1 weeks
paths:
- "**/build/reports/tests"
- app/build/outputs/
test:instrumentation:21:
test:
tags:
- android
- android
stage: test
image: 51systems/gitlab-ci-android-emulator-21
script:
- android-run-emulator nexus5_21 bash ./gradlew connectedAndroidTest
- echo "no" | /sdk/tools/android create avd -f -n test -t android-23 --abi "google_apis/x86" -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:
name: "Tests-Instrumentation-21-${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}_${CI_BUILD_REF}"
when: always
expire_in: 1 weeks
paths:
- "**/build/reports/androidTests"
- test_recording.flv
- 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