Skip to content

Commit

Permalink
Hopefully adding code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
grofit committed Jan 3, 2025
1 parent 5d0ba05 commit 213f24c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ jobs:
- name: Build
run: dotnet build --configuration Release -p:Version=${{ env.BuildVersion }} ${{ env.SolutionFile }}
- name: Test
run: dotnet test --configuration Release --no-build ${{ env.SolutionFile }} --logger trx
run: dotnet test --configuration Release --no-build ${{ env.SolutionFile }} --logger trx --collect:"XPlat Code Coverage"
- name: Test Report
uses: dorny/test-reporter@v1
with:
name: Unit Tests
path: "**/*.trx"
reporter: dotnet-trx
reporter: dotnet-trx
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: '**/coverage.cobertura.xml'
badge: true
format: 'markdown'
output: 'both'
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ There is a book available which covers the main parts which can be found here:

This can all be found within the [docs here](./docs/others/third-party-content.md)

[build-status-image]: https://ci.appveyor.com/api/projects/status/6incybkqawq9qe7u?svg=true
[build-status-url]: https://ci.appveyor.com/project/grofit/systemsrx/branch/main
[nuget-image]: https://img.shields.io/nuget/v/systemsrx.svg
[build-status-image]: https://github.com/EcsRx/EcsR3/actions/workflows/build-and-test.yml/badge.svg?branch=main
[build-status-url]: https://github.com/EcsRx/EcsR3/actions/workflows/build-and-test.yml
[nuget-image]: https://img.shields.io/nuget/v/EcsR3.svg
[nuget-url]: https://www.nuget.org/packages/EcsR3/
[discord-image]: https://img.shields.io/discord/488609938399297536.svg
[discord-url]: https://discord.gg/bS2rnGz
Expand All @@ -153,4 +153,7 @@ This can all be found within the [docs here](./docs/others/third-party-content.m
[codacy-image]: https://app.codacy.com/project/badge/Grade/eb08368251df43c98aa55a8cbb8d5577
[codacy-url]: https://www.codacy.com/gh/EcsRx/SystemsRx/dashboard?utm_source=github.com&utm_medium=referral&utm_content=EcsRx/SystemsRx&utm_campaign=Badge_Grade
[gitbook-image]: https://img.shields.io/static/v1.svg?label=Documentation&message=Read%20Now&color=Green&style=flat
[gitbook-url]: https://ecsrx.gitbook.io/ecsr3/v/main/
[gitbook-url]: https://ecsrx.gitbook.io/ecsr3/v/main/


[![Build And Test](https://github.com/EcsRx/EcsR3/actions/workflows/build-and-test.yml/badge.svg?branch=main)](https://github.com/EcsRx/EcsR3/actions/workflows/build-and-test.yml)
4 changes: 4 additions & 0 deletions src/EcsR3.Tests/EcsR3.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<LangVersion>13</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="xunit" Version="2.9.2" />
Expand Down
4 changes: 4 additions & 0 deletions src/SystemsR3.Tests/SystemsR3.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<LangVersion>13</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="xunit" Version="2.9.2" />
Expand Down

0 comments on commit 213f24c

Please sign in to comment.