Github actions: upload fails no matter what I do


I’m trying to setup Codecov for the first time. I followed the instructions to set it up in the GitHub Marketplace but ran into the following issues:

  1. It doesn’t find my token. I currently have that line commented out but it didn’t work when I had it active. Probably not required since my repo is public but it’d be nice to know how to fix it

  2. The uploader fails to find the file despite the fact that I’ve indicated the proper directory and filename and have confirmed that the file exists.

  3. I have fail_ci_if_error: true set but it still reports a success despite the earlier mentioned errors

Commit SHAs


Build YAML: hydro-sandbox/build-and-test.yml at ce548b7d56df9bcbc43ceb466072c355853d24bd · bcaddy/hydro-sandbox · GitHub


CI/CD or Build URL


version 2 on GitHub Marketplace

Codecov Output

    token: ***
    directory: ./
    flags: sandbox-tests
    name: codecov-upload
    fail_ci_if_error: true
    verbose: true
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (86594196ca3bfa1ecb6bca076cd5f63b32ddebf91e43f08ecfc42a85579887e7  codecov)
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n codecov-upload -Q github-action-2.0.2 -Z -f -F sandbox-tests -s ./ -v
[2021-08-18T15:54:58.758Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.0
[2021-08-18T15:54:58.764Z] ['info'] => Project root located at: /home/runner/work/hydro-sandbox/hydro-sandbox
[2021-08-18T15:54:58.765Z] ['info'] -> No token specified or token is empty
[2021-08-18T15:54:58.765Z] ['verbose'] Start of network processing...
[2021-08-18T15:54:58.766Z] ['verbose'] Searching for files in /home/runner/work/hydro-sandbox/hydro-sandbox
[2021-08-18T15:54:58.776Z] ['info'] Searching for coverage files...
[2021-08-18T15:54:58.784Z] ['error'] Error: No coverage files found, exiting.```

### Expected Results
I expected the uploader to find the file and the token then upload them to codecov so I could examine the coverage results. I also expected it to make the github job fail if the upload failed

### Actual Results
The file and token were not found and the github actions job was not marked as failed

Hi @bcaddy,

What happens if you remove the token (not needed for public repos) and files sections?

Alternatively, I think if you do want to include files it should be ./tests/

Removing the token, directory, and file section helps but then it thinks that my script to determine the coverage ( is the coverage file and uploads that which of course doesn’t work. If I specify the file with either or ./tests/ it fails to find the file.

It is failing properly now though

@bcaddy hm… what happens if you remove the checkout step before the codecov step? I’m wondering if checkout is overwriting something along the way?

Nope, still can’t find the file

@tom, actually that did it. I found a typo that I made when I tried deleting the checkout line and fixing that fixed everything.

To summarize here’s what I did:

  • removed the directory argument
  • replaced the files path with ./tests/
  • removed the checkout step
1 Like