Skip to content

bewee/rustdoc-coverage-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

rustdoc-coverage-action

License: MPL 2.0 build-test workflow

Use this action to generate documentation coverage reports. Powered by rustdoc's unstable show-coverage option.

image

Example Workflow

on: [push]

name: Documentation coverage

jobs:
  print_doc_coverage:
    name: Print documentation coverage
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
      - id: coverage
        uses: bewee/rustdoc-coverage-action@v1
      - run: echo ${{ steps.coverage.outputs.documented }}

This repository contains exemplary workflows for generating a doc coverage badge and commenting on pull request.

Inputs

Input Description Default
use-cross Use cross instead of cargo false
working-directory Select a custom working directory
store-report Whether to store the coverage report in rustdoc-coverage-report.json true
calculate-diff If a rustdoc-coverage-report.json exists: Whether to calculate the coverage diff to it true
percentage-format Format string used for percentages 0.[00]%
diff-percentage-format diff-percentage-format +0.[00]%

Outputs

Output Description
documented The overall percentage of documented code
diff-documented Difference in the overall percentage of documented code if a rustdoc-coverage-report.json exists and calculate-diff is enabled, otherwise zero
examples The overall percentage of code with examples
diff-examples Difference in the overall percentage of code with examples if a rustdoc-coverage-report.json exists and calculate-diff is enabled, otherwise zero
table Tabular rustdoc coverage summary
json JSON rustdoc coverage summary

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •