Skip to content

Commit

Permalink
macOS CI: ADD APK, AAB & Updated Recipes build (#2574)
Browse files Browse the repository at this point in the history
* macOS CI: ADD APK, AAB & Updated Recipes build

* Add tools for our self-hosted m1 runner
  • Loading branch information
misl6 authored Apr 7, 2022
1 parent 85c4d1c commit a0f8d3e
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 6 deletions.
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
}

0 comments on commit a0f8d3e

Please sign in to comment.