codecov-action: Globs not supported in v2?

A lerna monorepo consists of many packages in a single git repository. They are typically each in a folder in the packages/ directory. After my tests run, coverage reports are generated in the ./coverage folder of each subproject.

packages/package-1/coverage
packages/package-2/coverage
...

I am attempting to upload coverage for lerna monorepo using the following configuration:

      - name: Report Coverage
        uses: codecov/codecov-action@v2
        with:
          file: ./packages/*/coverage/*.json

But no coverage files are found. Full log output:

Run codecov/codecov-action@v2
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA25[6](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:7)SUM
==> SHASUM file signed by key id 806bb28aed[7](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:8)79[8](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:9)6[9](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:10)
==> Uploader SHASUM verified (432553f03714a83ab5cac78be2e7fe6a6050767f78f77e9c7a84bdb1c34a0bd3  codecov)
==> Running version latest
==> Running version v0.2.4
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n  -Q github-action-2.1.0 -f ./packages/*/coverage/*.json -C 413ad93886a715283ebd[11](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:12)11ce83e4c22b17d4d9
[2022-06-23T20:04:53.433Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.2.4
[[20](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:21)[22](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:23)-06-[23](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:24)T20:04:53.440Z] ['info'] => Project root located at: /home/runner/work/opentelemetry-js/opentelemetry-js
[2022-06-23T20:04:53.443Z] ['info'] -> No token specified or token is empty
[2022-06-23T20:04:53.451Z] ['info'] Searching for coverage files...
[2022-06-23T20:04:53.582Z] ['error'] None of the following appear to exist as files: ./packages/*/coverage/*.json
[2022-06-23T20:04:53.583Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@thomasrockhu Any chance to get a pair of eyes on this one. Forcing people to use only hard-coded file paths instead of being able to use glob patterns for the files to be collected is a huge regression.

I think globs still don’t work. But since no valid files where given, the action falls back to file search, which probably works for you.

Ah, I didn’t know it did that.

Here is part of your log:

warning - 2024-07-24 01:15:09,476 -- Some files were not found --- {"not_found_files": ["packages/*/coverage/lcov.info"]}
info - 2024-07-24 01:15:09,488 -- Found 1 coverage files to report
info - 2024-07-24 01:15:09,488 -- > /home/runner/work/our_democracy/our_democracy/packages/app/coverage/lcov.info

And here is my log:

warning - 2024-07-24 22:07:05,283 -- Some files were not found --- {"not_found_files": ["out/api/*/scoverage/xmlReport.dest/scoverage.xml", "out/worker/*/scoverage/xmlReport.dest/scoverage.xml", "out/main/*/scoverage/xmlReport.dest/scoverage.xml"]}
info - 2024-07-24 22:07:05,329 -- Found 66 coverage files to report
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.9/worker/scoverage/xmlReport.dest/scoverage.xml
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.10/scoverageReportWorkerClasspath.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/scoveragePluginDeps.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/worker/scoverageToolsClasspath.json
...

The files list containing names with * globs result in files not found. Instead, it’s searching and collecting files by file extension. It upload a whole lot of unrelated files, which leaks way to much data. What a mess.

That’s a really silly default. Well, back to manually writing them, I guess 😢 Though, this is open source. It’s probably just a call to globby to fix it, right? I’ll take a look. EDIT: doesn’t look to bad. I’ll send in a PR soonish.

I think globs still don’t work. But since no valid files where given, the action falls back to file search, which probably works for you.

Here is part of your log:

warning - 2024-07-24 01:15:09,476 -- Some files were not found --- {"not_found_files": ["packages/*/coverage/lcov.info"]}
info - 2024-07-24 01:15:09,488 -- Found 1 coverage files to report
info - 2024-07-24 01:15:09,488 -- > /home/runner/work/our_democracy/our_democracy/packages/app/coverage/lcov.info

And here is my log:

warning - 2024-07-24 22:07:05,283 -- Some files were not found --- {"not_found_files": ["out/api/*/scoverage/xmlReport.dest/scoverage.xml", "out/worker/*/scoverage/xmlReport.dest/scoverage.xml", "out/main/*/scoverage/xmlReport.dest/scoverage.xml"]}
info - 2024-07-24 22:07:05,329 -- Found 66 coverage files to report
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.9/worker/scoverage/xmlReport.dest/scoverage.xml
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.10/scoverageReportWorkerClasspath.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/scoveragePluginDeps.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/worker/scoverageToolsClasspath.json
...

The files list containing names with * globs result in files not found. Instead, it’s searching and collecting files by file extension. It upload a whole lot of unrelated files, which leaks way to much data. What a mess.

@lishaduck Thank you! I need to try it again, then. If it works now, it must be rather newish, since I definitely tried a single * glob before without success.

@lishaduck Can you please point to the respective documentation?

I mean, it would be nice to see at least one working example using globs. It should then be added to the documentation. (FTR, I already use files, but it does not work with globs.)

@dyladan @ssbarnea ok, I made some changes here to how we handle globs. I would recommend trying ** for dirs as opposed to *, but I have to be honest, I’m not sure if it’ll work.

I’m going to push towards our community boards because I check that more frequently. If the above doesn’t work, please ping me there and I’ll do what I can to fix it.