You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/.azure-pipelines/templates/coverage.yml

39 lines
1.7 KiB
YAML

# This template adds a job for processing code coverage data.
# It will upload results to Azure Pipelines and codecov.io.
# Use it from a job stage that completes after all other jobs have completed.
# This can be done by placing it in a separate summary stage that runs after the test stage(s) have completed.
jobs:
- job: Coverage
displayName: Code Coverage
container: $[ variables.defaultContainer ]
workspace:
clean: all
steps:
- checkout: self
fetchDepth: $(fetchDepth)
path: $(checkoutPath)
- task: DownloadPipelineArtifact@2
displayName: Download Coverage Data
inputs:
path: coverage/
patterns: "Coverage */*=coverage.combined"
- bash: .azure-pipelines/scripts/combine-coverage.py coverage/
displayName: Combine Coverage Data
- task: PublishCodeCoverageResults@1
displayName: Publish to Azure DevOps
inputs:
# additionalCodeCoverageFiles: # string. Additional files.
codeCoverageTool: Cobertura
# failIfCoverageEmpty: false # boolean. Fail when code coverage results are missing. Default: false.
# pathToSources: # string. Path to Source files.
# reportDirectory: # string. Report directory.
summaryFileLocation: coverage/reports/coverage*.xml
- bash: .azure-pipelines/scripts/report-coverage.sh
displayName: Generate Coverage Report
condition: gt(variables.coverageFileCount, 0)
- bash: .azure-pipelines/scripts/publish-codecov.py "$(outputPath)"
displayName: Publish to codecov.io
condition: gt(variables.coverageFileCount, 0)
continueOnError: true