Skip to content

Commit b4d7937

Browse files
fix(UX-1139): Prevent commiting coverage file; store previous coverage result as artifact (#25)
feat: Add `run-prev-coverage` flag chore: Add debug logs Release-as: 1.0.6
1 parent 6179244 commit b4d7937

File tree

16 files changed

+128698
-26989
lines changed

16 files changed

+128698
-26989
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,23 @@ jobs:
3535
| run-tests | Whether tests should be run. | false | true |
3636
| run-analysis | Whether static analysis should be run. | false | true |
3737
| run-coverage | Whether code coverage should be run. | false | true |
38+
| run-prev-coverage | Whether code coverage should be compared with the base branch. | false | true |
3839
| run-behind-by | Whether action should check if HEAD branch is behind base branch. | false | true |
3940
| create-comment | Whether the action should comment the output status. | false | true |
4041
| working-directory | Working directory to run the action in | false | "." |
4142
43+
## Coverage
44+
45+
⚠️ To compare coverage against previous code, it is required that the code is checked out with `fetch-depth: 0`:
46+
47+
```yaml
48+
- uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
```
52+
53+
> During the action, coverage will be calculated, and lcov.info will be saved in temporary directory `.coverage`. Please refrain from using a top level directory with this path, as this could cause issues.
54+
4255
## Contributing
4356

4457
This project welcomes contributions. Please check out our [Contributing guide](CONTRIBUTING.md) to learn more on how to get started.

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ inputs:
3333
default: true
3434
type: boolean
3535

36+
run-prev-coverage:
37+
description: "Run test coverage check on base branch"
38+
required: false
39+
default: true
40+
type: boolean
41+
3642
run-behind-by:
3743
description: "Run behind by check"
3844
required: false

dist/index.js

Lines changed: 126902 additions & 26822 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)