Skip to content

Rustdoc coverage

Actions
Generate rustdoc coverage report
v1
Latest
Star (2)

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

Rustdoc coverage is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Generate rustdoc coverage report
v1
Latest

Rustdoc coverage is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.