From 5e9000f9bd105c5bb4edf0abd04786af057e523f Mon Sep 17 00:00:00 2001 From: NextTurn <45985406+NextTurn@users.noreply.github.com> Date: Sun, 12 Jul 2020 00:00:00 +0800 Subject: [PATCH] Setup code coverage --- .config/dotnet-tools.json | 12 ++++++++++++ eng/build.yml | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .config/dotnet-tools.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..e1db4cb --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "codecov.tool": { + "version": "1.12.1", + "commands": [ + "codecov" + ] + } + } +} \ No newline at end of file diff --git a/eng/build.yml b/eng/build.yml index 580ca33..4efc609 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -45,8 +45,12 @@ jobs: packagesToPack: WinSW.nuspec versioningScheme: byEnvVar versionEnvVar: BuildVersion - - script: dotnet test -c $(BuildConfiguration) --no-build src\Test\winswTests\winswTests.csproj + - script: dotnet test -c $(BuildConfiguration) --collect "XPlat Code Coverage" --no-build src\Test\winswTests\winswTests.csproj displayName: Test + - script: dotnet tool restore + displayName: Restore tools + - script: dotnet tool run codecov -- -f "src\**\TestResults\*\coverage.cobertura.xml" --required + displayName: Upload code coverage reports - task: PublishBuildArtifacts@1 displayName: Publish .NET 2.0 inputs: