add coverage ci #6
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: | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
components: rustfmt, clippy | |
- name: Install Tarpaulin | |
run: | | |
if ! command -v cargo-tarpaulin &> /dev/null | |
then | |
cargo install cargo-tarpaulin | |
fi | |
- name: Run Tarpaulin and Check Coverage | |
run: | | |
# cargo tarpaulin > tarpaulin-output.txt | |
# if ! grep -q "100% coverage" tarpaulin-output.txt; then | |
# echo "Coverage is below 100%" | |
# exit 1 | |
# fi | |
cargo tarpaulin |