Not able to run the tests on Cypress Cloud viaGithub actions
Current behavior
I am currently able to run the tests manually via cypress cloud. But if I trigger via github actions it does not. I tried reaching out to [email protected], but did not get prompt help.
Desired behavior
Whenever the PR push happens to staging my repo should be triggered via Github actions in the Cypress cloud. Even scheduled cron job do not run via cypress cloud
Test code to reproduce
Whenever the PR push happens to staging my repo should be triggered via Github actions in the Cypress cloud.
Even scheduled cron job do not run via cypress cloud
In addition to this, in my local runs I cannot use chrome browser.
Cypress Version
13.12.0
Node version
9.5.1
Operating System
macOS 14.5
Debug Logs
No response
Other
No response
I would recommend updating to the latest Cypress version, we may have resolved the Chrome opening issue since then.
What is the output you're seeing when running Cypress? It's not clear to me the exact error you're encountering.
@janavi-p
You write that you are using Node.js version 9.5.1. Perhaps that was a typo? Check with
node --version
and make sure that you are using a minimum version of 18.x and preferably the 20.x LTS version.
Please post also your GitHub Actions workflow.
v20.13.1. this is the node version.
GitHub Actions ( Cypress Runs) || Getting "Run finished" immediately when "Run Starts" @MikeMcC399
Workflow: jobs: cypress-run: name: 'Cypress Test on Ubuntu' runs-on: ubuntu-latest timeout-minutes: 25 strategy: fail-fast: false # https://github.com/cypress-io/github-action/issues/48 matrix: containers: [1] # Uses 1 parallel instance
steps:
-
name: 'Checkout the repository' uses: actions/checkout@v4 with: ref: main
-
name: 'git branch info' run: | git branch
-
name: 'Building web application to be tested' run: yarn
-
name: Cypress run uses: cypress-io/github-action@v6 with: browser: electron config-file: cypress.config.js spec: "cypress/e2e/specs/regression-specs/staging/**/*.cy.js" group: 'UI-Electron' record: true parallel: true
env: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
@janavi-p
You may be able to get more information about why your workflow is failing if you enable debugging
env:
DEBUG: '@cypress/github-action'
You do not need the line
run: yarn
if your repo has a yarn.lock in it. cypress-io/github-action takes care of installing dependencies.
Please edit the posting of your workflow and use backticks, otherwise your code is displayed as markdown instead of as yaml, for example:
```yml
name: example-basic
# This workflow represents a set of basic End-to-End tests
on:
push:
branches:
- 'master'
and so on
```
This issue could also be transferred to https://github.com/cypress-io/github-action, although at this time there has not been any root cause identified.
The workflow is missing
env:
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@MikeMcC399 Added the Debug line suggested by you. After which the specs are running. In addition, I see Bad credential error whenever I add the following code. With this code, even manual triggers fail with bad credential error. I have set the right token. env: GITHUB_TOKEN: ${{ secrets.TOKEN }}
Attaching the logs for your reference. Please guide. 5_Cypress run.txt
@janavi-p
You write that you have added
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
This is not the same as:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
See
-
Automatic token authentication for an explanation of the
GITHUB_TOKENsecret - Cypress GitHub Action documentation Record test results on Cypress Cloud
I suggest again for you to follow the documentation to avoid your errors.
As per your suggestion, I made the necessary changes. @MikeMcC399
Any particular reason why the run time has increased ( 25 mins to run 2 specs ) which leads to cancellation of operation ( triggered via scheduled job and via ci/cd)
However, it runs 18 specs in 25 mins via triggered manually.
@janavi-p If you run Cypress in debug mode mode and print the entire set of logs here, that might reveal where the test is sitting for so long.
This issue is stale since there has been no reply for one month.