https://cypress.io logo
GitHub Actions Failing
# i-need-help
b
I followed the docs at ( https://docs.cypress.io/guides/continuous-integration/github-actions ) and got this response.
Copy code
start server command "npm start"
current working directory "/home/runner/work/Collaboration/Collaboration"
/usr/local/bin/npm start
npm ERR! Missing script: "start"
This is the repo link that is failing. https://github.com/BOT-TC/Collaboration/actions/runs/4748229651/jobs/8434175506#step:3:61
m
Hi @better-carpenter-28878 I can access https://github.com/BOT-TC, but not https://github.com/BOT-TC/Collaboration, so either this repository is private or it does not exist. Did you fork the repository https://github.com/cypress-io/cypress-example-kitchensink as the documentation suggests? You must be working in a repository which has defined the script `start`for `npm start`to be able to work. The `cypress-example-kitchensink`example repo provides such a script.
b
I added the scripts folder with the start script as it is in the example project. It still could not find it. (and I set the access to public, thanks for pointing that out) https://github.com/BOT-TC/Collaboration/actions/runs/4754221288/jobs/8446778471#step:3:65
m
I see that you have tried to combine the start-up example with your repository. That's not quite the intention of the example, which is supposed to be used exactly on the https://github.com/cypress-io/cypress-example-kitchensink repository. You may be better advised to visit the https://github.com/cypress-io/github-action repository. Look at the README and look at the example workflows there. To use the examples it is best to fork and clone the https://github.com/cypress-io/github-action repository. In the github-action repository you can manually run each of the example workflows without needing to edit them. Once you see them working you may better understand how to set up your environment. On https://github.com/BOT-TC/Collaboration/blob/main/package.json there is no script with the name `start`so that cannot work.
b
I did not add the "start" command to the package.json is correct. The example file works, it is my real not example file that is having issues. Found the start item and now the issue has changed, slightly. It says //bin/sh: 1: serve: not found Is it not running on the port it is listening on? https://github.com/BOT-TC/Collaboration/actions/runs/4754884585/jobs/8448275846#step:3:67
m
The scripts folder that you have copied is not designed to be used in general. You should not use that in your environment. If you are using
vite
then your start command is normally
npm run dev
or you can use `start: npx vite --host`as a parameter for github-action.
It is often helpful to check out that your commands work locally if possible before you try to run them in GitHub actions.
b
Working... thanks. I used this. It is the one made to validate the build version. > npm run test:e2e:dev
m
Congratulations 🚀 !
b
Thanks, the obvious eludes us. You gave me two key tips that hopefully will not be blind spots in the future. * start in workflows can call package.json tasks * the same commands that work local typically will work remote
( retro notes )