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

ci: update for arm macos #428

Merged
merged 6 commits into from
May 8, 2024
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
28 changes: 15 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,24 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", pypy-3.8, pypy-3.9, pypy-3.10]
platform: [
{ os: "macos-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
]
include:
# Just test one x86 Windows Python for simplicity
- python-version: 3.12
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
# Just test one x64 macOS Python for simplicity
- python-version: 3.12
platform: { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }
# Just test one x64 macOS Python for simplicity
exclude:
# macOS arm doesn't have Python builds before 3.10
- python-version: 3.9
platform: { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
- python-version: 3.8
platform: { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }

steps:
- uses: actions/checkout@v4
Expand All @@ -87,10 +97,6 @@ jobs:
with:
targets: ${{ matrix.platform.rust-target }}

- name: Install Rust aarch64-apple-darwin target
if: matrix.platform.os == 'macos-latest'
run: rustup target add aarch64-apple-darwin

- name: Install test dependencies
run: pip install --upgrade nox

Expand All @@ -104,14 +110,14 @@ jobs:
run: nox -s test-examples

- name: Test macOS universal2
if: matrix.platform.os == 'macos-latest' && !startsWith(matrix.python-version, 'pypy')
if: ${{ startsWith(matrix.platform.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
shell: bash
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: '10.9'
ARCHFLAGS: -arch x86_64 -arch arm64
PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
cd examples/namespace_package
pip install build wheel
python -m build --no-isolation
Expand Down Expand Up @@ -143,10 +149,6 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Install Rust aarch64-apple-darwin target
if: matrix.os == 'macos-latest'
run: rustup target add aarch64-apple-darwin

- name: Build package
run: pip install -e .

Expand Down Expand Up @@ -307,7 +309,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
targets: aarch64-apple-darwin,x86_64-apple-darwin
- uses: pypa/[email protected]
env:
CIBW_BUILD: cp39-*
Expand Down
123 changes: 65 additions & 58 deletions examples/hello-world-setuppy/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading