@@ -4,14 +4,22 @@ dist: xenial # needed for more recent python 3 and python3-venv
4
4
5
5
language : generic
6
6
7
+ stages :
8
+ - lint
9
+ - test
10
+
7
11
services :
8
12
- docker
9
13
10
14
before_install :
11
15
- travis_retry sudo apt update -qq
12
- - travis_retry sudo apt install -qq --no-install-recommends python2.7 python3 python3-venv python3-virtualenv
16
+ # to successfully send the coveralls reports we need pyOpenSSL
17
+ - travis_retry sudo apt install -qq --no-install-recommends
18
+ python2.7 python3 python3-venv python3-virtualenv python3-pip
19
+ python3-setuptools python3-openssl
13
20
# (venv/virtualenv are both used by tests/test_pythonpackage.py)
14
21
- sudo pip install tox>=2.0
22
+ - sudo pip3 install coveralls
15
23
# https://github.com/travis-ci/travis-ci/issues/6069#issuecomment-266546552
16
24
- git remote set-branches --add origin master
17
25
- git fetch
20
28
global :
21
29
- ANDROID_SDK_HOME=/opt/android/android-sdk
22
30
- ANDROID_NDK_HOME=/opt/android/android-ndk
23
- matrix :
24
- - 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'
25
- # overrides requirements to skip `peewee` pure python module, see:
26
- # https://github.com/kivy/python-for-android/issues/1263#issuecomment-390421054
27
- - 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'
28
- - COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --bootstrap sdl2 --requirements python2,numpy'
29
- # builds only the recipes that moved
30
- - COMMAND='. venv/bin/activate && ./ci/rebuild_updated_recipes.py'
31
-
32
- before_script :
33
- # we want to fail fast on tox errors without having to `docker build` first
34
- - tox -- tests/ --ignore tests/test_pythonpackage.py
35
- # (we ignore test_pythonpackage.py since these run way too long!! test_pythonpackage_basic.py will still be run.)
36
-
37
- script :
38
- # Run a background process to make sure that travis will not kill our tests in
39
- # case that the travis log doesn't produce any output for more than 10 minutes
40
- - while sleep 540; do echo "==== Still running (travis, don't kill me) ===="; done &
41
- - docker build --tag=p4a --file Dockerfile.py3 .
42
- - docker run -e CI p4a /bin/sh -c "$COMMAND"
43
- # kill the background process started before run docker
44
- - kill %1
31
+
32
+ jobs :
33
+ include :
34
+ - stage : lint
35
+ name : " Tox tests and coverage"
36
+ script :
37
+ # we want to fail fast on tox errors without having to `docker build` first
38
+ - tox -- tests/ --ignore tests/test_pythonpackage.py
39
+ # (we ignore test_pythonpackage.py since these run way too long!!
40
+ # test_pythonpackage_basic.py will still be run.)
41
+ after_success :
42
+ - coveralls
43
+
44
+ - &testing
45
+ stage : test
46
+ before_script :
47
+ # build docker image
48
+ - docker build --tag=p4a --file Dockerfile.py3 .
49
+ # Run a background process to make sure that travis will not kill our tests in
50
+ # case that the travis log doesn't produce any output for more than 10 minutes
51
+ - while sleep 540; do echo "==== Still running (travis, don't kill me) ===="; done &
52
+ script :
53
+ - docker run -e CI -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" p4a /bin/sh -c "$COMMAND"
54
+ after_script :
55
+ # kill the background process started before run docker
56
+ - kill %1
57
+ name : Python 3 basic
58
+ # overrides requirements to skip `peewee` pure python module, see:
59
+ # https://github.com/kivy/python-for-android/issues/1263#issuecomment-390421054
60
+ 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'
61
+ - << : *testing
62
+ name : Python 2 basic
63
+ 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'
64
+ - << : *testing
65
+ name : Python 2 numpy
66
+ env : COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --bootstrap sdl2 --requirements python2,numpy'
67
+ - << : *testing
68
+ name : Rebuild updated recipes
69
+ env : COMMAND='. venv/bin/activate && ./ci/rebuild_updated_recipes.py'
0 commit comments