You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/github_action.md
+51-8Lines changed: 51 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,16 @@
3
3
The `go-test-coverage` GitHub Action provides the following capabilities:
4
4
- Enforce success of GitHub workflows only when a specified coverage threshold is met.
5
5
- Generate a coverage badge to display the total test coverage.
6
-
- Post a detailed coverage report as a comment on pull requests.
6
+
- Post a detailed coverage report as a comment on pull requests, including:
7
+
- current test coverage
8
+
- the difference compared to the base branch
9
+
10
+
## Action Inputs and Outputs
11
+
12
+
Action inputs and outputs are documented in [action.yml](/action.yml) file.
7
13
8
-
9
-
## Usage
14
+
15
+
## Basic Usage
10
16
11
17
Here’s an example of how to integrate `go-test-coverage` in a GitHub workflow that uses a config file. This is the preferred way because the same config file can be used for running coverage checks locally.
12
18
@@ -32,10 +38,6 @@ Alternatively, if you don't need advanced configuration options from a config fi
32
38
33
39
Note: When using a config file alongside action properties, specifying these parameters will override the corresponding values in the config file.
34
40
35
-
## Action Inputs and Outputs
36
-
37
-
Action inputs and outputs are documented in [action.yml](/action.yml) file.
38
-
39
41
## Liberal Coverage Check
40
42
41
43
The `go-test-coverage` GitHub Action can be configured to report the current test coverage without enforcing specific thresholds. To enable this functionality in your GitHub workflow, include the `continue-on-error: true` property in the job step configuration. This ensures that the workflow proceeds even if the coverage check fails.
@@ -51,9 +53,50 @@ Below is an example that reports files with coverage below 80% without causing t
51
53
threshold-file: 80
52
54
```
53
55
56
+
## Report Coverage Difference
57
+
58
+
Using go-test-coverage, you can display a detailed comparison of code coverage changes relative to the base branch. When this feature is enabled, the report highlights files with coverage differences compared to the base branch.
59
+
60
+
The same logic is used in workflow in [this repo](/.github/workflows/test.yml).
path: main.breakdown # as specified via `breakdown-file-name`
92
+
if-no-files-found: error
93
+
```
94
+
54
95
## Post Coverage Report to PR
55
96
56
-
Here is an example of how to post comments with the coverage report to your pull request. The same logic is used in workflow in [this repo](/.github/workflows/test.yml).
97
+
Here is an example of how to post comments with the coverage report to your pull request.
98
+
99
+
The same logic is used in workflow in [this repo](/.github/workflows/test.yml).
0 commit comments