Add Python 3.13 #210
Workflow file for this run
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: | |
- master | |
pull_request: | |
branches: | |
- master | |
create: | |
workflow_dispatch: | |
jobs: | |
debug: | |
name: debug | |
runs-on: ubuntu-latest | |
steps: | |
- uses: hmarr/debug-action@v3 | |
rutest: | |
name: Test Rust | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
- run: cargo check | |
- run: cargo test | |
pytest: | |
name: Test Python | |
needs: rutest | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
py: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.py }} | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
- name: Install and test | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
echo "VIRTUAL_ENV: $VIRTUAL_ENV" | |
python -m pip install --upgrade pip | |
pip install -r goldpy/requirements.txt | |
maturin develop -m goldpy/Cargo.toml | |
pytest goldpy/test | |
- name: Install and test (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
python -m venv venv | |
venv/Scripts/Activate.ps1 | |
Write-Host "VIRTUAL_ENV: $env:VIRTUAL_ENV" | |
python -m pip install --upgrade pip | |
pip install -r goldpy/requirements.txt | |
maturin develop -m goldpy/Cargo.toml | |
pytest goldpy/test | |
build-wheels: | |
name: Build wheels | |
if: "startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'" | |
needs: pytest | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: PyO3/maturin-action@v1 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
manylinux: auto | |
rust-toolchain: nightly | |
command: build | |
args: --release --sdist -o dist -m goldpy/Cargo.toml --interpreter 3.9 3.10 3.11 3.12 3.13 | |
- uses: messense/maturin-action@v1 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
manylinux: auto | |
rust-toolchain: nightly | |
command: build | |
args: --release -o dist -m goldpy/Cargo.toml --interpreter 3.9 3.10 3.11 3.12 3.13 | |
# - uses: actions/setup-python@v4 | |
# if: ${{ matrix.os == 'macos-latest' }} | |
# with: | |
# python-version: '3.12' | |
# - uses: actions/setup-python@v4 | |
# if: ${{ matrix.os == 'macos-latest' }} | |
# with: | |
# python-version: '3.9' | |
# - uses: actions/setup-python@v4 | |
# if: ${{ matrix.os == 'macos-latest' }} | |
# with: | |
# python-version: '3.8' | |
- uses: messense/maturin-action@v1 | |
if: ${{ matrix.os == 'macos-latest' }} | |
with: | |
manylinux: auto | |
rust-toolchain: nightly | |
command: build | |
args: --release -o dist --universal2 -m goldpy/Cargo.toml --interpreter 3.9 3.10 3.11 3.12 3.13 | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheel | |
path: ./dist/*.whl | |
deploy: | |
name: Deploy | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
needs: build-wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- name: Publish to PyPI | |
uses: messense/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * |