chiark / gitweb /
common: use python instead of calling out to 'rm'
[fdroidserver.git] / .travis.yml
1
2 # Use the Android base system since it provides the SDK, etc.
3 language: java
4
5 matrix:
6   include:
7     - os: linux
8       language: android
9     - os: osx
10       osx_image: xcode9.1
11       env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
12       env: ANDROID_HOME=/usr/local/share/android-sdk
13     - os: osx
14       osx_image: xcode7.3
15       env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
16       env: ANDROID_HOME=/usr/local/share/android-sdk
17     - os: osx
18       osx_image: xcode6.4
19       env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
20       env: ANDROID_HOME=/usr/local/share/android-sdk
21
22 # On Ubuntu/trusty 14.04, the PPA is needed on to provide lots of the
23 # dependencies, but this then also serves as a test of the PPA, which
24 # is used on Windows Subsystem for Linux.
25 addons:
26   apt:
27     sources:
28       - sourceline: 'ppa:fdroid/fdroidserver'
29     packages:
30     - bash
31     - dash
32     - pylint
33     - pep8
34     - python3-babel
35     - python3-dev
36     - python3-pip
37     - python3-ruamel.yaml
38     - python3-setuptools
39     - python3.4-venv
40     - libjpeg-dev
41     - zlib1g-dev
42     - fdroidserver
43
44 android:
45   components:
46     - android-23  # required for `fdroid build` test
47     - build-tools-25.0.3  # required for `fdroid build` test
48   licenses:
49     - 'android-sdk-preview-.+'
50     - 'android-sdk-license-.+'
51
52 # * ensure java8 is installed since Android SDK doesn't work with Java9
53 # * Java needs to be at least 1.8.0_131 to have MD5 properly disabled
54 #   https://blogs.oracle.com/java-platform-group/oracle-jre-will-no-longer-trust-md5-signed-code-by-default
55 #   https://opsech.io/posts/2017/Jun/09/openjdk-april-2017-security-update-131-8u131-and-md5-signed-jars.html
56 install:
57   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
58       set -x;
59       brew update > /dev/null;
60       brew install dash bash python3 gradle jenv;
61       brew install gnu-sed --with-default-names;
62       if ! ruby -e 'v = `javac -version 2>&1`.split()[1].gsub("_", "."); exit Gem::Dependency.new("", "~> 1.8.0.131").match?("", v)'; then
63         brew cask uninstall java --force;
64         brew cask install caskroom/versions/java8;
65       fi;
66       brew cask install android-sdk;
67
68       mkdir -p "$ANDROID_HOME/licenses";
69       echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license";
70       echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license";
71       echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools" > /dev/null 2&>1;
72       echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;25.0.2" > /dev/null 2&>1;
73       echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-23" > /dev/null 2&>1;
74
75       sudo pip3 install --quiet --editable . ;
76       sudo rm -rf fdroidserver.egg-info;
77
78       ls -l /System/Library/Java/JavaVirtualMachines || true;
79       ls -l /Library/Java/JavaVirtualMachines || true;
80       echo $PATH;
81       echo $JAVA_HOME;
82       jenv versions;
83       /usr/libexec/java_home;
84       java -version;
85       which java;
86       javac -version;
87       which javac;
88       jarsigner -help;
89       which jarsigner;
90       keytool -help;
91       which keytool;
92       set +x;
93     fi
94
95 # The OSX tests seem to run slower, they often timeout.  So only run
96 # the test suite with the installed version of fdroid, instead of the
97 # three rounds that ./complete-ci-tests does.
98 script:
99   - cd tests
100   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
101       ./run-tests;
102     else
103       ./complete-ci-tests;
104     fi
105
106 after_failure:
107   - cd $TRAVIS_BUILD_DIR
108   - ls -lR | curl -F 'clbin=<-' https://clbin.com