forked from f-droid/fdroidclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
41 lines (40 loc) · 1.81 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
before_script:
- apt-get -q update -y
- echo " == Installing packages required by this CI script"
- apt-get -q install -y wget tar unzip
- echo " == Installing OpenJDK 7"
- apt-get -q install -y openjdk-7-jdk
- echo " == Installing packages required by the 32-bit SDK"
- apt-get -q install -y lib32stdc++6 lib32z1
- echo " == Installing the Android SDK"
- wget -q -O android-sdk.tgz https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
- tar -x -z -f android-sdk.tgz
- mv android-sdk-linux android-sdk
- export ANDROID_HOME=$PWD/android-sdk
- export PATH="$ANDROID_HOME/tools:$PATH"
- echo " == Installing Android SDK components"
- echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2,android-22,extra-android-m2repository
- export PATH="$ANDROID_HOME/platform-tools:$PATH"
- export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH"
- echo " == Installing Android emulator images"
- echo y | android -s update sdk --no-ui -a -t android-10
- echo " == Installing Gradle"
- wget -q -O gradle.zip https://services.gradle.org/distributions/gradle-2.9-bin.zip
- unzip -q gradle.zip
- export PATH="$PWD/gradle-2.9/bin:$PATH"
test:
script:
- echo " == Running build"
- gradle build
- echo " == Running checkstyle"
- gradle checkstyle
- echo " == Creating Android 2.3.7 emulator"
- echo no | android create avd --force -n fcl-test -t android-10 -b armeabi
- echo " == Starting Android 2.3.7 emulator"
- emulator -force-32bit -avd fcl-test -no-skin -no-audio -no-window &
- ./tools/wait-for-emulator
- adb shell input keyevent 82
- echo " == Running Android tests on the 2.3.7 emulator"
- ADB_INSTALL_TIMEOUT=8 gradle connectedCheck || { adb logcat -d '*:W'; exit 1; }
- echo " == Stopping Android 2.3.7 emulator"
- kill $!