chiark / gitweb /
fix intermittent test failure
[fdroidserver.git] / .travis.yml
index 7a7ce68e5b062cdf5a31e0ca19499357b4272122..21e55bc92126fcaa02687b7021dd0763317e6da9 100644 (file)
@@ -3,44 +3,95 @@
 language: java
 
 matrix:
-  allow_failures:
-    - os: linux # this is really about OSX, Ubuntu is just bonus
   include:
     - os: linux
       language: android
-      sudo: required
-      # this doesn't actually work yet https://github.com/travis-ci/travis-ci/issues/5337
-      dist: trusty
     - os: osx
-      osx_image: xcode9
+      osx_image: xcode9.3beta
+      env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
+      env: ANDROID_HOME=/usr/local/share/android-sdk
+    - os: osx
+      osx_image: xcode9.2
+      env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
+      env: ANDROID_HOME=/usr/local/share/android-sdk
+    - os: osx
+      osx_image: xcode7.3
+      env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
+      env: ANDROID_HOME=/usr/local/share/android-sdk
+    - os: osx
+      osx_image: xcode6.4
       env: ANDROID_SDK_ROOT=/usr/local/share/android-sdk
       env: ANDROID_HOME=/usr/local/share/android-sdk
 
-licenses:
-  - 'android-sdk-preview-license-52d11cd2'
-  - 'android-sdk-license-.+'
+# On Ubuntu/trusty 14.04, the PPA is needed on to provide lots of the
+# dependencies, but this then also serves as a test of the PPA, which
+# is used on Windows Subsystem for Linux.
+addons:
+  apt:
+    sources:
+      - sourceline: 'ppa:fdroid/fdroidserver'
+    packages:
+    - bash
+    - dash
+    - pylint
+    - pep8
+    - python3-babel
+    - python3-dev
+    - python3-pip
+    - python3-ruamel.yaml
+    - python3-setuptools
+    - python3.4-venv
+    - libjpeg-dev
+    - zlib1g-dev
+    - fdroidserver
 
-# the PPA is needed on Ubuntu 14.04 precise, and with python3, trusty too
-# the pip thing is a hack that can go away with trusty
+android:
+  components:
+    - android-23  # required for `fdroid build` test
+    - build-tools-25.0.3  # required for `fdroid build` test
+  licenses:
+    - 'android-sdk-preview-.+'
+    - 'android-sdk-license-.+'
+
+# * ensure java8 is installed since Android SDK doesn't work with Java9
+# * Java needs to be at least 1.8.0_131 to have MD5 properly disabled
+#   https://blogs.oracle.com/java-platform-group/oracle-jre-will-no-longer-trust-md5-signed-code-by-default
+#   https://opsech.io/posts/2017/Jun/09/openjdk-april-2017-security-update-131-8u131-and-md5-signed-jars.html
 install:
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
+      set -x;
       brew update > /dev/null;
-      brew install dash bash python3 gradle;
+      if [ "`sw_vers -productVersion | sed 's,10\.\([0-9]*\).*,\1,'`" -gt 10 ]; then
+        brew upgrade python;
+      else
+        brew install python3;
+      fi;
+      brew install dash bash gradle jenv;
       brew install gnu-sed --with-default-names;
+      if ! ruby -e 'v = `javac -version 2>&1`.split()[1].gsub("_", "."); exit Gem::Dependency.new("", "~> 1.8.0.131").match?("", v)'; then
+        brew cask uninstall java --force;
+        brew cask install caskroom/versions/java8;
+      fi;
       brew cask install android-sdk;
 
+      export AAPT_VERSION=`sed -n "s,^MINIMUM_AAPT_VERSION\s*=\s*['\"]\(.*\)[['\"],\1,p" fdroidserver/common.py`;
       mkdir -p "$ANDROID_HOME/licenses";
       echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license";
+      echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> "$ANDROID_HOME/licenses/android-sdk-license";
       echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license";
       echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools";
-      echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;25.0.2";
+      echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;$AAPT_VERSION";
       echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-23";
 
-      sudo pip3 install -e  .;
+      sudo pip3 install babel;
+      sudo pip3 install --quiet --editable . ;
       sudo rm -rf fdroidserver.egg-info;
 
+      ls -l /System/Library/Java/JavaVirtualMachines || true;
+      ls -l /Library/Java/JavaVirtualMachines || true;
       echo $PATH;
       echo $JAVA_HOME;
+      jenv versions;
       /usr/libexec/java_home;
       java -version;
       which java;
@@ -50,11 +101,19 @@ install:
       which jarsigner;
       keytool -help;
       which keytool;
+      set +x;
     fi
 
+# The OSX tests seem to run slower, they often timeout.  So only run
+# the test suite with the installed version of fdroid, instead of the
+# three rounds that ./complete-ci-tests does.
 script:
   - cd tests
-  - ./complete-ci-tests
+  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
+      ./run-tests;
+    else
+      ./complete-ci-tests;
+    fi
 
 after_failure:
   - cd $TRAVIS_BUILD_DIR