- 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 integration done via the Codecov GitHub app. Besides the information available on the Codecov web app, this integration enables Codecov to:
- add status checks on pull requests
- display coverage on pull requests via comments
- add line-by-line coverage on pull requests via file annotations
The Codecov configuration file contains additional configuration for Codecov.
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.
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.
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.