Skip to content

Chore/upgrade python 314 #155

Chore/upgrade python 314

Chore/upgrade python 314 #155

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
# Set up Python first
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Install Rust toolchain
- name: Install Rust toolchain
run: |
rustup toolchain install stable
rustup default stable
rustup component add clippy
# Clippy - Rust linter
- name: Run Clippy
run: cargo clippy -- -D warnings
# Build Rust code first
- name: Build
run: cargo build --verbose
# Set up Python virtual environment FIRST
- name: Setup Python environment
run: |
python -m venv venv
source venv/bin/activate
pip install maturin ruff
# Run maturin develop to build the extension and set up environment
- name: Build Python extension
run: |
source venv/bin/activate
maturin develop
# Run Python tests
- name: Run Python tests
run: |
source venv/bin/activate
ruff check .
python -m unittest discover -s tests -p '*.py'
# Run Rust tests - they should work now with the extension built
- name: Run Rust tests
run: |
source venv/bin/activate
cargo test --verbose