Skip to content

Commit 4a07a93

Browse files
Merge pull request #8 from im-open/adding-tests
ARCH-2011 - Adding tests
2 parents fb63da2 + e9a9354 commit 4a07a93

22 files changed

+5730
-4549
lines changed

.github/workflows/build-and-review-pr.yml

Lines changed: 424 additions & 0 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ lib/
33
node_modules
44
/.vscode/launch.json
55
reportgeneratortool
6-
src/*.js
6+
test-results/

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ReportGenerator
22

3-
This action is based on [danielpalme/ReportGenerator-GitHub-Action].
3+
This action is a simplied version of [danielpalme/ReportGenerator-GitHub-Action]. It functions as a wrapper for the [dotnet-reportgenerator-globaltool].
44

55
[ReportGenerator] converts coverage reports generated by OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
66

@@ -10,7 +10,10 @@ This action does not generate the code coverage reports itself, those must be cr
1010

1111
- [ReportGenerator](#reportgenerator)
1212
- [Inputs](#inputs)
13+
- [Outputs](#outputs)
1314
- [Usage Examples](#usage-examples)
15+
- [Breaking changes](#breaking-changes)
16+
- [4.9.2 to v5.0.0](#492-to-v500)
1417
- [Contributing](#contributing)
1518
- [Incrementing the Version](#incrementing-the-version)
1619
- [Source Code Changes](#source-code-changes)
@@ -26,51 +29,48 @@ This action does not generate the code coverage reports itself, those must be cr
2629
| `reports` | false | */**/coverage.opencover.xml | The coverage reports that should be parsed (separated by semicolon). Globbing is supported. |
2730
| `targetdir` | false | coverage-results | The directory where the generated report should be saved. |
2831
| `reporttypes` | false | Html;MarkdownSummary; | The output formats and scope (separated by semicolon)<br/>Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary |
29-
| `sourcedirs` | false | '' | Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information. |
30-
| `historydir` | false | '' | Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution. |
31-
| `plugins` | false | '' | Optional plugin files for custom reports or custom history storage (separated by semicolon). |
3232
| `assemblyfilters` | false | +* | Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
3333
| `classfilters` | false | +* | Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
3434
| `filefilters` | false | +* | Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
3535
| `verbosity` | false | Info | The verbosity level of the log messages. <br/>Values: Verbose, Info, Warning, Error, Off |
3636
| `title` | false | '' | Optional title. |
3737
| `tag` | false | ${{ github.run_number }}_${{ github.run_id }} | Optional tag or build version. |
38-
| `customSettings` | false | '' | Optional custom settings (separated by semicolon). See [Settings]. |
39-
| `toolpath` | false | reportgeneratortool | Default directory for installing the dotnet tool. |
38+
39+
## Outputs
40+
41+
| Output | Description |
42+
|----------------|----------------------------------------------------------|
43+
| `error-reason` | If there are failures, a brief description of the error. |
4044

4145
## Usage Examples
4246

4347
```yml
4448
- name: Setup .NET Core # Required to execute ReportGenerator
4549
uses: actions/setup-dotnet@v1
4650
with:
47-
dotnet-version: 5.0.301
51+
dotnet-version: 8.x # Needs to be 5.0 or higher
4852

4953
- name: dotnet test with coverage
5054
continue-on-error: true
5155
run: dotnet test ${{ env.SOLUTION }} --no-restore --logger trx --configuration Release /property:CollectCoverage=True /property:CoverletOutputFormat=opencover
5256

5357
- name: ReportGenerator
5458
# You may also reference the major or major.minor version
55-
uses: im-open/code-coverage-report-generator@4.9.2
59+
uses: im-open/code-coverage-report-generator@v5.0.0
5660
with:
5761
reports: '*/**/coverage.opencover.xml'
5862
targetdir: ${{ env.CODE_COVERAGE_DIR }}'
5963
reporttypes: 'Html;MarkdownSummary'
60-
sourcedirs: ''
61-
historydir: ''
62-
plugins: ''
6364
assemblyfilters: '-xunit*;-Dapper;'
6465
classfilters: '+*'
6566
filefilters: '-Startup.cs;-Program.cs;-*.cshtml'
6667
verbosity: 'Warning'
6768
title: ${{ env.CODE_COVERAGE_REPORT_NAME }}
6869
tag: '${{ github.workflow}}_${{ github.run_id }}'
69-
customSettings: ''
70-
toolpath: 'reportgeneratortool'
70+
7171

7272
- name: Upload coverage report artifact
73-
uses: actions/upload-artifact@v2.2.3
73+
uses: actions/upload-artifact@v4
7474
with:
7575
name: Coverage Report
7676
path: ${{ env.CODE_COVERAGE_DIR }}
@@ -84,6 +84,19 @@ This action does not generate the code coverage reports itself, those must be cr
8484
create-status-check: false
8585
```
8686
87+
## Breaking changes
88+
89+
### 4.9.2 to v5.0.0
90+
91+
- The `toolpath` input was removed since it was underutilized. `v5` and above will check for the presence of the tool in the `./reportgeneratortool` directory, which was the default location in prior versions. If that directory does not exist, the tool will be installed with `v4.8.12`. If desired, a different version of the global tool can be installed in this location prior to this action but different versions of the report generator tool may or may not be compatible with this action's code.
92+
- The `4.8.12` version of the tool is older but will continue to be used to preserve metrics in the generated reports that newer versions no longer produce.
93+
- The following inputs were not utilized and have been removed completely from the action starting with `v5`.
94+
- `sourcedirs`
95+
- `historydir`
96+
- `plugins`
97+
- `customSettings`
98+
- Previously, each version of the action had two tags, one with the `v` prefix and one without it. There will only be one tag per version going forward and it includes the `v` prefix.
99+
87100
## Contributing
88101

89102
When creating PRs, please review the following guidelines:
@@ -132,7 +145,7 @@ This project has adopted the [im-open's Code of Conduct](https://github.com/im-o
132145

133146
## License
134147

135-
Copyright &copy; 2023, Extend Health, LLC. Code released under the [MIT license](LICENSE).
148+
Copyright &copy; 2024, Extend Health, LLC. Code released under the [MIT license](LICENSE).
136149

137150
<!-- Links -->
138151
[Incrementing the Version]: #incrementing-the-version
@@ -144,6 +157,4 @@ Copyright &copy; 2023, Extend Health, LLC. Code released under the [MIT license]
144157
[increment-version-on-merge]: ./.github/workflows/increment-version-on-merge.yml
145158
[esbuild]: https://esbuild.github.io/getting-started/#bundling-for-node
146159
[git-version-lite]: https://github.com/im-open/git-version-lite
147-
[danielpalme/ReportGenerator-GitHub-Action]: https://github.com/danielpalme/ReportGenerator-GitHub-Action
148-
[ReportGenerator]: https://github.com/danielpalme/ReportGenerator
149-
[Settings]: https://github.com/danielpalme/ReportGenerator/wiki/Settings
160+
[dotnet-reportgenerator-globaltool]: https://www.nuget.org/packages/dotnet-reportgenerator-globaltool

action.yml

Lines changed: 50 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,50 @@
1-
name: 'code-coverage-report-generator'
2-
description: 'Creates coverage reports from tools like OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov'
3-
inputs:
4-
reports:
5-
description: 'The coverage reports that should be parsed (separated by semicolon). Globbing is supported.'
6-
required: true
7-
default: '*/**/coverage.opencover.xml'
8-
targetdir:
9-
description: 'The directory where the generated report should be saved.'
10-
required: true
11-
default: 'coverage-results'
12-
reporttypes:
13-
description: 'The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary'
14-
required: false
15-
default: 'Html;MarkdownSummary'
16-
sourcedirs:
17-
description: 'Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.'
18-
required: false
19-
default: ''
20-
historydir:
21-
description: 'Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution.'
22-
required: false
23-
default: ''
24-
toolpath:
25-
description: 'Default directory for installing the dotnet tool.'
26-
required: false
27-
default: 'reportgeneratortool'
28-
plugins:
29-
description: 'Optional plugin files for custom reports or custom history storage (separated by semicolon).'
30-
required: false
31-
default: ''
32-
assemblyfilters:
33-
description: 'Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.'
34-
required: false
35-
default: '+*'
36-
classfilters:
37-
description: 'Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.'
38-
required: false
39-
default: '+*'
40-
filefilters:
41-
description: 'Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.'
42-
required: false
43-
default: '+*'
44-
verbosity:
45-
description: 'The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off'
46-
required: false
47-
default: 'Info'
48-
title:
49-
description: 'Optional title.'
50-
required: false
51-
default: ''
52-
tag:
53-
description: 'Optional tag or build version.'
54-
required: false
55-
default: '${{ github.run_number }}_${{ github.run_id }}'
56-
customSettings:
57-
description: 'Optional custom settings (separated by semicolon). See: https://github.com/danielpalme/ReportGenerator/wiki/Settings'
58-
required: false
59-
default: ''
60-
runs:
61-
using: 'node16'
62-
main: 'dist/index.js'
63-
branding:
64-
icon: 'bar-chart-2'
65-
color: 'green'
1+
name: 'code-coverage-report-generator'
2+
description: 'Creates coverage reports from tools like OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov'
3+
inputs:
4+
reports:
5+
description: 'The coverage reports that should be parsed (separated by semicolon). Globbing is supported.'
6+
required: true
7+
default: '*/**/coverage.opencover.xml'
8+
targetdir:
9+
description: 'The directory where the generated report should be saved.'
10+
required: true
11+
default: 'coverage-results'
12+
reporttypes:
13+
description: 'The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary'
14+
required: false
15+
default: 'Html;MarkdownSummary'
16+
assemblyfilters:
17+
description: 'Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.'
18+
required: false
19+
default: '+*'
20+
classfilters:
21+
description: 'Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.'
22+
required: false
23+
default: '+*'
24+
filefilters:
25+
description: 'Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.'
26+
required: false
27+
default: '+*'
28+
verbosity:
29+
description: 'The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off'
30+
required: false
31+
default: 'Info'
32+
title:
33+
description: 'Optional title.'
34+
required: false
35+
default: ''
36+
tag:
37+
description: 'Optional tag or build version.'
38+
required: false
39+
default: '${{ github.run_number }}_${{ github.run_id }}'
40+
41+
outputs:
42+
error-reason:
43+
description: 'If there are failures, a brief description of the error.'
44+
runs:
45+
using: 'node20'
46+
main: 'dist/index.js'
47+
48+
branding:
49+
icon: 'bar-chart-2'
50+
color: 'green'

0 commit comments

Comments
 (0)