Chore/upgrade python 314 #156
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 toolchain | |
| - name: Install Rust | |
| run: rustup toolchain install stable | |
| # Run Clippy (Rust linter) | |
| - name: Run Clippy | |
| run: rustup component add clippy && cargo clippy -- -D warnings | |
| # Setup Python virtual environment and run Python lint/tests | |
| - name: Setup Python and run tests | |
| run: | | |
| python -m venv venv | |
| source venv/bin/activate | |
| pip install --upgrade pip | |
| pip install ruff maturin | |
| ruff check . | |
| maturin develop | |
| python -m unittest discover -s tests -p '*.py' | |
| # Build Rust with PyO3 | |
| - name: Build Rust | |
| run: | | |
| source venv/bin/activate | |
| export PYTHON_SYS_EXECUTABLE=$(which python) | |
| cargo build --verbose | |
| # Run Rust tests with all features (including PyO3) | |
| - name: Run Rust tests | |
| run: | | |
| source venv/bin/activate | |
| export PYTHON_SYS_EXECUTABLE=$(which python) | |
| cargo test --all-features --verbose |