codecov-action icon indicating copy to clipboard operation
codecov-action copied to clipboard

No coverage files found

Open YonatanKra opened this issue 2 years ago • 9 comments

Hi, I'm running the action like this:

with:
    directory: /home/runner/work/vivid-cli/vivid-cli/coverage/
    token: ***
    fail_ci_if_error: true
    files: ./clover.xml
    flags: unittests
    name: codecov-umbrella

I'm getting an error: There was an error running the uploader: No coverage files found, exiting.

I also tried the directory path as ./coverage/ but to no avail.

When I ls the ./coverate/ folder, I see the file exists:

> ls ./coverage
clover.xml
coverage-final.json
lcov-report
lcov.info

Any idea on how to solve this?

YonatanKra avatar Sep 22 '21 08:09 YonatanKra

@YonatanKra have you tried without specifying directory or files? Or just files: coverage/clover.xml?

thomasrockhu avatar Sep 22 '21 13:09 thomasrockhu

Hi @thomasrockhu I have the same problem. When I do:

codecov -f coverage/lcov.info -t $MY_TOKEN

it works but this github action responds with:

      - name: Upload code coverage to codecov
        uses: codecov/codecov-action@v2
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage/lcov.info
          flags: js_open_source
          name: memoria
          verbose: true

[2021-09-29T12:40:26.420Z] ['error'] There was an error running the uploader: No coverage files found, exiting.

This is very, very disappointing..

Example CI run: https://github.com/izelnakri/memoria/runs/3744223692?check_suite_focus=true

izelnakri avatar Sep 29 '21 12:09 izelnakri

@izelnakri I noticed that the CI run you posted doesn't have the files section. Is there one that does?

Also, do you have a run of codecov -f coverage/lcov.info ...?

thomasrockhu avatar Sep 29 '21 13:09 thomasrockhu

Yes I tried all the cases, and spent several hours learning/investigating codecov packages/ecosystem still no success. There needs to be certain simplications/better simple decisions in the future, which signals a room for improvement in codecov development team:

  • In the UI it wasnt clear that I had to enable a project to get an upload token, instead I was trying to use my API token to publish the coverage reports. Also homepage wasnt fully clear to me what value codecov brings other than html reports generated by test reports/base codecov tools -> big UX problem.

  • Instead of the current YAML config, codecov could provide an actions package with codecov binary, this removes a learning & deprecation curve and makes everything easier to debug, currently verbose mode doesnt help much -> DX failure.

Onboarding and tools need to get better.

izelnakri avatar Sep 29 '21 16:09 izelnakri

@izelnakri totally get it, I realize that it's frustrating to get this working for you right now. I asked for the CI runs above so that I could help debug the issue for you. If you could provide those runs, that would be very helpful.

thomasrockhu avatar Sep 30 '21 01:09 thomasrockhu

Hi @thomasrockhu the CI build I linked is completely containerized and by telling this to you now I realized what could be the problem :) However my suggestions above are valid, the error output should have been clear here: https://github.com/izelnakri/memoria/runs/3748652052?check_suite_focus=true

With this bug I just found an even bigger issue, this github action doesn't work in containerized environments. I'm also hitting right now this issue on my container when I try to do codecov -f coverage/lcov.info ... a better error message for this git missing(while it isnt) would be also helpfu: https://github.com/codecov/codecov-node/issues/89

izelnakri avatar Sep 30 '21 04:09 izelnakri

I had the same issue, but just now got it to work by specifying the whole path for files and commenting out directory. I hope this helps and works for you, too @izelnakri . Even if it's not really a fix and defeats the purpose of the directory parameter.

Before finding the workaround, I tried the version from the README.md (directory: ./some/path/, files: ./file.xml) and files: ./some/path/file.xml.

vindigram avatar Oct 02 '21 00:10 vindigram

I have the same problem with a directory specified, but nothing is uploaded "no files found".

zerothi avatar Jan 06 '22 07:01 zerothi

I have what looks like the same problem - my GH Action workflow uploads correctly on linux, but on Windows the same workflow fails with:

[2022-01-19T16:48:07.120Z] ['verbose'] Preparing to clean the following coverage paths: D:/a/xpybuild/xpybuild/tests/__coverage_python.win-py3.10/coverage.xml [2022-01-19T16:48:07.121Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files! [2022-01-19T16:48:07.121Z] ['verbose'] The error stack is: Error: Error while cleaning paths. No paths matched existing files! at cleanCoverageFilePaths (C:\snapshot\project\dist\src\helpers\files.js) at main (C:\snapshot\project\dist\src\index.js) at processTicksAndRejections (node:internal/process/task_queues:96:5) [2022-01-19T16:48:07.121Z] ['verbose'] End of uploader: 159 milliseconds Error: Codecov: Failed to properly upload: The process 'D:\a\_actions\codecov\codecov-action\v2.0.2\dist\codecov.exe' failed with exit code 4294967295

I'm specifying the coverage.xml file with "files: " and not using "directory: "

ben-spiller avatar Jan 19 '22 17:01 ben-spiller

Closing out due to age. If you are still experiencing an issue, please open a topic on our community boards

thomasrockhu-codecov avatar Mar 01 '23 19:03 thomasrockhu-codecov