Skip to content

This is a template for creating .NET projects with compile-time code style checking, CI/CD workflows for Github Actions and Azure pipelines. Also, includes SonarCloud integration.

Notifications You must be signed in to change notification settings

Yeabtsega1/Template-for-Dotnet

Repository files navigation

.NET project template

This is a template for creating .NET projects with compile-time code style checking, CI/CD workflows for Github Actions and Azure pipelines. Also, includes SonarCloud integration.

Nuget packages

Compile time code style checking

  • Microsoft.CodeAnalysis.NetAnalyzers

Unit tests project

  • coverlet.msbuild
  • coverlet.collector
  • FluentAssertions

Required property groups in project file

<PropertyGroup>
    <EnableNETAnalyzers>true</EnableNETAnalyzers>
    <AnalysisMode>Recommended</AnalysisMode>
    <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

Commands

  • dotnet test -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:CoverletOutput=../TestResults
  • dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.8.6
  • reportgenerator "-reports:TestResults.opencover.xml" "-targetdir:coveragereport" -reporttypes:Html
  • dotnet test -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:CoverletOutput=TestResults -p:SkipAutoProps=true -p:Threshold=80

Sources

About

This is a template for creating .NET projects with compile-time code style checking, CI/CD workflows for Github Actions and Azure pipelines. Also, includes SonarCloud integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published