chore(release): 0.2.0 — docs site, coverage gate, mmap example #11
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: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rust: | |
| name: rust (fmt · clippy · test · audit) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy, llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-audit,cargo-llvm-cov | |
| - name: fmt | |
| run: cargo fmt --all --check | |
| - name: clippy (default = with mph) | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: clippy (no-default-features = fst only) | |
| run: cargo clippy --no-default-features --all-targets -- -D warnings | |
| - name: test (default) | |
| run: cargo test | |
| - name: test (no-default-features) | |
| run: cargo test --no-default-features | |
| - name: cargo audit | |
| run: cargo audit | |
| - name: coverage (llvm-cov, floor 95% lines; default = mph + mmap) | |
| run: cargo llvm-cov --summary-only --fail-under-lines 95 | |
| python-build: | |
| name: python (ruff · clippy · build) | |
| runs-on: ubuntu-latest | |
| env: | |
| PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: ruff check | |
| run: uvx ruff check python/ tests/test_python.py | |
| - name: ruff format --check | |
| run: uvx ruff format --check python/ tests/test_python.py | |
| - name: clippy (python bindings) | |
| run: cargo clippy --features python -- -D warnings | |
| - name: build abi3 wheel | |
| run: uv run --with maturin maturin build --release --out dist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/*.whl | |
| python-test: | |
| name: python (pytest · stubtest · py${{ matrix.python-version }}) | |
| needs: python-build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist | |
| # Install-only: the single abi3 wheel must import and pass on every supported interpreter. | |
| - name: pytest | |
| run: | | |
| wheel=$(ls dist/*.whl | head -1) | |
| uv run --python ${{ matrix.python-version }} --with pytest --with "$wheel" \ | |
| pytest tests/test_python.py -q | |
| - name: stubtest | |
| run: | | |
| wheel=$(ls dist/*.whl | head -1) | |
| uv run --python ${{ matrix.python-version }} --with mypy --with "$wheel" \ | |
| python -m mypy.stubtest lexindex |