Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS CI: ADD APK, AAB & Updated Recipes build #2574

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 105 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions ci/osx_ci.sh
Original file line number Diff line number Diff line change
@@ -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
}