Github actions: upload fails no matter what I do

Description

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

/ce548b7d56df9bcbc43ceb466072c355853d24bd

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

Repository

CI/CD or Build URL

Uploader

version 2 on GitHub Marketplace

Codecov Output

  with:
    token: ***
    directory: ./
    files: coverage_all.info
    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 coverage_all.info -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/coverage_all.info?

Removing the token, directory, and file section helps but then it thinks that my script to determine the coverage (coverage-finder.sh) is the coverage file and uploads that which of course doesn’t work. If I specify the file with either coverage_all.info or ./tests/coverage_all.info 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/coverage_all.info
  • removed the checkout step
1 Like