Skip to content

Commit ea467e4

Browse files
Add code coverage
1 parent 2ac1b05 commit ea467e4

File tree

13 files changed

+60
-19
lines changed

13 files changed

+60
-19
lines changed

.codecov.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
1-
# https://docs.codecov.io/docs/codecov-yaml
2-
# https://github.com/codecov/support/wiki/Codecov-Yaml
3-
41
coverage:
52
status:
63
project:
74
default: false
85
patch:
96
default: false
10-
fixes:
11-
- "build/StyleCop.Analyzers/::StyleCop.Analyzers/"
12-
13-
comment:
14-
layout: "diff"
15-
16-
flags:
17-
production:
18-
paths:
19-
- StyleCop.Analyzers/StyleCop.Analyzers/
20-
- StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/
21-
test:
22-
paths:
23-
- StyleCop.Analyzers/StyleCop.Analyzers.Test/
24-
- StyleCop.Analyzers/StyleCopTester/

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ jobs:
3131
uses: actions/setup-dotnet@v5
3232

3333
- name: Build & Test
34-
run: dotnet test StyleCop.Analyzers/StyleCop.Analyzers.${{matrix.test}}/StyleCop.Analyzers.${{matrix.test}}.csproj -c ${{matrix.configuration}} --verbosity normal
34+
run: dotnet test StyleCop.Analyzers/StyleCop.Analyzers.${{matrix.test}}/StyleCop.Analyzers.${{matrix.test}}.csproj -c ${{matrix.configuration}} --settings runsettings.xml --collect:"XPlat Code Coverage" --verbosity normal
35+
36+
- name: Upload coverage
37+
uses: codecov/codecov-action@v5
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/StyleCop.Analyzers.Test.CSharp10.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/StyleCop.Analyzers.Test.CSharp11.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
1721
<PackageReference Include="Moq" Version="4.20.70" />
1822
<PackageReference Include="xunit" Version="2.4.1" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp12/StyleCop.Analyzers.Test.CSharp12.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp13/StyleCop.Analyzers.Test.CSharp13.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp14/StyleCop.Analyzers.Test.CSharp14.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0-2.final" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/StyleCop.Analyzers.Test.CSharp7.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.8.2" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/StyleCop.Analyzers.Test.CSharp8.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.6.0" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/StyleCop.Analyzers.Test.CSharp9.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1620
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.8.0" />
1721
<PackageReference Include="xunit" Version="2.4.1" />
1822
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />

0 commit comments

Comments
 (0)