diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ac87a6d6b7..c1ca4eeb6c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -47,8 +47,8 @@ jobs: parallel: true flag-name: run-${{ matrix.os }}-${{ matrix.python-version }} - build_apk: - name: Unit test apk + ubuntu_build_apk: + name: Unit test apk [ ubuntu-latest ] needs: [flake8] runs-on: ubuntu-latest steps: @@ -75,8 +75,41 @@ jobs: name: bdist_unit_tests_app-debug-1.1-.apk path: apks - build_aab: - name: Unit test aab + macos_build_apk: + name: Unit test apk [ ${{ matrix.runs_on }} ] + needs: [flake8] + defaults: + run: + shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} + runs-on: ${{ matrix.runs_on }} + strategy: + matrix: + include: + - runs_on: macos-latest + - runs_on: apple-silicon-m1 + run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} + env: + ANDROID_HOME: ${HOME}/.android + ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk + ANDROID_SDK_HOME: ${HOME}/.android/android-sdk + ANDROID_NDK_HOME: ${HOME}/.android/android-ndk + steps: + - name: Checkout python-for-android + uses: actions/checkout@v2 + - name: Install dependencies + run: | + source ci/osx_ci.sh + arm64_set_path_and_python_version 3.9.7 + brew install autoconf automake libtool openssl pkg-config + make --file ci/makefiles/osx.mk + - name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86) + run: | + source ci/osx_ci.sh + arm64_set_path_and_python_version 3.9.7 + make testapps-with-numpy + + ubuntu_build_aab: + name: Unit test aab [ ubuntu-latest ] needs: [flake8] runs-on: ubuntu-latest steps: @@ -103,8 +136,41 @@ jobs: name: bdist_unit_tests_app-release-1.1-.aab path: aabs - rebuild_updated_recipes: - name: Test updated recipes + macos_build_aab: + name: Unit test aab [ ${{ matrix.runs_on }} ] + needs: [flake8] + defaults: + run: + shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} + runs-on: ${{ matrix.runs_on }} + strategy: + matrix: + include: + - runs_on: macos-latest + - runs_on: apple-silicon-m1 + run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} + env: + ANDROID_HOME: ${HOME}/.android + ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk + ANDROID_SDK_HOME: ${HOME}/.android/android-sdk + ANDROID_NDK_HOME: ${HOME}/.android/android-ndk + steps: + - name: Checkout python-for-android + uses: actions/checkout@v2 + - name: Install dependencies + run: | + source ci/osx_ci.sh + arm64_set_path_and_python_version 3.9.7 + brew install autoconf automake libtool openssl pkg-config + make --file ci/makefiles/osx.mk + - name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86) + run: | + source ci/osx_ci.sh + arm64_set_path_and_python_version 3.9.7 + make testapps-with-numpy-aab + + ubuntu_rebuild_updated_recipes: + name: Test updated recipes [ ubuntu-latest ] needs: [flake8] runs-on: ubuntu-latest steps: @@ -128,6 +194,39 @@ jobs: run: | make docker/run/make/rebuild_updated_recipes + macos_rebuild_updated_recipes: + name: Test updated recipes [ ${{ matrix.runs_on }} ] + needs: [flake8] + defaults: + run: + shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} + runs-on: ${{ matrix.runs_on }} + strategy: + matrix: + include: + - runs_on: macos-latest + - runs_on: apple-silicon-m1 + run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} + env: + ANDROID_HOME: ${HOME}/.android + ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk + ANDROID_SDK_HOME: ${HOME}/.android/android-sdk + ANDROID_NDK_HOME: ${HOME}/.android/android-ndk + steps: + - name: Checkout python-for-android + uses: actions/checkout@v2 + - name: Install dependencies + run: | + source ci/osx_ci.sh + arm64_set_path_and_python_version 3.9.7 + brew install autoconf automake libtool openssl pkg-config + make --file ci/makefiles/osx.mk + - name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86) + run: | + source ci/osx_ci.sh + arm64_set_path_and_python_version 3.9.7 + make rebuild_updated_recipes + coveralls_finish: needs: test runs-on: ubuntu-latest diff --git a/ci/osx_ci.sh b/ci/osx_ci.sh new file mode 100644 index 0000000000..8cdd1ac1af --- /dev/null +++ b/ci/osx_ci.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e -x + +arm64_set_path_and_python_version(){ + python_version="$1" + if [[ $(/usr/bin/arch) = arm64 ]]; then + export PATH=/opt/homebrew/bin:$PATH + eval "$(pyenv init --path)" + pyenv install $python_version -s + pyenv global $python_version + export PATH=$(pyenv prefix)/bin:$PATH + fi +} \ No newline at end of file