-
-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build macOS arm64 wheel on self-hosted runner
See #3772
- Loading branch information
1 parent
f23c3d4
commit bddd51d
Showing
1 changed file
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ env: | |
|
||
jobs: | ||
build_windows_wheels: | ||
name: Wheels (windows-latest) | ||
name: Wheels (windows-latest / amd64) | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -94,7 +94,7 @@ jobs: | |
if-no-files-found: error | ||
|
||
build_macos_and_linux_wheels: | ||
name: Wheels (${{ matrix.os }}) | ||
name: Wheels (${{ matrix.os }} / amd64) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
|
@@ -133,7 +133,7 @@ jobs: | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} | ||
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()" | ||
|
||
- name: Build wheels on macOS | ||
- name: Build wheels on macOS (amd64) | ||
if: matrix.os == 'macos-latest' | ||
run: pipx run cibuildwheel --output-dir wheelhouse | ||
env: | ||
|
@@ -154,7 +154,46 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
if: matrix.os == 'macos-latest' | ||
with: | ||
name: macos_wheels | ||
name: macos_amd64_wheels | ||
path: ./wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
build_apple_mseries: | ||
name: Wheels (macos-latest / arm64) | ||
if: github.repository == 'pybamm-team/PyBaMM' | ||
runs-on: [self-hosted, macOS, ARM64] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Clone pybind11 repo (no history) | ||
run: git clone --depth 1 --branch v2.11.1 | ||
|
||
- name: Install SuiteSparse and SUNDIALS on macOS self-hosted runner | ||
run: | | ||
brew install graphviz openblas libomp | ||
brew reinstall gcc | ||
python -m pip install cmake wget | ||
python scripts/install_KLU_Sundials.py | ||
- name: Build wheels on macOS (arm64) | ||
uses: pypa/[email protected] | ||
with: | ||
package-dir: . | ||
output-dir: wheelhouse | ||
env: | ||
CIBW_BEFORE_BUILD: > | ||
python -m pip install --upgrade cmake casadi setuptools wheel | ||
CIBW_REPAIR_WHEEL_COMMAND: delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel} | ||
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()" | ||
|
||
- name: Upload wheels for macOS (arm64) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: macos_arm64_wheels | ||
path: ./wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
|
@@ -182,7 +221,7 @@ jobs: | |
# This job is only of value to PyBaMM and would always be skipped in forks | ||
if: github.event_name != 'schedule' && github.repository == 'pybamm-team/PyBaMM' | ||
name: Upload package to PyPI | ||
needs: [build_macos_and_linux_wheels, build_windows_wheels, build_sdist] | ||
needs: [build_macos_and_linux_wheels, build_apple_mseries, build_windows_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download all artifacts | ||
|
@@ -191,7 +230,7 @@ jobs: | |
- name: Move all package files to files/ | ||
run: | | ||
mkdir files | ||
mv windows_wheels/* linux_wheels/* macos_wheels/* sdist/* files/ | ||
mv windows_wheels/* linux_wheels/* macos_amd64_wheels/* macos_arm64_wheels/* sdist/* files/ | ||
- name: Publish on PyPI | ||
if: github.event.inputs.target == 'pypi' || github.event_name == 'release' | ||
|
@@ -213,7 +252,7 @@ jobs: | |
open_failure_issue: | ||
needs: [build_windows_wheels, build_macos_and_linux_wheels, build_sdist] | ||
name: Open an issue if build fails | ||
if: ${{ always() && contains(needs.*.result, 'failure') && github.repository_owner == 'pybamm-team'}} | ||
if: ${{ contains(needs.*.result, 'failure') && github.repository_owner == 'pybamm-team'}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|