Skip to content

Commit

Permalink
added test coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
BeierKevin committed Apr 21, 2024
1 parent 9974d48 commit d095fb5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/dotnet-build-and-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x' ]
dotnet-version: [ '8.0.x' ] # make sure it matches your .NET version

steps:
- uses: actions/checkout@v4
- name: Setup dotnet
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x' # make sure it matches your .NET version
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build
run: dotnet build --configuration Release --no-restore
- name: Test with the dotnet CLI
run: dotnet test
run: dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage"
- name: Code Coverage
uses: danielpalme/ReportGenerator-GitHub-Action@v1
with:
reports: '**/coverage.cobertura.xml'
targetdir: 'coverage'
reporttypes: 'HtmlInline_AzurePipelines'

- name: Publish Code Coverage
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage/
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MSTest" Version="3.2.0" />
</ItemGroup>

Expand Down

0 comments on commit d095fb5

Please sign in to comment.