Skip to content

Commit

Permalink
ci(coverage): add grcov coverage pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
drexhage committed Dec 19, 2023
1 parent 8329604 commit ccad61a
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Coverage
on:
workflow_dispatch:
jobs:
coverage:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install grcov
run: |
cargo install grcov
rustup component add llvm-tools-preview
- name: Run tests
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: cargo-test-%p-%m.profraw
run: cargo test
- name: Generate coverage report
run: |
grcov . \
--binary-path ./target/debug/deps/ \
-s . -t html \
--branch \
--ignore-not-existing \
--ignore '../*' \
--ignore "/*" \
-o target/coverage
ls target/coverage
jq < target/coverage/coverage.json
- name: Generate docs
run: |
cargo doc --workspace --no-deps
- name: Prepare deploy
run: |
mkdir public
mv target/coverage public/
mv target/doc public/
- name: Deploy artifacts
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: docs-coverage

0 comments on commit ccad61a

Please sign in to comment.