Upgrade maturin #230
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"] | |
python: ["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.python }} | |
- uses: PyO3/maturin-action@v1 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
manylinux: auto | |
rust-toolchain: nightly | |
command: build | |
args: --release -o dist -m goldpy/Cargo.toml --interpreter python${{ matrix.python }} | |
- uses: PyO3/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 python${{ matrix.python }} | |
- uses: PyO3/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 python${{ matrix.python }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-${{ matrix.os }}-${{ matrix.python }} | |
path: ./dist/*.whl | |
deploy: | |
name: Deploy | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
needs: build-wheels | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/goldpy | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
test-deploy: | |
name: Test Deploy | |
if: github.event_name == 'workflow_dispatch' | |
needs: build-wheels | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi-test | |
url: https://test.pypi.org/p/goldpy | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
repository-url: https://test.pypi.org/legacy/ |