Skip to content

Commit a0f8d3e

Browse files
authored
macOS CI: ADD APK, AAB & Updated Recipes build (#2574)
* macOS CI: ADD APK, AAB & Updated Recipes build * Add tools for our self-hosted m1 runner
1 parent 85c4d1c commit a0f8d3e

File tree

2 files changed

+118
-6
lines changed

2 files changed

+118
-6
lines changed

.github/workflows/push.yml

+105-6
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
parallel: true
4848
flag-name: run-${{ matrix.os }}-${{ matrix.python-version }}
4949

50-
build_apk:
51-
name: Unit test apk
50+
ubuntu_build_apk:
51+
name: Unit test apk [ ubuntu-latest ]
5252
needs: [flake8]
5353
runs-on: ubuntu-latest
5454
steps:
@@ -75,8 +75,41 @@ jobs:
7575
name: bdist_unit_tests_app-debug-1.1-.apk
7676
path: apks
7777

78-
build_aab:
79-
name: Unit test aab
78+
macos_build_apk:
79+
name: Unit test apk [ ${{ matrix.runs_on }} ]
80+
needs: [flake8]
81+
defaults:
82+
run:
83+
shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }}
84+
runs-on: ${{ matrix.runs_on }}
85+
strategy:
86+
matrix:
87+
include:
88+
- runs_on: macos-latest
89+
- runs_on: apple-silicon-m1
90+
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
91+
env:
92+
ANDROID_HOME: ${HOME}/.android
93+
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
94+
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
95+
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
96+
steps:
97+
- name: Checkout python-for-android
98+
uses: actions/checkout@v2
99+
- name: Install dependencies
100+
run: |
101+
source ci/osx_ci.sh
102+
arm64_set_path_and_python_version 3.9.7
103+
brew install autoconf automake libtool openssl pkg-config
104+
make --file ci/makefiles/osx.mk
105+
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
106+
run: |
107+
source ci/osx_ci.sh
108+
arm64_set_path_and_python_version 3.9.7
109+
make testapps-with-numpy
110+
111+
ubuntu_build_aab:
112+
name: Unit test aab [ ubuntu-latest ]
80113
needs: [flake8]
81114
runs-on: ubuntu-latest
82115
steps:
@@ -103,8 +136,41 @@ jobs:
103136
name: bdist_unit_tests_app-release-1.1-.aab
104137
path: aabs
105138

106-
rebuild_updated_recipes:
107-
name: Test updated recipes
139+
macos_build_aab:
140+
name: Unit test aab [ ${{ matrix.runs_on }} ]
141+
needs: [flake8]
142+
defaults:
143+
run:
144+
shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }}
145+
runs-on: ${{ matrix.runs_on }}
146+
strategy:
147+
matrix:
148+
include:
149+
- runs_on: macos-latest
150+
- runs_on: apple-silicon-m1
151+
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
152+
env:
153+
ANDROID_HOME: ${HOME}/.android
154+
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
155+
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
156+
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
157+
steps:
158+
- name: Checkout python-for-android
159+
uses: actions/checkout@v2
160+
- name: Install dependencies
161+
run: |
162+
source ci/osx_ci.sh
163+
arm64_set_path_and_python_version 3.9.7
164+
brew install autoconf automake libtool openssl pkg-config
165+
make --file ci/makefiles/osx.mk
166+
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
167+
run: |
168+
source ci/osx_ci.sh
169+
arm64_set_path_and_python_version 3.9.7
170+
make testapps-with-numpy-aab
171+
172+
ubuntu_rebuild_updated_recipes:
173+
name: Test updated recipes [ ubuntu-latest ]
108174
needs: [flake8]
109175
runs-on: ubuntu-latest
110176
steps:
@@ -128,6 +194,39 @@ jobs:
128194
run: |
129195
make docker/run/make/rebuild_updated_recipes
130196
197+
macos_rebuild_updated_recipes:
198+
name: Test updated recipes [ ${{ matrix.runs_on }} ]
199+
needs: [flake8]
200+
defaults:
201+
run:
202+
shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }}
203+
runs-on: ${{ matrix.runs_on }}
204+
strategy:
205+
matrix:
206+
include:
207+
- runs_on: macos-latest
208+
- runs_on: apple-silicon-m1
209+
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
210+
env:
211+
ANDROID_HOME: ${HOME}/.android
212+
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
213+
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
214+
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
215+
steps:
216+
- name: Checkout python-for-android
217+
uses: actions/checkout@v2
218+
- name: Install dependencies
219+
run: |
220+
source ci/osx_ci.sh
221+
arm64_set_path_and_python_version 3.9.7
222+
brew install autoconf automake libtool openssl pkg-config
223+
make --file ci/makefiles/osx.mk
224+
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
225+
run: |
226+
source ci/osx_ci.sh
227+
arm64_set_path_and_python_version 3.9.7
228+
make rebuild_updated_recipes
229+
131230
coveralls_finish:
132231
needs: test
133232
runs-on: ubuntu-latest

ci/osx_ci.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e -x
3+
4+
arm64_set_path_and_python_version(){
5+
python_version="$1"
6+
if [[ $(/usr/bin/arch) = arm64 ]]; then
7+
export PATH=/opt/homebrew/bin:$PATH
8+
eval "$(pyenv init --path)"
9+
pyenv install $python_version -s
10+
pyenv global $python_version
11+
export PATH=$(pyenv prefix)/bin:$PATH
12+
fi
13+
}

0 commit comments

Comments
 (0)