Skip to content

Commit

Permalink
[azp]: Enable PR diff coverage (#2083)
Browse files Browse the repository at this point in the history
- Setup AZP builds to enforce PR code diff coverage limits
- Current limit is at 0%, to be adjusted to actual value in a future PR

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
  • Loading branch information
theasianpianist committed Jan 19, 2022
1 parent bf4cd4a commit 863f0f1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .azure-pipelines/gcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,24 @@ jobs:
${{ if eq(parameters.pool, 'default') }}:
vmImage: 'ubuntu-20.04'

variables:
DIFF_COVER_CHECK_THRESHOLD: 0
DIFF_COVER_ENABLE: 'true'
DIFF_COVER_WORKING_DIRECTORY: $(System.DefaultWorkingDirectory)/gcov/

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest


steps:
- script: |
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
displayName: "Install .NET CORE"
- script: |
sudo apt-get install -y lcov
displayName: "Install dependencies"
Expand Down Expand Up @@ -93,6 +106,8 @@ jobs:
sudo ./gcov_support.sh generate
sudo ./gcov_support.sh merge_container_info $(Build.ArtifactStagingDirectory)
sudo cp -rf gcov_output $(Build.ArtifactStagingDirectory)
mkdir -p $(System.DefaultWorkingDirectory)/gcov
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/* $(System.DefaultWorkingDirectory)/gcov/
ls -lh $(Build.ArtifactStagingDirectory)
popd
workingDirectory: $(Pipeline.Workspace)
Expand Down

0 comments on commit 863f0f1

Please sign in to comment.