Cannot make Codecov work with Github Actions as it fails to upload reports or run correctly

Before submitting a topic, please confirm the following

I have searched for similar issues before creating this topic.
I have verified that my repository is using the Codecov GitHub app, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.
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

Case 1: following the quick start guide I am unable to setup Codecov to run successfully but it doesn’t upload any reports.

Case 2: setting up a workflow like it’s setup here Codecov doesn’t run successfully and throws an error.

Codecov integration with my repo is done and the token is added in the repo.
Note: the repo I want to integrated it with has mixed languages (Python, C++, Go, TypeScript, Scala)

CI/CD URL

Private.

Codecov Output

Case 1 (following the quick start guide):

  • Codecov runs and completes the run in a few seconds (3-4), it’s green and the report has this classic error:

Codecov report uploader 0.5.0
[2023-05-23T18:00:24.921Z] [‘info’] => Project root located at: /home/runner/work/opaque/opaque
[2023-05-23T18:00:24.922Z] [‘info’] → Token found by environment variables
[2023-05-23T18:00:24.934Z] [‘info’] Searching for coverage files…
[2023-05-23T18:00:24.995Z] [‘info’] Warning: Some files located via search were excluded from upload.
[2023-05-23T18:00:24.996Z] [‘info’] If Codecov did not locate your files, please review Supported Coverage Report Formats
[2023-05-23T18:00:24.996Z] [‘error’] There was an error running the uploader: No coverage files located, please try use -f, or change the project root with -R

  • I have yet to find a way to fix this by looking on the forum as well as on the web, everything I found and tried failed and resulted in the same error (so I presume that most likely I didn’t setup the fix correctly)

Case 2:

  • when reaching this step: pytest --cov=./ --cov-report=xml there is a failure with the following error:

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
:1206: in _gcd_import
???
:1178: in _find_and_load
???
:1149: in _find_and_load_unlocked
???
:690: in _load_unlocked
???
/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:172: in exec_module
exec(co, module.dict)
client/cli/tests/unit/conftest.py:12: in
from mc2.api.enums import (
E ModuleNotFoundError: No module named ‘mc2’

---------- coverage: platform linux, python 3.11.3-final-0 -----------
Coverage XML written to file coverage.xml

=========================== short test summary info ============================
ERROR - ModuleNotFoundError: No module named ‘mc2’
!!! Interrupted: 1 error during collection !!!
=============================== 1 error in 0.16s ===============================
Error: Process completed with exit code 2.

  • nothing I tried got me to solve this error and see if Codecov run successfully, gets the reports and uploads them to the web app.

Expected Results

Following either examples from Case 1 & 2 should result in a successful integration with Github and I should be able to see the coverage reports in the web app.

Actual Results

Various errors are generated depending on what workflow.yml file contains.

Additional Information

Trying to validate the contents of the yml file in both Case 1 & 2 will result in an error even though ideally it shouldn’t.

Any help/info/suggestions are highly appreciated thanks.

  1. Can you please link to your CI runs for this?
  2. There seems to be an error in how you run tests before it reaches Codecov. Did you install your dependencies, namely mc2?

Hi, it was an internal setup issue that I resolved, thanks for the reply, this can be closed.

1 Like