Skip to content

Commit cc418c5

Browse files
alestiagoScarlett Eliza
andauthored
docs: update README.md inputs and FAQ (#236)
* docs: updated README.md * chore: updated table * docs: typos * docs: updated quotes * docs: updated tense * docs: Apply suggestions from code review Co-authored-by: Scarlett Eliza <[email protected]> * Update README.md * docs: added "value" * docs: updated table --------- Co-authored-by: Scarlett Eliza <[email protected]>
1 parent c50a398 commit cc418c5

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

README.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,53 @@ A GitHub Action which helps enforce a minimum code coverage threshold.
1414

1515
## Inputs
1616

17-
### `path`
17+
Very Good Coverage accepts the following configuration inputs:
1818

19-
**Optional** The path to the `lcov.info` file.
19+
| Input name | Description | Default value | Optional |
20+
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- |
21+
| path | The path to the lcov.info file. | `"./coverage/lcov.info"` ||
22+
| min_coverage | The minimum coverage percentage allowed. | `100` ||
23+
| exclude | List of paths to exclude from the coverage report, separated by an empty space. Supports [globs]() to describe file patterns. | `""` ||
2024

21-
**Default** `./coverage/lcov.info`
22-
23-
### `min_coverage`
25+
## Example usage
2426

25-
**Optional** The minimum coverage percentage allowed.
27+
```yaml
28+
uses: VeryGoodOpenSource/very_good_coverage@v2
29+
with:
30+
path: './coverage/lcov.info'
31+
min_coverage: 95
32+
exclude: '**/*_observer.dart **/change.dart'
33+
```
2634
27-
**Default** 100
35+
## FAQs
2836
29-
### `exclude`
37+
#### How can I avoid Very Good Coverage reporting an empty or non-existent coverage file?
3038
31-
**Optional** List of paths to exclude from the coverage report, separated by an empty space. Supports `globs` to describe file patterns.
39+
[Relevant issue](https://github.com/VeryGoodOpenSource/very_good_coverage/issues/167)
3240
33-
## Example usage
41+
A failure for non-existent coverage file can be resolved by setting the path input to match the location of the already generated lcov file.
3442
3543
```yaml
3644
uses: VeryGoodOpenSource/very_good_coverage@v2
3745
with:
38-
path: './coverage/lcov.info'
39-
min_coverage: 95
40-
exclude: '**/*_observer.dart **/change.dart'
46+
path: 'my_project/coverage/lcov.info'
47+
```
48+
49+
If your generated lcov file is empty this might be because you have no test files or your tests are not generating any coverage data.
50+
51+
If you wish to always bypass these warnings, we recommend using a conditional statement in your workflow to avoid running the Very Good Coverage action when the lcov file is empty or non-existent.
52+
53+
For example, if your non-existent or empty coverage file is meant to be located at `./coverage/lcov.info` you may do:
54+
55+
```yaml
56+
- name: Check for existing and non-empty coverage file
57+
id: test_coverage_file
58+
run: if [ -s "./coverage/lcov.info" ]; then echo "result=true" >> $GITHUB_OUTPUT ; else echo "result=false" >> $GITHUB_OUTPUT; fi
59+
- name: Very Good Coverage
60+
if: steps.test_coverage_file.outputs.result == 'true'
61+
uses: VeryGoodOpenSource/very_good_coverage@v2
62+
with:
63+
path: './coverage/lcov.info'
4164
```
4265

4366
[ci_badge]: https://github.com/VeryGoodOpenSource/very_good_coverage/workflows/ci/badge.svg

0 commit comments

Comments
 (0)