Add tests vs sympy #46
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
name: Build Python wheels | |
on: | |
push: | |
branches: [master] | |
tags: "*" | |
pull_request: | |
# Check all PR | |
jobs: | |
build-wheels: | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.name }} | |
strategy: | |
matrix: | |
include: | |
- name: x86_64 macOS | |
os: macos-10.15 | |
rust-target: x86_64-apple-darwin | |
platform-name: macosx-10.9-x86_64 | |
- name: M1 macOS | |
os: macos-11 | |
rust-target: aarch64-apple-darwin | |
platform-name: macosx-11.0-arm64 | |
- name: x86_64 Windows | |
os: windows-2019 | |
# TODO: add a 32-bit windows builder? | |
rust-target: x86_64-pc-windows-msvc | |
platform-name: win_amd64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
target: ${{ matrix.rust-target }} | |
- name: setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: build wheel | |
run: | | |
pip install wheel | |
python setup.py bdist_wheel --plat-name ${{ matrix.platform-name }} --rust-target ${{ matrix.rust-target }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist/*.whl | |
- name: upload wheel to GitHub release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/*.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-manylinux-wheels: | |
runs-on: ubuntu-20.04 | |
# TODO: add other arch for linux? | |
name: x86_64 manylinux2010 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: build manylinux2010 with rust docker image | |
run: docker build -t manylinux2010-with-rust python/build-wheels | |
- name: build wheel in docker | |
run: docker run --rm -v $(pwd):/code manylinux2010-with-rust bash -c "cd /code && /opt/python/cp38-cp38/bin/python setup.py bdist_wheel --rust-target x86_64-unknown-linux-gnu" | |
- name: run auditwheel in docker | |
run: docker run --rm -v $(pwd):/code manylinux2010-with-rust bash -c "auditwheel repair /code/dist/*.whl -w /code/dist" | |
- name: remove wheel with wrong tag | |
run: sudo rm dist/*linux_x86_64.whl | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist/*.whl | |
- name: upload wheel to GitHub release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/*.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-sdist: | |
runs-on: ubuntu-20.04 | |
name: sdist | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: build sdist | |
run: | | |
pip install wheel | |
python setup.py sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist/*.tar.gz | |
- name: upload sdist to GitHub release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/*.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |