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

Add CI for building wheels on MacOS on arm64 #3213

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 3 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
89 changes: 89 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build NEURON Python wheels

on:
push:
branches:
- master
pull_request:
branches:
- master

workflow_dispatch:
inputs:
rel_release:
description: Release branch/commit
default: 'release/x.y'
required: true
rel_version:
description: Release version (tag name)
default: 'x.y.z'
required: true


jobs:
build-test:
name: Build Python wheels
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [macos-14]
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- name: Check out code
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4

- name: Check out code for release
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.inputs.rel_release }}

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install MacOS System Dependencies
if: startsWith(runner.os, 'macOS')
run: |
brew install --cask xquartz
brew install flex bison mpich
brew unlink mpich && brew install openmpi
cmake --version
# Uninstall libomp for compatibility with issue #817
brew uninstall --ignore-dependencies libomp || echo "libomp doesn't exist"
brew install cmake
echo "$(brew --prefix)/opt/cmake/bin" >> $GITHUB_PATH
echo "$(brew --prefix)/opt/flex/bin:$(brew --prefix)/opt/bison/bin" >> $GITHUB_PATH

- name: Install readline
if: startsWith(runner.os, 'macOS')
run: |
sudo mkdir -p /opt/nrnwheel/$(uname -m)
sudo bash packaging/python/build_static_readline_osx.bash

- name: Set env for release
if: github.event_name == 'workflow_dispatch'
run: |
echo "NRN_NIGHTLY_UPLOAD=false" >> $GITHUB_ENV
echo NRN_RELEASE_UPLOAD=${{ github.event.inputs.upload }} >> $GITHUB_ENV
echo "NEURON_NIGHTLY_TAG=" >> $GITHUB_ENV
echo SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.rel_version }} >> $GITHUB_ENV

- name: Build wheels on MacOS
if: startsWith(runner.os, 'macOS')
run: |
packaging/python/build_wheels.bash osx ${{ matrix.python-version }} coreneuron

- name: Test wheel
run: |
minor_version="$(python -c 'import sys;print(sys.version_info.minor)')"
packaging/python/test_wheels.sh $(which python) wheelhouse/*cp3${minor_version}*.whl

- name: Upload wheel files
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.python-version }}
JCGoran marked this conversation as resolved.
Show resolved Hide resolved
path: wheelhouse/*.whl
Loading