-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
87 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 |
---|---|---|
|
@@ -9,59 +9,13 @@ on: | |
- main | ||
|
||
jobs: | ||
build_wheels: # credit to https://github.com/samuelcolvin/rtoml/blob/main/.github/workflows/ci.yml | ||
name: > | ||
build ${{ matrix.python-version }} on ${{ matrix.os }} (${{ matrix.target }}) | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
target: [x86_64, aarch64] | ||
python-version: [cp310, pp310] | ||
manylinux: [auto] | ||
include: | ||
# ubuntu | ||
- os: ubuntu | ||
platform: linux | ||
pypy: true | ||
- os: ubuntu | ||
platform: linux | ||
target: i686 | ||
- os: ubuntu | ||
platform: linux | ||
target: armv7 | ||
- os: ubuntu | ||
platform: linux | ||
target: ppc64le | ||
- os: ubuntu | ||
platform: linux | ||
target: s390x | ||
# musllinux | ||
- os: ubuntu | ||
platform: linux | ||
target: x86_64 | ||
manylinux: musllinux_1_1 | ||
- os: ubuntu | ||
platform: linux | ||
target: aarch64 | ||
manylinux: musllinux_1_1 | ||
# macos | ||
- os: macos | ||
target: x86_64 | ||
pypy: true | ||
- os: macos | ||
target: arch64 | ||
pypy: true | ||
# windows | ||
- os: windows | ||
ls: dir | ||
- os: windows | ||
ls: dir | ||
target: i686 | ||
python-architecture: x86 | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
python-version: [cp310] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -71,54 +25,23 @@ jobs: | |
with: | ||
python-version: '3.10' | ||
|
||
- name: set up rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: install python dependencies | ||
run: pip install -U setuptools setuptools-rust wheel twine cibuildwheel platformdirs | ||
run: pip install --upgrade pip && pip install --upgrade setuptools setuptools-rust wheel twine cibuildwheel platformdirs | ||
|
||
# NOTE: This is needed to ensure that hyperdrive-wrappers builds correctly. | ||
- name: install foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: build sdist | ||
if: matrix.os == 'ubuntu' && matrix.python-version == 'cp310' | ||
run: | | ||
python -m build --sdist -o wheelhouse crates/hyperdrive-math-py/ | ||
|
||
- name: build ${{ matrix.platform || matrix.os }} binaries | ||
run: cibuildwheel crates/hyperdrive-math-py/ | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: '${{ matrix.python-version }}-*' | ||
# rust doesn't seem to be available for musl linux on i686 | ||
CIBW_SKIP: '*-musllinux_i686' | ||
# we build for "alt_arch_name" if it exists, else 'auto' | ||
CIBW_ARCHS: ${{ matrix.alt_arch_name || 'auto' }} | ||
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"' | ||
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' | ||
CIBW_BEFORE_BUILD: rustup show | ||
CIBW_BEFORE_BUILD_LINUX: > | ||
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y && | ||
rustup show | ||
CIBW_TEST_COMMAND: 'pytest {project}/test' | ||
CIBW_TEST_REQUIRES: pytest requests | ||
CIBW_TEST_SKIP: '*-macosx_arm64 *-macosx_universal2:arm64' | ||
CIBW_BUILD_VERBOSITY: 1 | ||
with: | ||
output-dir: wheelhouse | ||
|
||
- run: ${{ matrix.ls || 'ls -lh' }} wheelhouse/ | ||
|
||
- run: twine check wheelhouse/* | ||
package-dir: crates/hyperdrive-math-py | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: wheelhouse | ||
path: ./wheelhouse/*.whl |