All Projects → 5monkeys → cobertura-action

5monkeys / cobertura-action

Licence: MIT license
GitHub Action to report cobertura coverage

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cobertura-action

jacoco-report
Github action that publishes the JaCoCo report as a comment in the Pull Request
Stars: ✭ 31 (-27.91%)
Mutual labels:  coverage, actions
action-dynamic-readme
~ Dynamic ReadME Generator ~
Stars: ✭ 29 (-32.56%)
Mutual labels:  actions
set-env-to-github env
A migration tools convert `::set-env`/`::set-output`/`::save-state` to $GITHUB_ENV/$GITHUB_OUTPUT/$GITHUB_STATE on GitHub Actions.
Stars: ✭ 27 (-37.21%)
Mutual labels:  actions
actionlint
Static checker for GitHub Actions workflow files
Stars: ✭ 1,385 (+3120.93%)
Mutual labels:  actions
MsCoreOne
MsCoreOne is a simple Ecommerce with using many technologies such as .NET 5, Entity Framework Core 5, React 16.13 with modern Clean Architecture, Domain-Driven Design, CQRS, SOLID, Identity Server 4, Blazor. It will focus on resolving the problems always see in the process to develop projects.
Stars: ✭ 77 (+79.07%)
Mutual labels:  coverage
actions-suggest-related-links
A GitHub Action to suggest related or similar issues, documents, and links. Based on the power of NLP and fastText.
Stars: ✭ 23 (-46.51%)
Mutual labels:  actions
solcover
Code coverage for solidity
Stars: ✭ 64 (+48.84%)
Mutual labels:  coverage
actions
Our Library of GitHub Actions
Stars: ✭ 49 (+13.95%)
Mutual labels:  actions
eslint-action
Github action that runs ESLint on javascript code.
Stars: ✭ 81 (+88.37%)
Mutual labels:  actions
cov
An emacs extension for displaying coverage data on your code
Stars: ✭ 65 (+51.16%)
Mutual labels:  coverage
material-about
An about screen to use in your Mobile apps.
Stars: ✭ 37 (-13.95%)
Mutual labels:  actions
yaml-update-action
Update YAML property with dynamic values
Stars: ✭ 81 (+88.37%)
Mutual labels:  actions
code-coverage-action
GitHub Action that generates code coverage reports
Stars: ✭ 28 (-34.88%)
Mutual labels:  coverage
launchbar
Actions repository for LaunchBar 6
Stars: ✭ 65 (+51.16%)
Mutual labels:  actions
github-actions-watcher
A CLI tool to see the status of your all GitHub Actions workflows in real time
Stars: ✭ 111 (+158.14%)
Mutual labels:  actions
action-lgtm-reaction
GitHub Action to send LGTM reaction
Stars: ✭ 62 (+44.19%)
Mutual labels:  actions
winrar-keygen
Principle of WinRAR key generation.
Stars: ✭ 398 (+825.58%)
Mutual labels:  actions
juejin-actions
掘金每天自动签到 github actions 。组织了每周一起学习200行左右的【源码共读】活动,感兴趣可以加我微信 ruochuan12 参与。
Stars: ✭ 47 (+9.3%)
Mutual labels:  actions
action-homebrew-bump-formula
⚙️ A GitHub Action to easily bump Homebrew formula on new release
Stars: ✭ 68 (+58.14%)
Mutual labels:  actions
blanket
MOVED TO GITLAB
Stars: ✭ 16 (-62.79%)
Mutual labels:  coverage

Cobertura action

GitHub Action which parse a XML cobertura report and display the metrics in a GitHub Pull Request.

Many coverage tools can be configured to output cobertura reports:

This action will not currently work when triggered by pull requests from forks, like is common in open source projects. This is because the token for forked pull request workflows does not have write permissions on the target repository. Hopefully GitHub will have a solution for this in the future. In the meantime one can use utilize multiple workflows and artifacts to circumvent this. See the workflows in this project for an implementation example and this blog post https://securitylab.github.com/research/github-actions-preventing-pwn-requests.

How it looks like

A comment is added to the pull request with the coverage report.

alt text

A check is added to the workflow run.

alt text

The check will succeed or fail based on your threshold when fail_below_threshold is set to true, this allows you to mandate coverage checks pass on your protected branches.

Inputs

repo_token

The GITHUB_TOKEN. Defaults to ${{github.token}}

path

The path to the cobertura report. Defaults to coverage.xml. Glob pattern is supported, for example coverage/*.xml.

skip_covered

If files with 100% coverage should be ignored. Defaults to true.

minimum_coverage

The minimum allowed coverage percentage as an integer.

fail_below_threshold

Fail the action when the minimum coverage was not met.

show_line

Show line rate as specific column.

show_branch

Show branch rate as specific column.

show_class_names

Show class names instead of file names.

show_missing

Show line numbers of statements, per module, that weren't executed.

show_missing_max_length

Crop missing line numbers strings that exceeds this length, provided as an integer.

Default is no crop.

(Note: "…" is appended to a cropped string)

link_missing_lines

Link missing line numbers. This only has an effect when show_missing is set to true. Defaults to false.

link_missing_lines_source_dir

Allows specifying a source directory for link_missing_lines, that will be inserted into the resulting URLs, in-between the commit hash and the file path.

only_changed_files

Only show coverage for changed files.

report_name

Use a unique name for the report and comment.

pull_request_number Optional

Pull request number associated with the report. This property should be used when workflow trigger is different than pull_request.

If no pull request can determine the action will skip adding the comment.

Example usage

on:
  pull_request:
    types: [opened]
    branches:
      - master
jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: 5monkeys/cobertura-action@master
        with:
          path: src/test.xml
          minimum_coverage: 75

Development

  • Install deps: npm ci
  • Run tests: npm run test
  • Run lint: npm run lint
  • Package application npm run package. Remember to run this before committing anything.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].