-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
67 lines (59 loc) · 3.1 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
56
57
58
59
60
61
62
63
64
65
66
67
# This file is a template, and might need editing before it works on your project.
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "29.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- sudo apt-get --quiet update --yes
- sudo apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip -d android-sdk-linux android-sdk.zip
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- sudo chmod +x ./ScannerApp/gradlew
- sudo apt-get install openjdk-8-jdk -qy
# temporarily disable checking for EPIPE error and use yes to accept all licenses
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail
- cd ./ScannerApp
#lintDebug:
#stage: build
#script:
#- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- ./app/build/outputs/
#Instrumentation testing for UI
#instrumentationTests:
#stage: test
#image: shepeliev/android-sdk
#script:
#- sudo apt-get -y --no-install-recommends install bridge-utils libpulse0 libvirt-bin qemu-kvm virtinst ubuntu-vm-builder >/dev/null
#- wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
#- sudo chmod +x android-wait-for-emulator
#- echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "system-images;android-${ANDROID_COMPILE_SDK};google_apis_playstore;x86"
#- echo y | ${ANDROID_HOME}/tools/bin/sdkmanager --update
#- echo no | ${ANDROID_HOME}/tools/bin/avdmanager create avd --force -k "system-images;android-${ANDROID_COMPILE_SDK};google_apis_playstore;x86" -n test
#- ${ANDROID_HOME}/emulator/emulator -avd test -no-boot-anim -no-snapshot-save -no-window -no-audio -no-accel -gpu off -debug -all
#- ./android-wait-for-emulator
#- adb devices
#- adb shell settings put global window_animation_scale 0 &
#- adb shell settings put global transition_animation_scale 0 &
#- adb shell settings put global animator_duration_scale 0 &
#- adb shell input keyevent 82 &
#- ./gradlew cAT
debugTests:
stage: test
script:
- ./gradlew -Pci --console=plain :app:testDebug