v0.20.2 #287
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
# release: | |
# types: [ created ] | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
PYTHON_VERSION: "3.8" | |
RUST_BACKTRACE: "1" | |
jobs: | |
linux-x86_64: | |
runs-on: ubuntu-latest | |
needs: | |
- cargofmt | |
- black | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install dependencies | |
run: python install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
RUSTFLAGS: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" | |
with: | |
target: x86_64 | |
args: --release --out dist | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-x86_64 | |
path: dist | |
- name: pytest | |
shell: bash | |
run: | | |
set -e | |
pip install --force-reinstall dist/*.whl | |
pytest -s tests | |
linux-aarch64: | |
runs-on: ubuntu-latest | |
needs: | |
- cargofmt | |
- black | |
- linux-x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install dependencies | |
run: python install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: aarch64-unknown-linux-gnu | |
args: --release --out dist | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-aarch64 | |
path: dist | |
windows-x86_64: | |
needs: | |
- cargofmt | |
- black | |
- linux-x86_64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: python install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
RUSTFLAGS: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+sse4.1,+sse4.2" | |
with: | |
target: x86_64 | |
args: --release --out dist -i python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-windows-x86_64 | |
path: dist | |
- name: pytest | |
shell: bash | |
run: | | |
set -e | |
pip install --force-reinstall dist/*.whl | |
pytest tests | |
macos-x86_64: | |
needs: | |
- cargofmt | |
- black | |
- linux-x86_64 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: python install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
RUSTFLAGS: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+sse4.1,+sse4.2" | |
# lower versions result in "illegal instruction" | |
MACOSX_DEPLOYMENT_TARGET: "10.14" | |
with: | |
target: x86_64 | |
args: --release --out dist -i python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-x86_64 | |
path: dist | |
- name: pytest | |
shell: bash | |
run: | | |
set -e | |
pip install --force-reinstall dist/*.whl | |
pytest tests | |
macos-aarch64: | |
runs-on: macos-latest | |
needs: | |
- cargofmt | |
- black | |
- linux-x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust targets | |
run: rustup target add aarch64-apple-darwin | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install dependencies | |
run: | | |
python install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: aarch64-apple-darwin | |
args: --release --out dist | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-aarch64 | |
path: dist | |
sdist: | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
needs: | |
- cargofmt | |
- black | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
needs: [ linux-x86_64, linux-aarch64, windows-x86_64, macos-x86_64, macos-aarch64, sdist ] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-linux-x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-linux-aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-windows-x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI }} | |
with: | |
command: upload | |
args: --skip-existing * | |
cargofmt: | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
- name: run rustfmt | |
run: | | |
cargo fmt -- --check | |
black: | |
name: black | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install black | |
run: | | |
pip install black | |
- name: run black | |
run: | | |
black -l 120 python tests *.py docs/source/*.py |