Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support glob format for xml files #96

Open
ty1824 opened this issue Jan 23, 2023 · 7 comments
Open

Support glob format for xml files #96

ty1824 opened this issue Jan 23, 2023 · 7 comments

Comments

@ty1824
Copy link

ty1824 commented Jan 23, 2023

I have a multi-module project and would like to publish each individual coverage report without having to manually specify the file. However, if I use a glob format, I get the error:
Error: ENOENT: no such file or directory, open '**/reports/kover/report.xml'

Ideally this would work similarly to other test reporting actions (I am currently using dorny/test-reporter@v1, for example).

I realize I could use a merged report, but I was hoping to avoid that in this case.

@mi-kas
Copy link
Owner

mi-kas commented Jan 23, 2023

@ty1824 Thanks for bringing this up! I will look into making the action compatible with multi-module projects

@ty1824
Copy link
Author

ty1824 commented Jan 24, 2023

Thanks for providing this action and the quick response 😊

@ty1824
Copy link
Author

ty1824 commented Jan 26, 2023

Realized I never left an example. My pull request build action: https://github.com/ty1824/dialector/blob/main/.github/workflows/pull-request-build.yml

@mi-kas
Copy link
Owner

mi-kas commented Aug 24, 2023

@ty1824 With v1.7 support for multi-module project got introduced. Basically you can pass now multiple report files to the action like this:

        ...
        uses: mi-kas/kover-report@v1
        with:
          path: |
            ${{ github.workspace }}/project1/build/reports/kover/report.xml
            ${{ github.workspace }}/project2/build/reports/kover/report.xml

Does this resolve your problem?

@dubakur
Copy link

dubakur commented Aug 27, 2023

@mi-kas Is it possible to use dynamic path like '**/reports/kover/report.xml', since we are calling this in reusable action created for multi module kotlin projects. I tried release v1.7 still it throws "Error: ENOENT: no such file or directory" for below dynamic path

    uses: mi-kas/[email protected]
    with:
      path: '**/reports/kover/report.xml'

@mi-kas
Copy link
Owner

mi-kas commented Aug 29, 2023

@dubakur Currently only exact paths are supported as we read files in via fs:

const reportXml = await fs.promises.readFile(path.trim(), 'utf-8')

But at first glance dynamic paths should also possible by using a library like glob (https://github.com/isaacs/node-glob) or glob-fs (https://github.com/micromatch/glob-fs). Feel free to open a PR for this feature

@liedQM
Copy link

liedQM commented Jan 22, 2024

Any update here? We have a big mono repo with a lot of modules and its hard to pre know all report files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants