Skip to content

Commit 84adc33

Browse files
committed
[ci] Add Mac OSX test to CI 🍎
To do so and not increase the overall build time, we change the python3 tests for `armeabi-v7a`...so we test that architecture with OSX instead of linux. We also rename the `Python 2` test to `Python 2 armeabi-v7a (with numpy)` to reflect the build arch and numpy's build.
1 parent cf7f958 commit 84adc33

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

.travis.yml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,59 @@ jobs:
6969
after_script:
7070
# kill the background process started before run docker
7171
- kill %1
72-
name: Python 3 armeabi-v7a
72+
name: Python 3 arm64-v8a
7373
# overrides requirements to skip `peewee` pure python module, see:
7474
# https://github.com/kivy/python-for-android/issues/1263#issuecomment-390421054
75-
env: COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools' --arch=armeabi-v7a
76-
- <<: *testing
77-
name: Python 3 arm64-v8a
7875
env: COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools' --arch=arm64-v8a
7976
- <<: *testing
80-
name: Python 2 basic
77+
name: Python 3 armeabi-v7a
78+
os: osx
79+
osx_image: xcode10.2
80+
before_install:
81+
- export ANDROID_NDK_HOME=$HOME/android-ndk # (overrides global env)
82+
- export ANDROID_SDK_HOME=$HOME/android-sdk # (overrides global env)
83+
- ANDROID_NDK_VERSION=17c
84+
- ANDROID_API_LEVEL=27
85+
- ANDROID_SDK_BUILD_TOOLS_VERSION=28.0.2
86+
- ANDROID_SDK_TOOLS_ARCHIVE=sdk-tools-linux-4333796.zip
87+
- ANDROID_SDK_TOOLS_DL_URL=https://dl.google.com/android/repository/$ANDROID_SDK_TOOLS_ARCHIVE
88+
- ANDROID_NDK_ARCHIVE=android-ndk-r$ANDROID_NDK_VERSION-darwin-x86_64.zip
89+
- ANDROID_NDK_DL_URL=https://dl.google.com/android/repository/$ANDROID_NDK_ARCHIVE
90+
- ANDROID_NDK_HOME_V=$ANDROID_NDK_HOME-r$ANDROID_NDK_VERSION
91+
# check/install python
92+
- python --version
93+
- brew update
94+
- python3 --version
95+
# install java 1.8 and set it as default
96+
- brew tap adoptopenjdk/openjdk
97+
- brew cask install adoptopenjdk8
98+
- /usr/libexec/java_home -V
99+
- export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
100+
# download/extract android's NDK
101+
- curl --location --progress-bar --insecure $ANDROID_NDK_DL_URL --output $ANDROID_NDK_ARCHIVE
102+
- mkdir -p $ANDROID_NDK_HOME_V
103+
- unzip -q $ANDROID_NDK_ARCHIVE -d $HOME
104+
- ln -sfn $ANDROID_NDK_HOME_V $ANDROID_NDK_HOME
105+
- rm -rf $ANDROID_NDK_ARCHIVE
106+
# download/extract android's SDK
107+
- curl --location --progress-bar --insecure $ANDROID_SDK_TOOLS_DL_URL --output $ANDROID_SDK_TOOLS_ARCHIVE
108+
- mkdir -p $ANDROID_SDK_HOME
109+
- unzip -q $ANDROID_SDK_TOOLS_ARCHIVE -d $ANDROID_SDK_HOME
110+
- rm -rf $ANDROID_SDK_TOOLS_ARCHIVE
111+
- ls $HOME
112+
# Accept android's licenses
113+
- yes | $ANDROID_SDK_HOME/tools/bin/sdkmanager "build-tools;$ANDROID_SDK_BUILD_TOOLS_VERSION" > /dev/null
114+
- yes | $ANDROID_SDK_HOME/tools/bin/sdkmanager "platforms;android-$ANDROID_API_LEVEL" > /dev/null
115+
- pip3 install --upgrade Cython==0.28.6
116+
- pip3 install -e .
117+
before_script:
118+
# overrides `testing` for Mac OS since we don't use docker
119+
- while sleep 540; do echo "==== Still running (travis, don't kill me) ===="; done &
120+
script:
121+
- cd testapps/
122+
- python3 setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools --arch=armeabi-v7a
123+
- <<: *testing
124+
name: Python 2 armeabi-v7a (with numpy)
81125
env: COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3,setuptools,numpy'
82126
- <<: *testing
83127
name: Rebuild updated recipes

0 commit comments

Comments
 (0)