Skip to content

Commit

Permalink
fixup! Measure test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mxpv committed Sep 14, 2023
1 parent e0f46aa commit bbdbc96
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- run: cargo install grcov
- run: sudo -E $(command -v cargo) test --all-features
- run: |
apt-get install protobuf-compiler
cargo install grcov
- run: |
sudo -E $(command -v cargo) test --all-features
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
Expand All @@ -113,6 +114,16 @@ jobs:
echo "# Test coverage" >> $GITHUB_STEP_SUMMARY
cat target/coverage/markdown.md >> $GITHUB_STEP_SUMMARY
- run: |
TITLE=`cat target/coverage/markdown.md | grep "Total coverage"`
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA \
-f state='success' \
-f description='$TITLE'
deny:
name: Deny
runs-on: ubuntu-latest
Expand Down

0 comments on commit bbdbc96

Please sign in to comment.