Skip to content

Commit

Permalink
updates to test action
Browse files Browse the repository at this point in the history
- print lines coverage to actions cli output
- comment PR with report when allowed

Signed-off-by: muraca <mmuraca247@gmail.com>
  • Loading branch information
muraca committed Oct 5, 2023
1 parent bfb13cf commit 3f290c9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Run tests
run: cargo llvm-cov nextest --lcov
- name: Run tests and print coverage data
run: cargo llvm-cov nextest --json --output-path lcov.json
--ignore-filename-regex "node/" --summary-only &&
echo "Lines coverage " && jq ".data[0].totals.lines.percent" lcov.json
# if the PR is on the same repo, the coverage data can be reported as a comment
- if: github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
name: Generate lcov report
run: cargo llvm-cov report --lcov --output-path lcov.info
--ignore-filename-regex "node/"
--output-path lcov.info
- if: github.event_name == 'pull_request'
- if: github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
name: Report code coverage
uses: Nef10/lcov-reporter-action@v0.4.0
with:
Expand Down

0 comments on commit 3f290c9

Please sign in to comment.