# Codecov GitHub action doesn't work well compared to bash uploader

**URL:** <https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220>\
**Category:** Bug Fixes\
**Tags:** github\
**Created:** [March 22, 2023, 6:54pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220 "2023-03-22T18:54:19Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [March 22, 2023, 6:54pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/1 "2023-03-22T18:54:19Z")

</div>

## Before submitting a topic, please confirm the following

[x] I have searched for similar issues before creating this topic.  
 I have verified that my repository is using the [Codecov GitHub app](https://github.com/apps/codecov), if using GitHub  
[x] I have [validated](https://docs.codecov.com/docs/codecov-yaml#validate-your-repository-yaml) my `codecov.yaml` configuration file.  
[x] I have filled out the below sections to the best of my ability.  
[x] I understand that the community boards are a free, best-effort tool. While we hope to have someone on the Codecov team resolve your problem quickly, this is not always possible.

### Description

CodeCov GitHub action coverage is low

### CI/CD URL

Please provide a link to the CI/CD run.

Here’s the low coverage using the action:

[https://github.com/acgetchell/CDT-plusplus/actions/runs/4267119018](https://github.com/acgetchell/CDT-plusplus/actions/runs/4267119018)

### Codecov Output

Please provide the full output of running the uploader on your CI/CD. This will typically have the Codecov logo as ASCII.

Output too long to post here, here’s the link:

[https://github.com/acgetchell/CDT-plusplus/actions/runs/4267119018/jobs/7428378568#step:10:46](https://github.com/acgetchell/CDT-plusplus/actions/runs/4267119018/jobs/7428378568#step:10:46)

### Expected Results

Please provide what you expect to have happened (e.g. a file that has missing coverage on a particular line).

Here’s the results when I use the bash uploader:

> <https://github.com/acgetchell/CDT-plusplus/blob/76355e60fcbd7757d73e92c976ece8874efc58d8/.github/workflows/codecov-upload.yml>

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

### Actual Results

Please provide what actually happened.

This were the results using the Codecov GitHub Action:

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus/commit/13932ac26c7e08d91753b00bbca97bcab1e0295f)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

### Additional Information

Please provide applicable commit SHAs or file names that are extraneous or missing. Any additional information, configuration, or data that might be necessary to reproduce the issue.

> <https://github.com/acgetchell/CDT-plusplus/commit/13932ac26c7e08d91753b00bbca97bcab1e0295f>
>
> Verified steps to be run manually ...

---

<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:** [March 23, 2023, 1:41am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/2 "2023-03-23T01:41:10Z")

</div>

@acgetchell I’ll take a look at this. What I’m getting is that you have different coverage between using the bash uploader and the new uploader (which is what underlies the GitHub Action v3).

Can you provide a commit SHA using the bash uploader and one using the new one?

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [March 23, 2023, 5:25am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/3 "2023-03-23T05:25:55Z")

</div>

Bash uploader:

> <https://github.com/acgetchell/CDT-plusplus/commit/21ea2c5e5c94678913216a3d3e14d4bd7f6f02b9>
>
> Also document current issues with AppVeyor and CodeCov.

GitHub action:

> <https://github.com/acgetchell/CDT-plusplus/commit/13932ac26c7e08d91753b00bbca97bcab1e0295f>
>
> Verified steps to be run manually ...

---

<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:** [March 26, 2023, 12:09am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/4 "2023-03-26T00:09:59Z")

</div>

@acgetchell the 2nd link has logs that are a bit too old (I can’t see what the Codecov output is). Do you have a more recent commit that uses the GitHub Action v2+?

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [March 26, 2023, 6:09pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/5 "2023-03-26T18:09:37Z")

</div>

Thanks @tom !

Here’s a recent commit which switches to using the CodeCov GitHub Action:

> <https://github.com/acgetchell/CDT-plusplus/commit/a05eea424555dc7cd177d1ab41b02047a0220916>
>
> Working with Codecov Community support to determine why coverage is so different… using the GitHub Action vs. using the Bash uploader.
> 
> https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/4
> 
> Updated vcpkgGitCommitId: b81bc3a83fdbdffe80325eeabb2ec735a1f3c29d
> 
> Turn off the main program flow in bistellar-flip when in Debug, because Doctest runs in Debug mode instead.
> Bistellar-flip links to Qt5, which adds a lot of overhead, so we don't want to use it unless needed (i.e. Release).

Here is the GitHub Workflow file:

> <https://github.com/acgetchell/CDT-plusplus/blob/a05eea424555dc7cd177d1ab41b02047a0220916/.github/workflows/codecov-upload.yml>

You can see here that coverage drops by 62%:

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus/commit/a05eea424555dc7cd177d1ab41b02047a0220916)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

Thanks again for looking into it!

---

<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:** [March 31, 2023, 12:17am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/6 "2023-03-31T00:17:20Z")

</div>

@acgetchell, ok, so the first thing that I noticed is that the bash uploader runs `gcov` by default. We decided to not do that for the underlying node uploader for the Action@v3. Can you add the last line below

```auto
      - name: Submit to codecov.io
        uses: codecov/codecov-action@v3
        with:
          directory: build/gcov-reports
          fail_ci_if_error: false
          verbose: true
          gcov: true

```

and see if that fixes things

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [March 31, 2023, 11:41pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/7 "2023-03-31T23:41:50Z")

</div>

Okay, I did that.

> <https://github.com/acgetchell/CDT-plusplus/blob/6e2d8de2f3b9e0cde0f1886ca45995164caffcfd/.github/workflows/codecov-upload.yml>

Switching back from the bash uploader to the GitHub Action using gcov dropped my coverage from 84% to 22%:

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus/commits)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

---

<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:** [April 11, 2023, 8:11pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/8 "2023-04-11T20:11:43Z")

</div>

@acgetchell sorry for the delay here. I had an idea and was working on a fix. Could you try running the action again, I just released a new version of it.

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [April 13, 2023, 6:09pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/9 "2023-04-13T18:09:14Z")

</div>

I tried the new action, coverage still dropped:

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus/commit/b0a39bb8ee1e36852593e521bf703c8048d9c9cd)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

---

<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:** [April 21, 2023, 6:08am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/10 "2023-04-21T06:08:58Z")

</div>

@acgetchell ok, I think I got this a little bit closer. I’m off on vacation tomorrow for a week, so I won’t be super responsive.

I made this PR off of your [commit](https://github.com/acgetchell/CDT-plusplus/commit/b0a39bb8ee1e36852593e521bf703c8048d9c9cd) and it looks like removing [this line](https://github.com/acgetchell/CDT-plusplus/commit/b0a39bb8ee1e36852593e521bf703c8048d9c9cd#diff-4f2697acc871753653dc969be60303c9a41bd149e9a1e9803b02e1a2b2a65385R60)

```auto
directory: build/gcov-reports

```

helps to find the coverage files. I also get coverage of [79%](https://app.codecov.io/github/acgetchell/CDT-plusplus/commit/001c739d30744114681810e3aeb444f20aa47b73). Let me know if this looks good

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [May 5, 2023, 11:43pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/11 "2023-05-05T23:43:37Z")

</div>

Works with gcc-11, not gcc-12.

> <https://github.com/acgetchell/CDT-plusplus/actions/runs/4898327490/jobs/8747323081#step:9:18>

---

<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:** [May 6, 2023, 3:40am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/12 "2023-05-06T03:40:21Z")

</div>

@acgetchell this looks like a problem with your [conversion](https://github.com/acgetchell/CDT-plusplus/actions/runs/4898327490/jobs/8747323081#step:9:20) before running Codecov.

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [July 7, 2023, 6:58pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/13 "2023-07-07T18:58:16Z")

</div>

Yes, that is probably a mismatch between gcov and gcc versions. Let me see if that can be fixed.

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [July 8, 2023, 5:35pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/14 "2023-07-08T17:35:57Z")

</div>

Nope, even without gcov/gcc mismatch errors, it still fails on gcc-12:

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus/commit/d861cacf164dde8ff2ff43a7b36d1ed46da54287)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

But works on gcc-11:

> **[Code coverage done right.](https://app.codecov.io/gh/acgetchell/CDT-plusplus/commit/2f7a18841b5bd79ec808e0a7cc38522c7a1eb936)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

---

<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:** [July 26, 2023, 5:27am UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/15 "2023-07-26T05:27:45Z")

</div>

@acgetchell it looks like there is an error when you are generating coverage files. See [this line](https://github.com/acgetchell/CDT-plusplus/actions/runs/5490027316/job/14868889843#step:9:23).

---

<div class="post-metadata">

**Author:** ![acgetchell](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/acgetchell/32/361_2.png) [@acgetchell](https://community.codecov.com/u/acgetchell)\
**Post date:** [October 6, 2023, 10:41pm UTC](https://community.codecov.com/t/codecov-github-action-doesnt-work-well-compared-to-bash-uploader/4220/16 "2023-10-06T22:41:16Z")

</div>

I think the gcc and gcov mismatch has been resolved in gcc 13.

Coverage is also now working well.
