Codecov not detecting any reports in specified directory
I have our entire test suite split up across multiple partitions in CI, and each partition generates its own report in the following directory:
/tests
/coverage_reports
cov1.xml
cov2.xml
...
After a test job is complete, I see the following output:
Coverage XML written to file ./coverage_reports/cov4.xml
Then in CI I have the following step, using the directory argument:
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage_reports
verbose: true
However, in CI I see the following message when Codecov is run:
['verbose'] Searching for files in /home/runner/work/whatnot_backend/whatnot_backend
['verbose'] coveragepy is not installed
['info'] Searching for coverage files...
['info'] Warning: Some files located via search were excluded from upload.
['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`
['verbose'] The error stack is: Error: No coverage files located, please try use `-f`, or change the project root with `-R`
at main (/snapshot/repo/dist/src/index.js)
This doesn't make sense because the coverage report is generated and saved in the location I specified in the CI step. Any idea why this isn't being detected? I noticed the docs mentioned this, but didn't include the directory argument:
Codecov's Action currently supports five inputs from the user:
token,file,flags,name, andfail_ci_if_error
Thanks!
Found out this was because codecov expected my coverage files to be coverageX.xml. I had covX.xml 🤦