Skip to content

Chore/upgrade python 314 #150

Chore/upgrade python 314

Chore/upgrade python 314 #150

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
permissions: read-all
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Clippy - Rust linter
- name: Install Rust toolchain
run: rustup toolchain install stable
- name: Run Clippy
run: rustup component add clippy && cargo clippy -- -D warnings
# Setup Python virtual environment for PyO3
- name: Setup Python environment
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools maturin ruff
python -m pip list
# Lint Python
- name: Lint Python
run: |
source venv/bin/activate
ruff check .
# Build PyO3 extension in-place
- name: Build PyO3 extension
run: |
source venv/bin/activate
maturin develop --release
# Run Python unit tests
- name: Run Python tests
run: |
source venv/bin/activate
python -m unittest discover -s tests -p '*.py'
# Build Rust without features (for pure Rust tests)
- name: Rust build (no features)
run: cargo build --no-default-features --verbose
# Run Rust tests without PyO3
- name: Rust tests (no PyO3)
run: cargo test --no-default-features --verbose
# Run Rust tests with PyO3 linked
- name: Rust tests (with PyO3)
run: |
source venv/bin/activate
cargo test --features extension-module --verbose