.gitlab-ci.yml 2.37 KB
Newer Older
1
before_script:
Daniel Martí's avatar
Daniel Martí committed
2
  - apt-get -q update -y
3 4
  - echo " == Installing packages required by this CI script"
  - apt-get -q install -y wget tar unzip
Daniel Martí's avatar
Daniel Martí committed
5
  - echo " == Installing OpenJDK 7"
Daniel Martí's avatar
Daniel Martí committed
6
  - apt-get -q install -y openjdk-7-jdk
7 8
  - echo " == Installing packages required by the 32-bit SDK"
  - apt-get -q install -y lib32stdc++6 lib32z1
9
  - echo " == Installing the Android SDK"
Daniel Martí's avatar
Daniel Martí committed
10 11
  - wget -q -O android-sdk.tgz https://dl.google.com/android/android-sdk_r24.3.4-linux.tgz
  - tar -x -z -f android-sdk.tgz
12
  - mv android-sdk-linux android-sdk
Daniel Martí's avatar
Daniel Martí committed
13 14
  - export ANDROID_HOME=$PWD/android-sdk
  - export PATH="$ANDROID_HOME/tools:$PATH"
15
  - echo " == Installing Android SDK components"
Daniel Martí's avatar
Daniel Martí committed
16
  - echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.1,android-22,extra-android-m2repository
17
  - export PATH="$ANDROID_HOME/platform-tools:$PATH"
Daniel Martí's avatar
Daniel Martí committed
18
  - export PATH="$ANDROID_HOME/build-tools/23.0.1:$PATH"
19 20 21
  - echo " == Installing Android emulator images"
  - echo y | android -s update sdk --no-ui -a -t android-10,android-19
  - echo y | android -s update sdk --no-ui -a -t sys-img-armeabi-v7a-android-19
22
  - echo " == Installing Gradle"
Daniel Martí's avatar
Daniel Martí committed
23 24
  - wget -q -O gradle.zip https://services.gradle.org/distributions/gradle-2.4-bin.zip
  - unzip -q gradle.zip
25 26
  - export PATH="$PWD/gradle-2.4/bin:$PATH"

27
test:
28
  script:
29
    - echo " == Building via gradle"
30
    - gradle build
31
    - echo " == Creating Android 2.3.7 emulator"
32 33 34
    - 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 &
35
    - ./F-Droid/tools/wait-for-emulator
36
    - adb shell input keyevent 82
37
    - echo " == Running Android tests on the 2.3.7 emulator"
38
    - ADB_INSTALL_TIMEOUT=8 gradle connectedCheck
39 40
    - echo " == Stopping Android 2.3.7 emulator"
    - kill $!
41 42 43 44 45
    - echo " == Creating Android 4.4.4 emulator"
    - echo no | android create avd --force -n fcl-test -t android-19 -b armeabi-v7a
    - echo " == Starting Android 4.4.4 emulator"
    - emulator -force-32bit -avd fcl-test -no-skin -no-audio -no-window &
    - ./F-Droid/tools/wait-for-emulator
46
    - adb shell input keyevent 82
47
    - sleep 30 # 4.4 says it's ready before it actually is
48
    - echo " == Running Android tests on the 4.4.4 emulator"
49
    - ADB_INSTALL_TIMEOUT=8 gradle connectedCheck
50 51
    - echo " == Stopping Android 4.4.4 emulator"
    - kill $!