CircleCI orb should automatically retry sending the report on failure

Summary

The CircleCI orb should automatically retry sending the report if there was some error.

Description

We’ve seen a couple of random upload failures, and I think these are caused by some random errors on Codecov side. The output looks like this:

#!/bin/bash -eo pipefail
cat codecov | bash -s -- \
  -Q "codecov-circleci-orb-1.1.4" \
  -t "${CODECOV_TOKEN}" \
  -n "${CIRCLE_BUILD_NUM}" \
  -F "" \
  -Z || echo 'Codecov upload failed'


  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.5


==> git version 2.20.1 found
==> curl 7.64.0 (x86_64-pc-linux-gnu) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 
==> Circle CI detected.
    project root: .
    Yaml found at: .codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy exists disable via -X coveragepy
    -> Running coverage xml
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage.xml bytes=908099
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
        100K	/tmp/codecov.mRKPoc.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=[REDACTED]&commit=[REDACTED]&build=478862&build_url=&name=478862&tag=&slug=[REDACTED]%2F[REDACTED]&service=circleci&flags=&pr=10219&job=2&cmd_args=Q,t,n,F,Z
->  Pinging Codecov
https://codecov.io/upload/v4?package=codecov-circleci-orb-1.1.4-1.0.5&token=<hidden>&package=codecov-circleci-orb-1.1.4-1.0.5&token=************************************&branch=[REDACTED]&commit=[REDACTED]&build=478862&build_url=&name=478862&tag=&slug=[REDACTED]%2F[REDACTED]&service=circleci&flags=&pr=10219&job=2&cmd_args=Q,t,n,F,Z

301
==> Uploading to Codecov
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   99k    0     0  100   99k      0  3094k --:--:-- --:--:-- --:--:-- 3094k
    
Codecov upload failed
CircleCI received exit code 0

Initially this was reported to Random failures in uploading report · Issue #97 · codecov/codecov-circleci-orb · GitHub