Skip to content

Commit

Permalink
Github actions test apps (apk + aab)
Browse files Browse the repository at this point in the history
  • Loading branch information
misl6 committed Jul 31, 2021
1 parent 1a8dfa0 commit e3c95b6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ jobs:
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
Expand All @@ -64,15 +60,43 @@ jobs:
- name: Pull docker image
run: |
make docker/pull
- name: Build apk Python 3 ${{ matrix.build-arch }}
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
run: |
mkdir -p apks
make docker/run/make/with-artifact/testapps-with-numpy/${{ matrix.build-arch }}
make docker/run/make/with-artifact/testapps-with-numpy
- uses: actions/upload-artifact@v1
with:
name: bdist_test_app_unittests__${{ matrix.build-arch }}-debug-1.1.apk
name: bdist_unit_tests_app-debug-1.1-.apk
path: apks

build:
name: Unit test aab
needs: [flake8]
runs-on: ubuntu-latest
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
# helps with GitHub runner getting out of space
- name: Free disk space
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt -y clean
docker rmi $(docker image ls -aq)
df -h
- name: Pull docker image
run: |
make docker/pull
- name: Build Android App Bundle Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
run: |
mkdir -p aabs
make docker/run/make/with-artifact/testapps-with-numpy-aab
- uses: actions/upload-artifact@v1
with:
name: bdist_unit_tests_app-release-1.1-.aab
path: aabs

rebuild_updated_recipes:
name: Test updated recipes
needs: [flake8]
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ rebuild_updated_recipes: virtualenv
ANDROID_SDK_HOME=$(ANDROID_SDK_HOME) ANDROID_NDK_HOME=$(ANDROID_NDK_HOME) \
$(PYTHON) ci/rebuild_updated_recipes.py

testapps-with-numpy/%: virtualenv
$(eval $@_APP_ARCH := $(shell basename $*))
testapps-with-numpy: virtualenv
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
python setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
--arch=$($@_APP_ARCH)
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86

testapps-with-numpy-aab: virtualenv
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
python setup.py aab --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86 --release

testapps/%: virtualenv
$(eval $@_APP_ARCH := $(shell basename $*))
Expand Down

0 comments on commit e3c95b6

Please sign in to comment.