Francesco Iapicca
Francesco Iapicca

Reputation: 2657

codecov fails in github actions

backgrond

issue

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


==> git version 2.31.1 found
==> curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
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 brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
==> GitHub Actions detected.
    Env vars used:
      -> GITHUB_ACTIONS:    true
      -> GITHUB_HEAD_REF:   remove-speedtest
      -> GITHUB_REF:        refs/pull/136/merge
      -> GITHUB_REPOSITORY: iapicca/yak_packages
      -> GITHUB_RUN_ID:     {{I'll keep this for myself}}
      -> GITHUB_SHA:        {{I'll keep this for myself}}
      -> GITHUB_WORKFLOW:   CI
->  Issue detecting commit SHA. Please run actions/checkout with fetch-depth > 1 or set to 0
    project root: .
    Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 7 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./packages/yak_tween/coverage/lcov.info bytes=2228
    + ./packages/yak_utils/coverage.lcov bytes=687
    + ./packages/yak_test/coverage.lcov bytes=339
    + ./packages/stub/coverage.lcov bytes=678
    + ./packages/yak_runner/coverage.lcov bytes=6429
    + ./packages/yak_widgets/coverage/lcov.info bytes=1444
    + ./packages/yak_error_handler/coverage.lcov bytes=1017
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
        8.0K    /tmp/codecov.yP3SSF.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=remove-speedtest&commit={{I'll keep this for myself}}
    &build={{I'll keep this for myself}}&build_url=http%3A%2F%2Fgithub.com%2Fiapicca%2Fyak_packages%2Factions%2Fruns%2F911981303&name=&tag=&slug=iapicca%2Fyak_packages&service=github-actions&flags=&pr=136&job=CI&cmd_args=

->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-1.0.3&token=secret&branch=remove-speedtest&commit={{I'll keep this for myself}}&build={{I'll keep this for myself}}&build_url=http%3A%2F%2Fgithub.com%2Fiapicca%2Fyak_packages%2Factions%2Fruns%2F911981303&name=&tag=&slug=iapicca%2Fyak_packages&service=github-actions&flags=&pr=136&job=CI&cmd_args=
{'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
404
==> Uploading to Codecov
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  5026  100   171  100  4855   1000  28391 --:--:-- --:--:-- --:--:-- 29220
100  5026  100   171  100  4855   1000  28391 --:--:-- --:--:-- --:--:-- 29220
    {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

{'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

request

as I don't really want to run anything locally can someone help me to fix the issue inside the CI

thank you

Upvotes: 12

Views: 9890

Answers (4)

NelsonGon
NelsonGon

Reputation: 13319

NOTE: This answer refers to the new uploader. You can also use codecov's action instead.

I had failing builds although I had steps setup correctly. In my case what fixed the builds was to change the "alpine" to "linux" in the uploader link and explicitly provide an environmental variable named CODECOV_TOKEN.

- name: Upload reports to codecov
      env:
        CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
      run: | 
       curl -Os https://uploader.codecov.io/latest/linux/codecov
       find . -iregex "codecov.*"
       chmod +x codecov 
       ./codecov -t ${CODECOV_TOKEN}

See the entire workflow file at this repo.

Upvotes: 3

filbranden
filbranden

Reputation: 8898

I ran into this issue today.

Seems related to Issue #330 being tracked from their GitHub page.

Last comment (as of this writing) suggests that the issue should have been fixed about an hour ago, but my latest PRs still ran into it. I'll post an update if I can confirm it's fixed for me.

UPDATE: This has been fixed with release of version 1.5.2 of the codecov action.

Upvotes: 2

Ricardo Zanini
Ricardo Zanini

Reputation: 1151

Refreshing my codecov token and reinstalling the plugin worked for me.

Upvotes: 4

user3837675
user3837675

Reputation: 110

Codecov has some heisenberg issues. If you don't have a token, please add one otherwise try to:

  • Force-push to retrigger Codecov
  • Rotate your token.

Upvotes: 9

Related Questions