Skip to content

Commit 33be815

Browse files
committed
Try to exclude generated files
1 parent 9a5aad5 commit 33be815

3 files changed

Lines changed: 40 additions & 14 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: 'Test'
6868
id: test
69-
run: dotnet test --no-build --restore --collect:"XPlat Code Coverage" --logger junit
69+
run: dotnet test --no-build --restore --collect:"XPlat Code Coverage" --logger junit --settings .runsettings
7070

7171
- name: 'List current directory'
7272
shell: pwsh
@@ -93,6 +93,15 @@ jobs:
9393
path: "test/**/TestResults.xml"
9494
retention-days: 5
9595

96+
- name: Upload Code Coverage Results
97+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
98+
with:
99+
name: coverage-results
100+
path: |
101+
${{ env.COVERAGE_REPORT }}
102+
test/**/coverage.cobertura.xml
103+
retention-days: 5
104+
96105
- name: 'Generate Coverage Reports'
97106
uses: danielpalme/ReportGenerator-GitHub-Action@82ef2bc4c83f42bbeec82a5cd9a8e3f6156b64b9 # 5.4.9
98107
with:
@@ -105,19 +114,6 @@ jobs:
105114
toolpath: "reportgeneratortool"
106115
license: ${{ secrets.REPORT_GENERATOR_LICENSE }}
107116

108-
- name: Upload Code Coverage Results
109-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
110-
with:
111-
name: coverage-results
112-
path: |
113-
${{ env.COVERAGE_REPORT }}
114-
test/**/coverage.cobertura.xml
115-
retention-days: 5
116-
117-
- name: Add coverage to build summary
118-
shell: bash
119-
run: cat ${COVERAGE_REPORT}/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
120-
121117
- name: Publish Code Coverage Report
122118
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
123119
with:
@@ -130,3 +126,7 @@ jobs:
130126
indicators: true
131127
output: both
132128
thresholds: "10 30"
129+
130+
- name: Add coverage to build summary
131+
shell: bash
132+
run: cat ${COVERAGE_REPORT}/SummaryGithub.md >> $GITHUB_STEP_SUMMARY

.runsettings

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- File name extension must be .runsettings -->
3+
<RunSettings>
4+
<DataCollectionRunSettings>
5+
<DataCollectors>
6+
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
7+
<Configuration>
8+
<Format>coverage</Format>
9+
<CodeCoverage>
10+
<Attributes>
11+
<Exclude>
12+
<!-- Don't forget "Attribute" at the end of the name -->
13+
<Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>
14+
<Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>
15+
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
16+
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
17+
</Exclude>
18+
</Attributes>
19+
<IncludeTestAssembly>False</IncludeTestAssembly>
20+
</CodeCoverage>
21+
</Configuration>
22+
</DataCollector>
23+
</DataCollectors>
24+
</DataCollectionRunSettings>
25+
</RunSettings>

idunno.Bluesky.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
66
ProjectSection(SolutionItems) = preProject
77
.editorconfig = .editorconfig
88
.gitignore = .gitignore
9+
.runsettings = .runsettings
910
.vsconfig = .vsconfig
1011
architectureNotes.md = architectureNotes.md
1112
buildDocs.ps1 = buildDocs.ps1

0 commit comments

Comments
 (0)