Unit Test logger for Visual Studio Test Platform (vstest) and GitHub actions
Stable | CI | |
---|---|---|
GitHub.TestLogger | GPR |
Github Test Logger can report test results automatically to your GitHub workflow.
For a complete example: githubtestlogger-example
#Package manager
Install-Package GitHub.TestLogger -Version 1.0.0
or
#CLI
dotnet add package GitHub.TestLogger --version 1.0.0
dotnet test --logger "github;GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}"
Parameters can be set with the command line, or through Environment variables.
Name | Parameter | Environment | Default | |
---|---|---|---|---|
Github token (mandatory) | GITHUB_TOKEN | [N/A] | The github token that will be used to access the GitHub Api to publish the test results. Usually ${{secrets.GITHUB_TOKEN}} | |
Name (optional) | name | GHL_CHECKRUN_NAME | The job name the test report will be published under. | test-report |
Eg. to publish test result with name "my-test-report":
dotnet test --logger "github;name=my-test-report;GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}"