chore: Release #124
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
on: [push, pull_request] | |
name: "NBLAST python library" | |
defaults: | |
run: | |
shell: bash | |
working-directory: nblast-py | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: "3.x" | |
- run: pip install $(grep -E '^(ruff|mypy)' requirements.txt) | |
- run: make lint | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v1 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- run: | | |
pip install -U pip wheel | |
pip install -r requirements.txt | |
name: Install dependencies | |
- run: | | |
mkdir -p $TGT_DIR | |
rm -f $TGT_DIR/*.whl | |
maturin build --release --interpreter python --out $TGT_DIR | |
pip install $TGT_DIR/*.whl | |
name: Install package | |
env: | |
TGT_DIR: "target/wheels/${{ matrix.python-version }}" | |
# change into upper directory so that pytest doesn't import locally | |
- run: cd .. && pytest --verbose | |
deploy: | |
strategy: | |
matrix: | |
os: | |
- macos-latest | |
- windows-latest | |
- ubuntu-22.04 | |
needs: [lint, test] | |
runs-on: ${{ matrix.os }} | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/py-v') | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- uses: PyO3/maturin-action@v1 | |
if: ${{ startsWith(matrix.os, 'macos') }} | |
with: | |
manylinux: auto | |
command: publish | |
args: -u __token__ -p ${{ secrets.MATURIN_PASSWORD }} --skip-existing --target universal2-apple-darwin | |
working-directory: nblast-py | |
name: Deploy distribution (macos) | |
- uses: PyO3/maturin-action@v1 | |
if: ${{ !startsWith(matrix.os, 'macos') }} | |
with: | |
manylinux: auto | |
command: publish | |
args: -u __token__ -p ${{ secrets.MATURIN_PASSWORD }} --skip-existing | |
working-directory: nblast-py | |
name: Deploy distribution (other) |