name: Python CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Python tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install maturin
run: pip install "maturin>=1.5"
- name: Create virtualenv
working-directory: minigraf-ffi/python
run: python -m venv .venv
- name: Build and test (workaround for maturin workspace uniffi-bindgen bug)
working-directory: minigraf-ffi/python
run: |
source .venv/bin/activate 2>/dev/null || source .venv/Scripts/activate
pip install pytest
bash build.sh test
shell: bash