Skip to content

Commit

Permalink
Merge pull request #20 from im-open/adding-tests
Browse files Browse the repository at this point in the history
ARCH-2011 - Adding tests
  • Loading branch information
danielle-casella-adams authored Mar 7, 2024
2 parents e955fe6 + 34cb508 commit 32ecc07
Show file tree
Hide file tree
Showing 34 changed files with 3,380 additions and 211 deletions.
976 changes: 976 additions & 0 deletions .github/workflows/build-and-review-pr.yml

Large diffs are not rendered by default.

71 changes: 45 additions & 26 deletions README.md

Large diffs are not rendered by default.

51 changes: 37 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: GitHub Action that can create a status check or PR comment based on

inputs:
github-token:
description: 'The GitHub token for interacting with the repository.'
description: 'Token used to interact with the repository. Generally `secrets.GITHUB_TOKEN.`'
required: true
summary-file:
description: 'The summary file generated by the report-generator action.'
Expand All @@ -12,46 +12,69 @@ inputs:
description: 'The desired name of the report that is shown on the PR Comment and inside the Status Check.'
required: true
default: Code Coverage Results
check-name:
description: 'The desired name of the status check.'
required: true
default: code coverage
create-status-check:
description: 'Flag indicating whether a status check with code coverage results should be generated.'
required: true
default: 'true'
check-name:
description: |
The desired name of the status check.
*Only applicable when `create-status-check` is true.*
required: true
default: code coverage
create-pr-comment:
description: 'Flag indicating whether a PR comment with code coverage results should be generated. When `true` the default behavior is to update an existing comment if one exists.'
required: true
default: 'true'
update-comment-if-one-exists:
description: 'When `create-pr-comment` is true, this flag determines whether a new comment is created or if the action updates an existing comment if one is found which is the default behavior.'
description: |
This flag determines whether a new comment is created or if the action updates an existing comment (*if one is found*).
*Only applicable when `create-pr-comment` is true.*
required: true
default: 'true'
update-comment-key:
description: |
A simple alphanumeric string like *dotnet* or *jest* used to further identify the PR comment to update when this action is used more than once in a workflow.
Only used when `update-comment-if-one-exists` is set to true.
Each instance of the action should have a different key.
This value should be static so it remains the same each time the workflow is run.
A unique identifier which will be added to the generated markdown as a comment (*it will not be visible in the PR comment*).
This identifier enables creating then updating separate results comments on the PR if more than one instance of this action is included in a single job.
This can be helpful when there are multiple coverage projects that run separately but are part of the same job.
Each instance of the action should have a different key and this value should be static so it remains the same each time the workflow is run.
Defaults to GITHUB_JOB_GITHUB_ACTION if not provided.
*Only applicable when `create-pr-comment` and `update-comment-if-one-exists` are `true`.*
required: false
ignore-threshold-failures:
description: 'When set to true the check status is set to Neutral when the code coverage percentage is below the specified threshold and it will not block pull requests.'
description: |
If the coverage falls below the threshold and this is set to `true` the status check's conclusion will be set to `neutral`
and the `coverage-outcome` output will be set to `Passed`.
This is useful if you want coverage reported but do not want a failing status check to block pull requests.
required: false
default: 'false'
line-threshold:
description: 'Threshold for line coverage. The status check/comment will be marked as a failure if the actual line coverage amount is less than this. Set to 0 if you do not want thresholds to be applied.'
description: |
Minimum threshold for line coverage.
The status check conclusion will be `failure `and `coverage-outcome` will be `Failed` if the actual coverage amount is less than this.
Set to `0` to disable line coverage checks. When `0`, the status check will always be `neutral` and the `coverage-outcome` will be `Passed`.
required: false
default: '0'
branch-threshold:
description: 'Threshold for branch coverage. The status check/comment will be marked as a failure if the actual branch coverage amount is less than this. Set to 0 if you do not want thresholds to be applied.'
description: |
Minimum threshold for branch coverage.
The status check conclusion will be `failure `and `coverage-outcome` will be `Failed` if the actual coverage amount is less than this.
Set to 0 if you do not want thresholds to be applied.
required: false
default: '0'

outputs:
coverage-outcome:
description: 'Coverage outcome based on Threshold comparisons: Failed|Passed. If exceptions are thrown or if it exits early because of argument errors, this is set to Failed.'
coverage-results-truncated:
description: 'Flag indicating whether coverage results were truncated due to markdown exceeding character limit of 65535.'
coverage-results-file-path:
description: 'File path for the file that contains the coverage results in markdown format. This is the same output that is posted in the PR comment.'
status-check-id:
description: 'The ID of the Status Check that was created. This is only set if `create-status-check` is `true` and a status check was created successfully.'
pr-comment-id:
description: 'The ID of the PR comment that was created. This is only set if `create-pr-comment` is `true` and a PR was created successfully.'

runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
Loading

0 comments on commit 32ecc07

Please sign in to comment.