Chore/upgrade python 314 #150
This file contains hidden or 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: 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 |