Chore/upgrade python 314 #151
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 | |
| # Install Rust | |
| - name: Install Rust toolchain | |
| run: rustup toolchain install stable | |
| # Clippy (all features including PyO3) | |
| - name: Run Clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| # Setup Python environment | |
| - name: Setup Python | |
| run: | | |
| python -m venv venv | |
| source venv/bin/activate | |
| pip install --upgrade pip setuptools maturin ruff | |
| # Lint Python | |
| - name: Lint Python | |
| run: | | |
| source venv/bin/activate | |
| ruff check . | |
| # Build PyO3 extension | |
| - name: Build PyO3 extension | |
| run: | | |
| source venv/bin/activate | |
| maturin develop --release | |
| # Run Python tests | |
| - name: Python tests | |
| run: | | |
| source venv/bin/activate | |
| python -m unittest discover -s tests -p '*.py' | |
| # Run Rust tests with all features | |
| - name: Rust tests | |
| run: cargo test --all-features --verbose |