azure-pipelines/steps/publish-code-coverage-results.yml
steps:
# This script only runs for once for each host platform (to avoid unnecessary uploads) and will only run when the
# variable CODECOV_TOKEN is available, which means this step is disabled for PRs from forked repositories.
# Use "bash" rather than "script" to allow upload from all platforms including Windows.
- bash: |
bash <(curl -s https://codecov.io/bash) -Z -t $(CODECOV_TOKEN)
condition: and(succeeded(), eq(variables['uploadCoverage'], 'true'), ne(variables['CODECOV_TOKEN'], ''))
displayName: 'Upload test coverage to codecov.io'