Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

An automatic enforcement of a coverage percentage from a PHPUnit Clover report.

License

Notifications You must be signed in to change notification settings

sourcetoad/phpunit-coverage-action

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sourcetoad - PHPUnit Code Coverage

Automate pass/fail of a code coverage report based on a minimum percent.

Usage

Inputs

Following inputs can be used as step.with keys

Name Required Type Description
clover_report_path Yes String Path to clover report.
min_coverage_percent Yes Number Minimum expected coverage percent.
fail_build_on_under Yes Boolean Whether to fail the build if coverage too low.
  • clover_report_path is in context to project root.

Outputs

Name Description
coverage_percent Code coverage percent

Example usage

- name: Code Coverage Check
  uses: sourcetoad/phpunit-coverage-action@v1
  with:
      clover_report_path: output.xml
      min_coverage_percent: 80
      fail_build_on_under: true

Testing

  • This action is actively tested with itself.
  • The sample folder contains a very basic PHP application with testing.
  • The .github/workflows talks to the exact copy of the action on that run.
  • It runs the sample application through the workflow twice with an intentional pass/fail option.

About

An automatic enforcement of a coverage percentage from a PHPUnit Clover report.

Resources

License

Stars

Watchers

Forks