Jest-Coverage-Diff icon indicating copy to clipboard operation
Jest-Coverage-Diff copied to clipboard

Can't add custom working directory

Open jcandrade opened this issue 4 years ago • 7 comments

I'm working on a monolithic project but I'm not able to use this action. Any chance to add it anytime soon?

jcandrade avatar Jan 27 '21 20:01 jcandrade

Hey @jcandrade 👋🏼, we have added the possibility of adding a custom command for running the jest coverage report, which allows the possibility of giving custom directory, in the new V1.1 Release, do check this out to see if it helps for your use case.

anuraag016 avatar Jan 28 '21 06:01 anuraag016

Hey @anuraag016, indeed, I tested here and it works for my case, thanks. The only thing is that it was throwing and error: Error: ENOENT: no such file or directory, open 'coverage-summary.json' I was able to workaround this by setting the coverageDirectory to the root folder, so I think it's ok. Thank you!

jcandrade avatar Jan 28 '21 20:01 jcandrade

Hey @anuraag016, indeed, I tested here and it works for my case, thanks. The only thing is that it was throwing and error: Error: ENOENT: no such file or directory, open 'coverage-summary.json' I was able to workaround this by setting the coverageDirectory to the root folder, so I think it's ok. Thank you!

Great to hear that it works for you now 😁 Currently there is a dependency on the coverageDirectory to be in the root folder, I will be working on removing this in the near future 😄

anuraag016 avatar Jan 29 '21 10:01 anuraag016

Hey @anuraag016, indeed, I tested here and it works for my case, thanks. The only thing is that it was throwing and error: Error: ENOENT: no such file or directory, open 'coverage-summary.json' I was able to workaround this by setting the coverageDirectory to the root folder, so I think it's ok. Thank you!

@jcandrade I'm having the same issue, how did you managed to fix it? I tried different values on the coverageDirectory but it's not working on my side

albertodeago avatar Oct 09 '23 10:10 albertodeago

Hey @anuraag016, indeed, I tested here and it works for my case, thanks. The only thing is that it was throwing and error: Error: ENOENT: no such file or directory, open 'coverage-summary.json' I was able to workaround this by setting the coverageDirectory to the root folder, so I think it's ok. Thank you!

@jcandrade I'm having the same issue, how did you managed to fix it? I tried different values on the coverageDirectory but it's not working on my side

It's been a while since I had this issue, but I believe the solution @anuraag016 shared (using a custom command) worked for me.

jcandrade avatar Oct 09 '23 14:10 jcandrade

oh yeah, I see, I was able to make it work, it was just a matter of going up some folders... thx

albertodeago avatar Oct 09 '23 14:10 albertodeago

@anuraag016 Since we cannot use "working-directory" because we use runCommand, is there any way you could let us specify a working "path" ? https://stackoverflow.com/questions/58139175/running-actions-in-another-directory

Same way as they use path here :

steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v4
  with:
    name: my-artifact
    path: path/to/artifact/world.txt

kevingorry avatar Jan 09 '24 21:01 kevingorry