From 196ad40bc6260fe1358957c9667ff19f1d0a773a Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 1 Oct 2021 15:24:17 -0700 Subject: [PATCH] Setup code coverage in Azure DevOps --- .vsts-ci/azure-pipelines-ci.yml | 2 ++ .vsts-ci/templates/coverage.yml | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .vsts-ci/templates/coverage.yml diff --git a/.vsts-ci/azure-pipelines-ci.yml b/.vsts-ci/azure-pipelines-ci.yml index 30a6998520..dcc89fde4f 100644 --- a/.vsts-ci/azure-pipelines-ci.yml +++ b/.vsts-ci/azure-pipelines-ci.yml @@ -46,6 +46,7 @@ jobs: vmImage: windows-2019 steps: - template: templates/ci-general.yml + - template: templates/coverage.yml - job: PS7_macOS displayName: PowerShell 7 - macOS 10.15 @@ -53,6 +54,7 @@ jobs: vmImage: macOS-10.15 steps: - template: templates/ci-general.yml + - template: templates/coverage.yml - job: PS7_Ubuntu displayName: PowerShell 7 - Ubuntu 20.04 diff --git a/.vsts-ci/templates/coverage.yml b/.vsts-ci/templates/coverage.yml new file mode 100644 index 0000000000..d28766eba0 --- /dev/null +++ b/.vsts-ci/templates/coverage.yml @@ -0,0 +1,11 @@ +# NOTE: This requires the build to have been run first. +steps: +- pwsh: npm run coverage + workingDirectory: $(Build.SourcesDirectory)/vscode-powershell + displayName: Analyzing code coverage +- task: PublishCodeCoverageResults@1 + displayName: Publish code coverage results + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: $(Build.SourcesDirectory)/vscode-powershell/coverage/cobertura-coverage.xml + failIfCoverageEmpty: true