Closed ErhartFabian closed 1 year ago
@ErhartFabian
I can see multiple issues in your logs. I suggest that you look at the examples to see how the action should be used. Fork and clone the repository then run the examples.
v4
. The current version is v5
.yarn install v1.22.19
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
/usr/local/bin/npm start
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
You may need to invest some time in taking some Cypress training to understand how the pieces fit together.
https://docs.cypress.io/guides/continuous-integration/github-actions contains some instructions for getting started with the github-action
, however it does assume a working knowledge of Cypress.
There is also a Discord chat available to get help.
To be more explicit about the examples you can compare with
https://github.com/cypress-io/github-action/blob/master/.github/workflows/example-start.yml
uses
start:
# example with web application build,
# server start and waiting for the server
# to respond before running tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress tests
uses: ./
with:
working-directory: examples/start
build: npm run build
start: npm start
wait-on: 'http://localhost:3000'
and it calls on https://github.com/cypress-io/github-action/blob/master/examples/start/package.json with
"scripts": {
"test": "cypress run",
"build": "echo building ... server ... done!",
"start": "serve public",
"start2": "serve -p 8000 public"
},
In order to fix your problems you need to decide whether you want to be using npm
or Yarn
and then delete the lock file which you are not using.
You need to add a start
script to package.json
.
Unless you think that there is a bug in github-action
I would also suggest to close this issue.
@MikeMcC399 thanks! I think that I would use discord, I read the document on cypress but it does not mention anything on the script part of the package.json file thanks for your help!
@ErhartFabian
There is a lot to learn when you start with Cypress.
You can find scripts mentioned in the documentation on https://docs.cypress.io/guides/continuous-integration/introduction
@MikeMcC399 I resolve the package-lock.json and used the script example but I´m still having problems, hope somebody help me on discord :(
@ErhartFabian
It seems that you have some knowledge gaps and you would probably benefit from following a training course.
I have this problem when I try to use github actions (cypress) in a first personal project
does anyone know how to solve it?