simstring_rust 0.3.4

A native Rust implementation of the SimString algorithm
Documentation
name: Code Coverage
on: [push, pull_request]
jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Install rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache dependencies
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            target/
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y software-properties-common python3-dev

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.14"

      - name: Install grcov and llvm-tools
        run: |
          cargo install grcov --force
          rustup component add llvm-tools

      - name: Run tests and generate coverage report
        env:
          SIMSTRING_RS_COVERAGE: "1"
        run: |
          # Create directory for coverage reports
          mkdir -p ./coverage
          # Set flags for coverage generation
          export CARGO_INCREMENTAL=0
          export RUSTFLAGS="-Cinstrument-coverage"
          # Set the path for the raw coverage data
          export LLVM_PROFILE_FILE="target/coverage/simstring_rs-%p-%m.profraw"
          # Run all tests, including the ignored python bindings
          cargo test --all-features -- --include-ignored
          # Generate the coverage report
          grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "tests/*" --ignore "examples/*" --ignore "build.rs" --ignore "src/lib.rs" -o ./coverage.lcov
          grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "tests/*" --ignore "examples/*" --ignore "build.rs" --ignore "src/lib.rs" -o ./coverage/cobertura.xml
          # Generate Python coverage report
          pip install uv
          uv venv
          source .venv/bin/activate
          uv pip install maturin pytest coverage
          rm -rf target/wheels
          maturin build --release
          uv pip install target/wheels/*.whl
          coverage run -m pytest tests/python/ -vv
          coverage xml -o coverage/python-coverage.xml

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage/cobertura.xml,./coverage/python-coverage.xml
          fail_ci_if_error: true