I will not be maintaining / updating fucov
going forward.
You should use cargo-llvm-cov instead, which is maintained, more feature complete and has a better user experience throughout. It also has very good integration with CI / GitHub Actions.
A GitHub Action that does single-action code coverage generation.
The action needs a nightly compiler and llvm-tools
available.
It will invoke cargo test
and generate a coverage/coverage.lcov
file which
can be uploaded to codecov for example.
This action basically does all the steps that are described in the unstable book.
# the action needs a nightly toolchain with llvm-tools
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: llvm-tools-preview
# runs cargo with defaults flags, using the default `lcov` output
- uses: Swatinem/fucov@v1
# afterwards, upload the report to codecov
- uses: codecov/codecov-action@v1
with:
directory: coverage
NOTE that you do need a nightly toolchain with the llvm-tools-preview
component installed, as this action will use the included llvm-profdata/cov
tools.
: args
Arguments for the cargo test
command. Defaults to --workspace --all-features
.
: output-format
The desired output format. One of lcov
, json
, html
or profdata
. Defaults to lcov
.
: output-filename
The desired output filename. Defaults to coverage/coverage.$ext
, depending on the chosen output-format
.
This repo has some testcases included, which yield the following coverage results:
There are a few known issues around doctests: