Skip to content

Commit

Permalink
[ci]: Support code diff coverage (#1834)
Browse files Browse the repository at this point in the history
Support code diff coverage

Support to add the pull request checks for Code diff coverage in GitHub.
Support to display the code diff coverage html report in Azure Pipelines.
  • Loading branch information
xumia authored Sep 24, 2021
1 parent 48887d1 commit 0d538d3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ stages:
jobs:
- job:
displayName: "Python3"
variables:
DIFF_COVER_CHECK_THRESHOLD: 0
DIFF_COVER_ENABLE: 'true'
pool:
vmImage: ubuntu-20.04

Expand Down Expand Up @@ -91,14 +94,6 @@ stages:
python3 setup.py test
displayName: 'Test Python 3'
- script: |
sudo pip3 install diff-cover
target_branch=$(System.PullRequest.TargetBranch)
compare_branch=origin/${target_branch#refs/heads/}
diff-cover coverage.xml --compare-branch=$compare_branch
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: "Diff coverage"
- task: PublishTestResults@2
inputs:
testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml'
Expand Down

0 comments on commit 0d538d3

Please sign in to comment.