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

Enable CI on mac #54

Merged
merged 3 commits into from
Oct 10, 2023
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
42 changes: 30 additions & 12 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Workflow to build and test wheels.
name: Wheel builder

on:
on:
workflow_dispatch:
pull_request:
push:
Expand Down Expand Up @@ -86,9 +86,9 @@ jobs:
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
#- [ubuntu-20.04, musllinux_x86_64]
#- [macos-12, macosx_x86_64]
#- [windows-2019, win_amd64]
- [macos-13, macosx_x86_64]
#- [ubuntu-20.04, musllinux_x86_64]
#- [windows-2019, win_amd64]
python: ["cp39", "cp310", "cp311", "cp312"] # "pp39"
exclude:
# Don't build PyPy 32-bit windows
Expand Down Expand Up @@ -125,17 +125,35 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: runner.os == 'linux'

- name: Configure MacOSX Environment
if: runner.os == 'macOS'
run: |
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_ENV_HINTS=1
eval "$(brew shellenv)"
brew install -q qt@5 qwt-qt5 rapidjson boost ninja eigen
echo HOMEBREW_PREFIX="$HOMEBREW_PREFIX" >> $GITHUB_ENV
echo CCACHE_DIR="${{ github.workspace }}/.ccache" >> $GITHUB_ENV
echo LDFLAGS="-L$HOMEBREW_PREFIX/opt/qt@5/lib -L$HOMEBREW_PREFIX/opt/qwt-qt5/lib" >> $GITHUB_ENV
echo CPPFLAGS="-I$HOMEBREW_PREFIX/opt/qt@5/include -I$HOMEBREW_PREFIX/opt/qwt-qt5/include" >> $GITHUB_ENV
echo PKG_CONFIG_PATH="$HOMEBREW_PREFIX/opt/qt@5/lib/pkgconfig:$HOMEBREW_PREFIX/opt/qwt-qt5/lib/pkgconfig" >> $GITHUB_ENV
echo CMAKE_FRAMEWORK_PATH="$HOMEBREW_PREFIX/opt/qt@5/lib/cmake/" >> $GITHUB_ENV


- name: Build wheels
uses: pypa/cibuildwheel@66b46d086804a9e9782354100d96a3a445431bca # v2.14.0
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ENVIRONMENT: USE_CCACHE=1 CCACHE_DIR=/.ccache BOOST_LIBRARYDIR=/usr/lib64/boost169 BOOST_INCLUDEDIR=/usr/include/boost169
CIBW_CONTAINER_ENGINE: "docker; create_args: '--volume=${{ github.workspace }}/.ccache:/.ccache'"
# overriede before-all in pyproject.toml
# override before-all in pyproject.toml
CIBW_BEFORE_ALL: ""
CIBW_MANYLINUX_X86_64_IMAGE: ${{ needs.build-custom-manylinux.outputs.tag }}
CIBW_ENVIRONMENT_LINUX: |
USE_CCACHE=1 CCACHE_DIR=/.ccache BOOST_LIBRARYDIR=/usr/lib64/boost169 BOOST_INCLUDEDIR=/usr/include/boost169
CIBW_BEFORE_BUILD: env


- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
Expand All @@ -144,15 +162,15 @@ jobs:

test_upload_pypi:
# TODO: create an sdist that can build without a custom environment
needs: [build_wheels]
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
strategy:
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [macos-13, macosx_x86_64]
#- [ubuntu-20.04, musllinux_x86_64]
#- [macos-12, macosx_x86_64]
#- [windows-2019, win_amd64]
python: ["cp39", "cp310", "cp311", "cp312"] # "pp39"
exclude:
Expand All @@ -161,7 +179,7 @@ jobs:
python: "pp39"
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
python: "pp39"

environment: pypi
permissions:
id-token: write
Expand All @@ -179,14 +197,14 @@ jobs:
upload_pypi:
# TODO: create an sdist that can build without a custom environment
if: github.event_name == 'release'
needs: [build_wheels]
needs: [build_wheels]
runs-on: ubuntu-latest
strategy:
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [macos-13, macosx_x86_64]
#- [ubuntu-20.04, musllinux_x86_64]
#- [macos-12, macosx_x86_64]
#- [windows-2019, win_amd64]
python: ["cp39", "cp310", "cp311", "cp312"] # "pp39"
exclude:
Expand All @@ -195,7 +213,7 @@ jobs:
python: "pp39"
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
python: "pp39"

environment: pypi
permissions:
id-token: write
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Building for Mac OSX
To build on mac, first install _Homebrew: https://brew.sh

To install the prereqisites:

.. code-block:: bash

brew install doxygen latex qt@5 qwt-qt5 rapidjson boost
brew install doxygen qt@5 qwt-qt5 rapidjson boost eigen
brew install --cask mactex

.. code-block:: bash
Expand Down
Loading