Skip to content

A GitHub Action that does single-action code coverage generation.

Notifications You must be signed in to change notification settings

giangndm-bluesea/fucov

 
 

Repository files navigation

fucov

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.

Example usage

# 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.

Inputs

: 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.

How it looks

This repo has some testcases included, which yield the following coverage results:

codecov

Known Issues

There are a few known issues around doctests:

About

A GitHub Action that does single-action code coverage generation.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 76.4%
  • Rust 23.6%