-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
56 lines (47 loc) · 1.67 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
image: inovex/gitlab-ci-android
#image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "25"
ANDROID_BUILD_TOOLS: "25.0.2"
ANDROID_SDK_TOOLS: "3859397"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew
- echo "ad8ad258047a00e2ee528be5b1a8a18bab7c4367" > $ANDROID_HOME/licenses/android-sdk-license
- echo "8933bad161af4178b1185d1a37fbf41ea5269c55" >> $ANDROID_HOME/licenses/android-sdk-license
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" >> $ANDROID_HOME/licenses/android-sdk-license
- cat $ANDROID_HOME/licenses/*
stages:
- build
- test
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/
build:
stage: build
script:
- ./gradlew --info --stacktrace assembleDebug
artifacts:
paths:
- app/build/outputs/apk/*.apk
unitTests:
stage: test
script:
- ./gradlew --stacktrace test
artifacts:
paths:
- app/build/reports/tests/
functionalTests:
stage: test
script:
- env
- curl -s https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator > android-wait-for-emulator
- chmod +x android-wait-for-emulator
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-$ANDROID_COMPILE_SDK;google_apis;x86"
- echo no | $ANDROID_HOME/tools/bin/avdmanager create avd -n test -k "system-images;android-$ANDROID_COMPILE_SDK;google_apis;x86" --abi google_apis/x86
- $ANDROID_HOME/tools/emulator -force-32bit -avd test -no-window -no-audio &
- ./android-wait-for-emulator
- adb shell input keyevent 82
- ./gradlew --debug --stacktrace cAT