feat(cli): added standalone cli #141
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: Code Coverage | |
| on: [push, pull_request] | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - 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 | |
| # Generate Python coverage report | |
| pip install uv | |
| uv venv | |
| source .venv/bin/activate | |
| uv pip install maturin pytest coverage | |
| rm -rf target/wheels | |
| # Build and install in editable mode for coverage mapping | |
| maturin develop | |
| coverage run -m pytest tests/python/ -vv | |
| coverage xml -o coverage/python-coverage.xml | |
| # 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 | |
| - 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 |