Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 2.47 KB

build-and-test-workflow.md

File metadata and controls

38 lines (23 loc) · 2.47 KB

build-and-test workflow

Build and test

This workflow:

  • Builds the code and runs tests.
  • Generates code coverage and uploads as a workflow artifact.
  • Uploads code coverage to Codecov.
  • Uploads test results as a workflow artifact.

Codecov

Codecov integration done via the Codecov GitHub app. Besides the information available on the Codecov web app, this integration enables Codecov to:

The Codecov configuration file contains additional configuration for Codecov.

Build warnings will make the workflow fail

The dotnet build command includes the -warnaserror flag which will cause the build to fail if there are any errors.

This is used to help keep the code healthy whilst balancing local dev. Meaning, when developing locally there is no need to force all warnings to be fixed to be able to build the code.

Testing loggers

When running tests we use 3 loggers:

  • trx: normal logger, produces test result files which can be downloaded and viewed on Visual Studio.
  • GitHubActions: used to produce annotations on the workflow to give more visibility when tests fail. For more info see GitHub Actions Test Logger. It also adds annotations on PRs.
  • liquid.custom: Uses a template to create a markdown reports for the test results. These markdown reports are uploaded as workflow artifacts and in case of Pull Requests they are added as comments. For more info see Liquid Test Reports.

Secrets

This workflow uses a Dependabot secret as well as a Repository secret named CODECOV_TOKEN. This secret contains a token from Codecov with permissions to upload code coverage to Codecov.