anuraag016 / Jest-Coverage-Diff

Jest Coverage report diff as a comment for Pull requests
MIT License
59 stars 46 forks source link

Can't add custom working directory #8

Open jcandrade opened 3 years ago

jcandrade commented 3 years ago

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

anuraag016 commented 3 years ago

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.

jcandrade commented 3 years ago

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!

anuraag016 commented 3 years ago

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 😄

albertodeago commented 1 year ago

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

jcandrade commented 1 year ago

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.

albertodeago commented 1 year ago

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

kevingorry commented 10 months ago

@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