Add test-case for checking zero-length and get_spm
(#9)
#43
This file contains 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: Coverage | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-Cinstrument-coverage" | |
RUSTDOCFLAGS: "-Cinstrument-coverage -Z unstable-options --persist-doctests target/debug/doctestbins" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy, llvm-tools-preview | |
- name: install grcov | |
run: cargo install grcov | |
- name: run tests | |
run: LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose | |
- name: Generate coverage report | |
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "examples" --ignore "/*" -o lcov.info | |
- name: Upload coverage | |
run: bash <(curl -s https://codecov.io/bash) -f lcov.info | |