Feat: Added support for python 3.13 and 3.14 #7
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: CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| rust-version: ["1.87", "stable", "beta", "nightly"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up Rust ${{ matrix.rust-version }} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust-version }} | |
| components: rustfmt, clippy | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Create and activate virtual environment | |
| run: | | |
| python -m venv .venv | |
| if [ "$RUNNER_OS" != "Windows" ]; then | |
| echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV | |
| echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| else | |
| echo "VIRTUAL_ENV=$PWD\.venv" >> $GITHUB_ENV | |
| echo "$PWD\.venv\Scripts" >> $GITHUB_PATH | |
| fi | |
| - name: Install maturin | |
| run: pip install maturin | |
| - name: Build Python package | |
| run: maturin develop | |
| - name: Run Python tests | |
| run: | | |
| python test_basic.py | |
| python simple_example.py | |
| - name: Run Rust tests | |
| run: cargo test | |
| - name: Check Rust formatting | |
| run: cargo fmt -- --check | |
| - name: Check Rust clippy | |
| run: cargo clippy -- -D warnings | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: [3.8, 3.11, 3.12, 3.13, 3.14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Install maturin | |
| run: pip install maturin | |
| - name: Build wheel | |
| run: maturin build --release | |
| - name: List wheel files (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| echo "Looking for wheel files in target/wheels/" | |
| ls -la target/wheels/ || echo "target/wheels/ directory not found" | |
| find target -name "*.whl" -type f || echo "No .whl files found" | |
| - name: List wheel files (Windows) | |
| if: runner.os == 'Windows' | |
| shell: cmd | |
| run: | | |
| echo Looking for wheel files in target/wheels/ | |
| dir target\wheels\ 2>nul || echo target/wheels/ directory not found | |
| dir target\*.whl /s 2>nul || echo No .whl files found | |
| - name: Test wheel installation (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| # Find and install the wheel file | |
| WHEEL_FILE=$(find target -name "*.whl" -type f | head -1) | |
| if [ -n "$WHEEL_FILE" ]; then | |
| echo "Installing wheel: $WHEEL_FILE" | |
| pip install "$WHEEL_FILE" | |
| python -c "import hashsig_py; print('Import successful')" | |
| else | |
| echo "No wheel file found" | |
| echo "Contents of target directory:" | |
| find target -type f || echo "target directory not found" | |
| exit 1 | |
| fi | |
| - name: Test wheel installation (Windows) | |
| if: runner.os == 'Windows' | |
| shell: cmd | |
| run: | | |
| for /r target %%i in (*.whl) do ( | |
| echo Installing wheel: %%i | |
| pip install "%%i" | |
| python -c "import hashsig_py; print('Import successful')" | |
| goto :success | |
| ) | |
| echo No wheel file found | |
| dir target /s | |
| exit /b 1 | |
| :success |