Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PrGate.yml: Add support for publishing code coverage results #16

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Steps/PrGate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ parameters:
displayName: Perform Stuart PR Evaluation
type: boolean
default: true
- name: extra_build_args
displayName: Extra Build Command Arguments
type: string
default: ''
- name: extra_install_step
displayName: Extra Install Steps
type: stepList
Expand Down Expand Up @@ -117,15 +121,15 @@ steps:
displayName: Build and Test ${{ parameters.build_pkgs }} ${{ parameters.build_archs}}
inputs:
filename: stuart_build
arguments: -c ${{ parameters.build_file }} -p $(pkgs_to_build) -t ${{ parameters.build_targets}} -a ${{ parameters.build_archs}} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}}
arguments: -c ${{ parameters.build_file }} -p $(pkgs_to_build) -t ${{ parameters.build_targets}} -a ${{ parameters.build_archs}} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} ${{ parameters.extra_build_args}}
condition: and(gt(variables.pkg_count, 0), succeeded())

- ${{ if eq(parameters.do_ci_build, true) }}:
- task: CmdLine@1
displayName: CI Build and Test ${{ parameters.build_pkgs }} ${{ parameters.build_archs}}
inputs:
filename: stuart_ci_build
arguments: -c ${{ parameters.build_file }} -p $(pkgs_to_build) -t ${{ parameters.build_targets}} -a ${{ parameters.build_archs}} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}}
arguments: -c ${{ parameters.build_file }} -p $(pkgs_to_build) -t ${{ parameters.build_targets}} -a ${{ parameters.build_archs}} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} ${{ parameters.extra_build_args}}
condition: and(gt(variables.pkg_count, 0), succeeded())

# Publish Test Results to Azure Pipelines/TFS
Expand Down Expand Up @@ -170,6 +174,8 @@ steps:
TestSuites.xml
**/BUILD_TOOLS_REPORT.html
**/OVERRIDELOG.TXT
coverage.xml
coverage.html
flattenFolders: true
condition: succeededOrFailed()

Expand All @@ -181,3 +187,11 @@ steps:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'Build Logs $(System.JobName)'
condition: succeededOrFailed()

- task: PublishCodeCoverageResults@1
displayName: Publish Code Coverage Results
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'Build/coverage.xml'
pathToSources: '$(Build.SourcesDirectory)'
condition: and(succeededOrFailed(), and(gt(variables.pkg_count, 0), contains('${{ parameters.extra_build_args }}', 'CODE_COVERAGE=TRUE')))