Skip to content

Commit

Permalink
different behavior for tests and code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: muraca <mmuraca247@gmail.com>
  • Loading branch information
muraca committed Oct 4, 2023
1 parent 0ac42d2 commit 574b52c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,25 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Run tests
# push on main, or pull request in different repos,
# eg from contributor/Tuxedo to Off-Narrative-Labs/Tuxedo
- if: github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.base.repo != github.event.pull_request.head.repo)
name: Run tests and print coverage data
run: cargo llvm-cov nextest --json
--ignore-filename-regex "node/"
--output-path lcov.json &&
jq ".data[0].totals.lines.percent" lcov.json
# pull request in the same repo, able to report coverage using comment on PR
- if: github.event_name == 'pull_request' &&
github.event.pull_request.base.repo == github.event.pull_request.head.repo
name: Run tests and collect coverage data
run: cargo llvm-cov nextest --lcov
--ignore-filename-regex "node/"
--output-path lcov.info
- if: github.event_name == 'pull_request'
- if: github.event_name == 'pull_request' &&
github.event.pull_request.base.repo == github.event.pull_request.head.repo
name: Report code coverage
uses: Nef10/lcov-reporter-action@v0.4.0
with:
Expand Down

0 comments on commit 574b52c

Please sign in to comment.