Last active
September 10, 2019 10:11
-
-
Save ThiagoBarradas/cf53df59b8d08dbe95e7aab5c2d2dfed to your computer and use it in GitHub Desktop.
Codacy - send dotnet code coverage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download codacy test reporter | |
curl -L https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.5/codacy-coverage-reporter-4.0.5-assembly.jar > ./codacy-test-reporter.jar | |
chmod +x ./codacy-test-reporter.jar | |
# Install dotnet tools to generate test report | |
dotnet tool install --global coverlet.console | |
dotnet add package coverlet.msbuild | |
# Build solution | |
dotnet restore | |
dotnet build ./MySolution.sln | |
# Running unit tests - 'cobertura' output format | |
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=coverage /p:Exclude=[xunit.*]* ./MySolution.sln | |
# Send test report result to codacy | |
java -jar ./codacy-test-reporter.jar report -l CSharp -t ${CODACY_PROJECT_TOKEN} -r ./MyProject.Tests/coverage.cobertura.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment