File tree Expand file tree Collapse file tree
eng/pipelines/common/templates/jobs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,9 +209,20 @@ jobs:
209209 $ProgressPreference = 'SilentlyContinue'
210210 Invoke-WebRequest -Uri https://cli.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
211211
212- ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetFx\Cobertura.xml" -F netfx
213- ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetCore\Cobertura.xml" -F netcore
214- ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportAddOns\Cobertura.xml" -F addons
212+ # The CodeCov CLI fails if the report files aren't found, so confirm
213+ # they exist before uploading.
214+ if (Test-Path "coveragereportNetFx\Cobertura.xml")
215+ {
216+ ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetFx\Cobertura.xml" -F netfx
217+ }
218+ if (Test-Path "coveragereportNetCore\Cobertura.xml")
219+ {
220+ ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetCore\Cobertura.xml" -F netcore
221+ }
222+ if (Test-Path "coveragereportAddOns\Cobertura.xml")
223+ {
224+ ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportAddOns\Cobertura.xml" -F addons
225+ }
215226 displayName: Upload to CodeCov
216227
217228 - pwsh : |
You can’t perform that action at this time.
0 commit comments