Skip to content

chore(deps): Bump Swatinem/rust-cache from 2.7.5 to 2.7.7 #468

chore(deps): Bump Swatinem/rust-cache from 2.7.5 to 2.7.7

chore(deps): Bump Swatinem/rust-cache from 2.7.5 to 2.7.7 #468

name: Python Test Suite
on:
push:
branches: ["main"]
paths:
- .github/workflows/*_python.yml
- bindings/python/**
- src/**
- Cargo.lock
- Cargo.toml
- deny.toml
- .gitmodules
pull_request:
paths:
- .github/workflows/*_python.yml
- bindings/python/**
- src/**
- Cargo.lock
- Cargo.toml
- deny.toml
- .gitmodules
permissions:
contents: read
jobs:
test:
name: Python test
defaults:
run:
working-directory: bindings/python
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3" # Latest version
exclude:
# Skip Python 3.7 on macos-latest due to no support.
- os: macos-latest
python-version: "3.7"
runs-on: ${{matrix.os}}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@d0592fe69e35bc8f12e3dbaf9ad2694d976cb8e3 # stable
- uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: lang-python-${{runner.os}}
- name: Run Cargo Clippy
run: cargo clippy
- name: Run Cargo Fmt
run: cargo fmt --check
- name: Run Cargo Deny
uses: EmbarkStudios/cargo-deny-action@e2f4ede4a4e60ea15ff31bc0647485d80c66cfba # v2.0.4
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Setup Python ${{matrix.python-version}}
id: setup-python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{matrix.python-version}}
cache: 'pip'
- name: Install dependencies
run: python -m pip install .[test,docs]
- name: Lint with Ruff
run: |
python -m ruff check --output-format=github .
- name: Lint with Ruff
run: |
python -m ruff format --check .
- name: Build Rust
uses: PyO3/maturin-action@ea5bac0f1ccd0ab11c805e2b804bfcb65dac2eab # v1.45.0
with:
sccache: 'true'
manylinux: auto
working-directory: bindings/python
- name: Prepare tests
run: |
python -m pip install openchecks --find-links target/wheels
- name: Run tests
run: |
python -m pytest --hypothesis-profile default -n=auto tests/
- name: Run examples
run: |
python examples/async_auto_fix.py
python examples/async_check.py
python examples/auto_fix.py
python examples/check.py
- name: Run doc tests
run: |
python -m sphinx -b=doctest docs/source docs/build