opthash 0.6.0

Rust implementations of Elastic Hashing and Funnel Hashing
Documentation
name: CI

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
  contents: read

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: astral-sh/setup-uv@v4
        with:
          python-version: "3.13"
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - uses: actions/cache@v4
        with:
          path: ~/.cache/pre-commit
          key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
      - run: uvx pre-commit run --all-files --show-diff-on-failure

  rust:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - name: Clippy
        run: cargo clippy --all-features -- -W clippy::pedantic
      - name: Test
        run: cargo test

  python:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: astral-sh/setup-uv@v4
        with:
          python-version: "3.13"
      - name: Build wheel
        uses: PyO3/maturin-action@v1
        with:
          args: --release --features python --out dist
          sccache: true
      - name: Pytest
        run: |
          uv venv
          uv pip install dist/*.whl pytest hypothesis pytest-benchmark
          uv run pytest tests/