Skip to content

add coverage ci

add coverage ci #3

Workflow file for this run

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: cargo install cargo-tarpaulin
- name: Run Tarpaulin and Save Output
run: cargo tarpaulin > tarpaulin-output.txt
- name: Upload Tarpaulin Output as Artifact
uses: actions/upload-artifact@v3
with:
name: tarpaulin-output
path: tarpaulin-output.txt
- name: Check Coverage
run: |
if ! grep -q "100% coverage" tarpaulin-output.txt; then
echo "Coverage is below 100%"
exit 1
fi