Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into release-2020.04.01
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Apr 1, 2020
2 parents 09c624b + f5dbf21 commit d07b434
Show file tree
Hide file tree
Showing 280 changed files with 6,331 additions and 5,324 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# used by coveralls.io, refs:
# https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#travisci
CI
TRAVIS
TRAVIS_BRANCH
TRAVIS_JOB_ID
TRAVIS_PULL_REQUEST
83 changes: 83 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Unit tests & build apps

on: ['push', 'pull_request']

jobs:

flake8:
name: Flake8 tests
runs-on: ubuntu-latest
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1.1.0
with:
python-version: 3.7
- name: Run flake8
run: |
python -m pip install --upgrade pip
pip install tox>=2.0
tox -e pep8
test:
name: Pytest [Python ${{ matrix.python-version }} | ${{ matrix.os }}]
needs: flake8
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7]
os: [ubuntu-latest, macOs-latest]
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Tox tests
run: |
python -m pip install --upgrade pip
pip install tox>=2.0
make test
build:
name: Unit test apk
needs: [flake8]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build-arch: ['arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86']
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
- name: Pull docker image
run: |
make docker/pull
- name: Build apk Python 3 ${{ matrix.build-arch }}
run: |
mkdir -p apks
make docker/run/make/with-artifact/testapps-with-numpy/${{ matrix.build-arch }}
- uses: actions/upload-artifact@v1
with:
name: bdist_test_app_unittests__${{ matrix.build-arch }}-debug-1.1.apk
path: apks

rebuild_updated_recipes:
name: Test updated recipes
needs: [flake8]
runs-on: ubuntu-latest
steps:
- name: Checkout python-for-android (current branch)
uses: actions/checkout@v2
- name: Checkout python-for-android (develop branch)
uses: actions/checkout@v2
with:
ref: 'develop'
- name: Pull docker image
run: |
make docker/pull
- name: Rebuild updated recipes
run: |
make docker/run/make/rebuild_updated_recipes
66 changes: 21 additions & 45 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
sudo: required

dist: xenial # needed for more recent python 3 and python3-venv

language: generic

stages:
- lint
- test
- unit tests
- build testapps

services:
- docker
Expand All @@ -16,15 +12,10 @@ before_install:
- git remote set-branches --add origin develop
- git fetch

env:
global:
- ANDROID_SDK_HOME=/opt/android/android-sdk
- ANDROID_NDK_HOME=/opt/android/android-ndk

jobs:
include:
- &linting
stage: lint
- &unittests
stage: unit tests
language: python
python: 3.7
before_script:
Expand All @@ -41,44 +32,29 @@ jobs:
- pip3.7 install pyOpenSSL
- pip3.7 install coveralls
script:
# we want to fail fast on tox errors without having to `docker build` first
# ignores test_pythonpackage.py since it runs for too long
- tox -- tests/ --ignore tests/test_pythonpackage.py
# (we ignore test_pythonpackage.py since these run way too long!!
# test_pythonpackage_basic.py will still be run.)
name: "Tox Pep8"
env: TOXENV=pep8
- <<: *linting
name: "Tox Python 2"
env: TOXENV=py27
- <<: *linting
- <<: *unittests
name: "Tox Python 3 & Coverage"
env: TOXENV=py3
after_success:
- coveralls

- &testing
stage: test
before_script:
# build docker image
- docker build --tag=p4a --file Dockerfile.py3 .
# Run a background process to make sure that travis will not kill our tests in
# case that the travis log doesn't produce any output for more than 10 minutes
- while sleep 540; do echo "==== Still running (travis, don't kill me) ===="; done &
script:
- docker run -e CI -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" p4a /bin/sh -c "$COMMAND"
after_script:
# kill the background process started before run docker
- kill %1
- &testapps
name: Python 3 arm64-v8a (with numpy)
stage: build testapps
before_script: make docker/pull
script: make docker/run/make/testapps-with-numpy/arm64-v8a
- <<: *testapps
name: Python 3 armeabi-v7a
# overrides requirements to skip `peewee` pure python module, see:
# https://github.com/kivy/python-for-android/issues/1263#issuecomment-390421054
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
- <<: *testing
name: Python 3 arm64-v8a
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
- <<: *testing
name: Python 2 basic
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'
- <<: *testing
os: osx
osx_image: xcode11 # since xcode1.3, python3 is the default interpreter
before_script:
# installs java 1.8, android's SDK/NDK and p4a
- make -f ci/makefiles/osx.mk
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
script: make testapps/armeabi-v7a PYTHON_WITH_VERSION=python3
- <<: *testapps
name: Rebuild updated recipes
env: COMMAND='. venv/bin/activate && ./ci/rebuild_updated_recipes.py'
script: travis_wait 30 make docker/run/make/rebuild_updated_recipes
134 changes: 0 additions & 134 deletions Dockerfile.py2

This file was deleted.

Loading

0 comments on commit d07b434

Please sign in to comment.