Debian Codegraph @

ansible_collections/community/postgresql/.azure-pipelines/templates/coverage.yml

raw
1 # This template adds a job for processing code coverage data.
2 # It will upload results to Azure Pipelines and codecov.io.
3 # Use it from a job stage that completes after all other jobs have completed.
4 # This can be done by placing it in a separate summary stage that runs after the test stage(s) have completed.
5
6 jobs:
7 - job: Coverage
8 displayName: Code Coverage
9 container: default
10 workspace:
11 clean: all
12 steps:
13 - checkout: self
14 fetchDepth: $(fetchDepth)
15 path: $(checkoutPath)
16 - task: DownloadPipelineArtifact@2
17 displayName: Download Coverage Data
18 inputs:
19 path: coverage/
20 patterns: "Coverage */*=coverage.combined"
21 - bash: .azure-pipelines/scripts/combine-coverage.py coverage/
22 displayName: Combine Coverage Data
23 - bash: .azure-pipelines/scripts/report-coverage.sh
24 displayName: Generate Coverage Report
25 condition: gt(variables.coverageFileCount, 0)
26 - task: PublishCodeCoverageResults@1
27 inputs:
28 codeCoverageTool: Cobertura
29 # Azure Pipelines only accepts a single coverage data file.
30 # That means only Python or PowerShell coverage can be uploaded, but not both.
31 # Set the "pipelinesCoverage" variable to determine which type is uploaded.
32 # Use "coverage" for Python and "coverage-powershell" for PowerShell.
33 summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml"
34 displayName: Publish to Azure Pipelines
35 condition: gt(variables.coverageFileCount, 0)
36 - bash: .azure-pipelines/scripts/publish-codecov.sh "$(outputPath)"
37 displayName: Publish to codecov.io
38 condition: gt(variables.coverageFileCount, 0)
39 continueOnError: true