Skip to content

.NET Build Process

DevOps edited this page Jan 13, 2024 · 11 revisions

Overview of .NET build processes for all .NET projects in the TeqBench organization.

Local

Configuration

  • To build/pack locally use the Debug configuration.

Build

  • To build locally, can be done either in Visual Studio or command line.
    • Visual Studio
      • Load the solution
      • Right-mouse clicking the project file to bring up the context menu and selecting Build {project's name}.
    • Command Line
      • Open terminal.
      • Navigate to the solution's root folder and issue the command dotnet build -c:Debug; this will also build the test projects in the solution.
    • Build Output
      • Build output for Visual Studio or command line, i.e. assembly, will be found in the {project}/bin/Debug/ folder.

Test

  • To test locally, it is easiest to run tests from the command line.
    • Open terminal.
    • Navigate to the solution's root folder and issue the command dotnet test.
  • Test Output
    • Test reports will be found in the {solution root}/.coverage folder.

Badges

Badges are not created/updated as part of local builds.

Cloud

Configuration

  • Cloud based builds use the Release configuration.

Build

  • A cloud based build is initiated via one of two GitHub Actions workflows:
    1. Manually via a .NET project's repo Actions Project Build Workflow workflow_dispatch menu.
    2. Automatically a .NET project's repo Actions Project CI Workflow upon a successful pull request merge into the main branch.

With either workflow, only the build component of the version number is updated. For a complete overview of assembly and package versioning, see .NET Versioning Standards.

Test

Tests are run as part of a cloud based build. A simple summary report can be viewed from the workflow step Run Unit Tests output.

Build Status

  • A code coverage below 60% will result in a failing build.
  • A code coverage between 60% and 75% will result in a passing build.
  • A code coverage above 75% will result in a passing build.

Badges

Badges for a project are also updated as part of the build process.

  • Build Badge - indicates if build is passing or failing.
  • Build # Badge - displays the most recent build number from a cloud based build related workflow.
  • Coverage Badge - displays the code coverage percentage.
    • A code coverage below 60% will display a red coverage badge.
    • A code coverage between 60% and 75% will display a yellow coverage badge.
    • A code coverage above 75% will display a green coverage badge.

Examples

Build Status - Passing

Build Status - Failing

Build Number

Code Coverage 0%

Code Coverage 70%

Code Coverage 100%