Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ jobs:
dotnet-version: 9.x
- name: Install dependencies
run: dotnet restore
- name: Install dotnet-coverage
run: dotnet tool install -g dotnet-coverage
- name: Build
run: dotnet build --configuration Release
- name: Test with dotnet
run: dotnet test --configuration Release
/p:CollectCoverage=true
/p:CoverletOutputFormat="\"cobertura,json\""
/p:CoverletOutput=coverage/
/p:IncludeTestAssembly=false
run: dotnet-coverage collect --output $GITHUB_WORKSPACE/report.cobertura.xml --output-format cobertura "dotnet run --no-build --project $GITHUB_WORKSPACE/src/Sidio.Text.Base32.Tests/Sidio.Text.Base32.Tests.csproj"
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@v5
with:
reports: /**/*.cobertura.xml
targetdir: coveragereport/
reporttypes: "Cobertura"
- name: Upload dotnet test results
uses: coverallsapp/github-action@v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ github.workspace }}/src/Sidio.Text.Base32.Tests/coverage/coverage.net8.0.cobertura.xml ${{ github.workspace }}/src/Sidio.Text.Base32.Tests/coverage/coverage.net9.0.cobertura.xml
files: ${{ github.workspace }}/coveragereport/Cobertura.xml
format: cobertura
if: ${{ always() }}
20 changes: 11 additions & 9 deletions src/Sidio.Text.Base32.Tests/Sidio.Text.Base32.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<OutputType>Exe</OutputType>

<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.14.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -36,4 +34,8 @@
<ProjectReference Include="..\Sidio.Text.Base32\Sidio.Text.Base32.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/Sidio.Text.Base32.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
}