Closed fhnaumann closed 4 months ago
@fhnaumann
In which directory is your lockfile package-lock.json
located?
Its in a subfolder under the root.
root
| - app1
| - app2
| - package-lock.json
| - cypress (...)
I solved it by setting working-directory: app2/
, though I don't really know why this works. As far as I know working-directory
does nothing for actions that use uses:
, only for run:
commands. Somewhere deep in your example files I found this syntax. I don't use project:
at all with this as it messes with the path.
@fhnaumann
For your repo structure, with the lockfile in a sub-directory, the Cypress GitHub Action option working-directory
is the correct option to use. The README documentation section working-directory
describes how this works.
The Cypress GitHub Action option project
expects to find a lockfile in the root of the repository. This is the reason for your original error message. The Cypress CLI documenation provides an example structure under cypress-io/cypress-test-nested-projects to demonstrate this.
Please let us know if you think that there are any errors in the documentation, otherwise I suggest to close this issue since you say that you have solved your issue by changing the workflow parameters.
Thanks for your clarification. I don't know how I missed the big working-directory
section in the README...
@fhnaumann
Thanks for your clarification.
You're welcome! 🙂
I don't know how I missed the big
working-directory
section in the README...
The documentation for the project
option could be improved to make it clearer. I will put that on my to-do list.
I have a monorepo and in one folder of main repo I have my website with cypress tests. I want to use this action to run e2e tests in the folder.
This workflow fails in the cypress run step with the following message:
I suspect this is because the action tries to do stuff in the root folder and not the specified subfolder. How can I solve this?