# Github actions: upload fails no matter what I do

**URL:** <https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140>\
**Category:** Support\
**Tags:** cpp, github\
**Created:** [August 18, 2021, 7:00pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140 "2021-08-18T19:00:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcaddy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/bcaddy/32/2048_2.png) [@bcaddy](https://community.codecov.com/u/bcaddy)\
**Post date:** [August 18, 2021, 7:00pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/1 "2021-08-18T19:00:09Z")

</div>

### Description

I’m trying to setup Codecov for the first time. I followed the instructions to set it up in the [GitHub Marketplace](https://github.com/marketplace/actions/codecov) 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/.github/workflows/build-and-test.yml at ce548b7d56df9bcbc43ceb466072c355853d24bd · bcaddy/hydro-sandbox · GitHub](https://github.com/bcaddy/hydro-sandbox/blob/ce548b7d56df9bcbc43ceb466072c355853d24bd/.github/workflows/build-and-test.yml)

### Repository

> **[GitHub - bcaddy/hydro-sandbox: This is a place for me to practice and experiment...](https://github.com/bcaddy/hydro-sandbox/tree/main)**
>
> main

### CI/CD or Build URL

[https://github.com/bcaddy/hydro-sandbox/runs/3363049038?check\_suite\_focus=true](https://github.com/bcaddy/hydro-sandbox/runs/3363049038?check_suite_focus=true)

### Uploader

version 2 on GitHub Marketplace

### Codecov Output

````Run
  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
````

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [August 18, 2021, 7:09pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/2 "2021-08-18T19:09:45Z")

</div>

Hi @bcaddy,

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

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [August 18, 2021, 7:10pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/3 "2021-08-18T19:10:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bcaddy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/bcaddy/32/2048_2.png) [@bcaddy](https://community.codecov.com/u/bcaddy)\
**Post date:** [August 18, 2021, 7:59pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/4 "2021-08-18T19:59:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [August 18, 2021, 8:15pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/5 "2021-08-18T20:15:07Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![bcaddy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/bcaddy/32/2048_2.png) [@bcaddy](https://community.codecov.com/u/bcaddy)\
**Post date:** [August 18, 2021, 8:17pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/6 "2021-08-18T20:17:32Z")

</div>

Nope, still can’t find the file

---

<div class="post-metadata">

**Author:** ![bcaddy](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/bcaddy/32/2048_2.png) [@bcaddy](https://community.codecov.com/u/bcaddy)\
**Post date:** [August 18, 2021, 8:23pm UTC](https://community.codecov.com/t/github-actions-upload-fails-no-matter-what-i-do/3140/7 "2021-08-18T20:23:09Z")

</div>

@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
