Skip to content

Commit

Permalink
github: Report code coverage
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
ernestask committed May 3, 2022
1 parent 9ac1062 commit ef68725
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,37 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Build
run: cargo build --tests --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions-rs/toolchain@v1
with:
components: llvm-tools-preview
override: true
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
env:
LLVM_PROFILE_FILE: "nldl-%p-%m.profraw"
RUSTFLAGS: '-Cinstrument-coverage'
- use: actions-rs/cargo@v1
with:
command: install
args: grcov
- id: coverage
run: |
grcov \
--branch \
--ignore-not-existing \
--llvm \
--binary-path=target/debug/ \
--output-path=target/debug/lcov.info \
--output-type=lcov \
--source-dir=. \
.
echo '::set-output name=report::target/debug/lcov.info'
- uses: codecov/codecov-action@v2
with:
files: ${{ steps.coverage.outputs.report }}

check-readme:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ef68725

Please sign in to comment.