Skip to content

Commit 554a219

Browse files
Update README (#7)
* Update README * Update README and codeowners * Update README * Update README.md Co-authored-by: John Hannagan <weetbix_@hotmail.com> * Update README.md Co-authored-by: John Hannagan <weetbix_@hotmail.com> * Update README.md Co-authored-by: John Hannagan <weetbix_@hotmail.com> * Update README.md Co-authored-by: John Hannagan <weetbix_@hotmail.com> Co-authored-by: John Hannagan <weetbix_@hotmail.com>
1 parent 395c94d commit 554a219

7 files changed

Lines changed: 78 additions & 22 deletions

File tree

.github/workflows/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @eeshdarthvader @Weetbix @marinakalyuzhnaya

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
package.json
3+
.eslintrc.json
4+
.github/
5+
README.md
6+
yarn.lock

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
MIT License
3+
4+
Copyright (c) 2019 GitHub Actions
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,71 @@
1-
# Jest reporter action
1+
# Code Coverage Assistant
2+
[![CI](https://github.com/peter-evans/create-pull-request/workflows/CI/badge.svg)](https://github.com/ScaCap/code-coverage-assistant/actions?query=workflow%3ACI)
23

3-
This action comments a pull request with a HTML test coverage report.
4+
> [GitHub Action](https://help.github.com/en/actions) to assist the pull request with code coverage stats
5+
-&nbsp;Code coverage comment for monorepo
6+
-&nbsp;Code coverage comment for single repo
7+
-&nbsp;Code coverage diff from base branch
48

59
The report is based on the lcov coverage report generated by your test runner.
610

7-
Note that this action does not run any tests, but instead expects the tests to have been run
8-
by another action already.
11+
## Usage
912

10-
## Example output
13+
Just add this action to one of your [workflow files](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow):
1114

12-
Total Coverage: <b>99.39%</b>
15+
```yml
16+
- name: Add coverage comment
17+
uses: ScaCap/code-coverage-assistant@v1
18+
```
1319
14-
<details><summary>Coverage Report</summary><table><tbody><tr><th>File</th><th>Branches</th><th>Funcs</th><th>Lines</th><th>Uncovered Lines</th></tr><tr><td colspan='5'><b>src</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/i18n.tsx'>i18n.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/i18n</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/i18n/context.tsx'>context.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/i18n/hydrate.tsx'>hydrate.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/i18n/index.tsx'>index.tsx</a></td><td><b>85.71%</b></td><td><b>88.89%</b></td><td>100%</td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/i18n/index.tsx#L54'>54</a></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/i18n/link.tsx'>link.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/icon</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/icon/index.tsx'>index.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/icon/props.tsx'>props.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/layout</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/layout/index.tsx'>index.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/release-artist-link</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-artist-link/index.tsx'>index.tsx</a></td><td><b>66.67%</b></td><td>100%</td><td>100%</td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-artist-link/index.tsx#L24'>24</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-artist-link/index.tsx#L25'>25</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-artist-link/index.tsx#L26'>26</a></td></tr><tr><td colspan='5'><b>src/components/release-companies</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-companies/index.tsx'>index.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/release-credits</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-credits/index.tsx'>index.tsx</a></td><td><b>85.71%</b></td><td>100%</td><td><b>91.30%</b></td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-credits/index.tsx#L37'>37</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-credits/index.tsx#L38'>38</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-credits/index.tsx#L40'>40</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-credits/index.tsx#L43'>43</a></td></tr><tr><td colspan='5'><b>src/components/release-format-link</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-format-link/index.tsx'>index.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/release-header</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-header/index.tsx'>index.tsx</a></td><td><b>58.33%</b></td><td>100%</td><td>100%</td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-header/index.tsx#L79'>79</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-header/index.tsx#L80'>80</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-header/index.tsx#L82'>82</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-header/index.tsx#L85'>85</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-header/index.tsx#L86'>86</a></td></tr><tr><td colspan='5'><b>src/components/release-label-link</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-label-link/index.tsx'>index.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/components/release-series-link</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-series-link/index.tsx'>index.tsx</a></td><td><b>0%</b></td><td>100%</td><td>100%</td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-series-link/index.tsx#L19'>19</a></td></tr><tr><td colspan='5'><b>src/components/release-thumbnail</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-thumbnail/icon.tsx'>icon.tsx</a></td><td><b>50%</b></td><td>100%</td><td><b>83.33%</b></td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-thumbnail/icon.tsx#L26'>26</a>, <a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-thumbnail/icon.tsx#L30'>30</a></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-thumbnail/index.tsx'>index.tsx</a></td><td><b>75%</b></td><td>100%</td><td>100%</td><td><a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/release-thumbnail/index.tsx#L42'>42</a></td></tr><tr><td colspan='5'><b>src/components/search</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/search/index.tsx'>index.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/search/mock.tsx'>mock.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/components/search/ui.tsx'>ui.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/lib</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/lib/add-state.tsx'>add-state.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/lib/intersperse.tsx'>intersperse.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/lib/keycodes.tsx'>keycodes.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/lib/slug.tsx'>slug.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr><tr><td colspan='5'><b>src/services</b></td></tr><tr><td>&nbsp; &nbsp;<a href='https://github.com/example/foo/blob/f9d42291812ed03bb197e48050ac38ac6befe4e5/src/services/autocomplete.tsx'>autocomplete.tsx</a></td><td>100%</td><td>100%</td><td>100%</td><td></td></tr></tbody></table></details>
1520
16-
## Inputs
21+
### Action inputs
1722
18-
##### `github-token` (**Required**)
23+
The possible inputs for this action are:
1924
20-
Github token used for posting the comment. To use the key provided by the GitHub
21-
action runner, use `${{ secrets.GITHUB_TOKEN }}`.
25+
| Parameter | Description | Default |
26+
| --------- | ----------- | ------- |
27+
| `github-token` (**Required**) | Github token used for posting the comment. To use the key provided by the GitHub action runner, use `${{ secrets.GITHUB_TOKEN }}`. | |
28+
| `monorepo-base-path` (**Optional**) | The location of your monrepo `packages` path| |
29+
| `lcov-file` (**Optional**) | The location of the lcov file to read the coverage report. `Needed only for single repos` | `./coverage/lcov.info` |
30+
| `lcov-base` (**Optional**) | The location of the lcov file resulting from running the tests in the base branch. When this is set a diff of the coverage percentages is shown. `Needed only for single repos`.| |
2231

23-
##### `lcov-file` (**Optional**)
32+
## Examples
2433

25-
The location of the lcov file to read the coverage report from. Defaults to
26-
`./coverage/lcov.info`.
34+
### Code coverage comment for monorepo
2735

28-
##### `lcov-base` (**Optional**)
36+
```yml
37+
uses: ScaCap/code-coverage-assistant@v1
38+
with:
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
monorepo-base-path: './packages'
41+
```
2942

30-
The location of the lcov file resulting from running the tests in the base
31-
branch. When this is set a diff of the coverage percentages is shown.
43+
![](/assets/example_monorepo.png)
3244

33-
##### `monorepo-base` (**Optional**)
45+
### Code coverage comment for single repo
3446

35-
The location of the monrepo `packages` path
47+
```yml
48+
uses: ScaCap/code-coverage-assistant@v1
49+
with:
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
lcov-file: './app/coverage/lcov.info'
52+
```
53+
54+
![](/assets/example_single_repo.png)
55+
56+
### Code coverage comment with diff
3657

37-
## Example usage
58+
⚠️ &nbsp;Note: This config expects a `lcov-base.info` coverage file for base branch in your `.coverage` dir
3859

3960
```yml
40-
uses: romeovs/lcov-reporter-action@v0.2.16
61+
uses: ScaCap/code-coverage-assistant@v1
4162
with:
4263
github-token: ${{ secrets.GITHUB_TOKEN }}
43-
lcov-file: ./coverage/lcov.info
64+
monorepo-base-path: './packages'
4465
```
4566

67+
![](/assets/example_diff.png)
68+
4669
## Acknowledgements
4770

4871
The initial code is based on [romeovs/lcov-reporter-action](https://github.com/romeovs/lcov-reporter-action).
@@ -51,3 +74,7 @@ Thanks to:
5174

5275
- [ziishaned/jest-reporter-action](https://github.com/ziishaned/jest-reporter-action)
5376
- [slavcodev/coverage-monitor-action](https://github.com/slavcodev/coverage-monitor-action)
77+
78+
## License
79+
80+
[MIT](LICENSE)

assets/example_diff.png

26.5 KB
Loading

assets/example_monorepo.png

40.8 KB
Loading

assets/example_single_repo.png

24.7 KB
Loading

0 commit comments

Comments
 (0)