diff --git a/.github/workflows/build_default.yml b/.github/workflows/build_default.yml index 7f45e499..948ebf1f 100644 --- a/.github/workflows/build_default.yml +++ b/.github/workflows/build_default.yml @@ -15,7 +15,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-2022] + # Include macos-13 to get Intel x86_64 macs and maos-latest to get the Aaarch64 macs + os: [ubuntu-latest, macos-latest, macos-13, windows-2022] + + # Build on the native architectures (macos-latest is arm64. macos-13 is x86_64) + include: + - os: macos-latest + osx_arch: 'arm64' + - os: macos-13 + osx_arch: 'x86_64' steps: - uses: actions/checkout@master @@ -29,6 +37,7 @@ jobs: CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*" CIBW_TEST_REQUIRES: setuptools pytest torch numdifftools CIBW_TEST_COMMAND: "python -m pytest -s {project}/src/osqp/tests -k \"not codegen\"" + CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }} - name: Build source if: runner.os == 'Linux' diff --git a/pyproject.toml b/pyproject.toml index 6eacedad..dea70201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ sdist.include = ["src/osqp/_version.py"] [tool.scikit-build.cmake.define] OSQP_ALGEBRA_BACKEND = "builtin" OSQP_EXT_MODULE_NAME = "ext_builtin" +CMAKE_OSX_ARCHITECTURES = {env="CMAKE_OSX_ARCHITECTURES"} [tool.pytest.ini_options] testpaths = ["src/osqp/tests"]