github-action icon indicating copy to clipboard operation
github-action copied to clipboard

does not find cypress.config.js when using Cypress v10

Open alxndr opened this issue 3 years ago • 9 comments

When upgrading to Cypress v10 I saw this error message in CI:

You are attempting to use Cypress with an older config file: cypress.json When you upgraded to Cypress v10.0 the config file was updated and moved to a new location: cypress.config.js You may need to update any CLI scripts to ensure that they are referring the new version. This would typically look something like: "cypress open --config-file=cypress.config.js" https://on.cypress.io/migration-guide

After I added config-file: cypress.config.js the integration works.

alxndr avatar Jun 10 '22 03:06 alxndr

Adding in the config-file setting for me still doesn't work:

   uses: cypress-io/github-action@v2
   with:
          config-file: cypress.config.ts
          record: true
          parallel: true
          group: 'UI - Chrome'
          install-command: yarn --immutable
          browser: chrome
          headless: true
You are attempting to use Cypress with an older config file: cypress.json
When you upgraded to Cypress v10.0 the config file was updated and moved to a new location: cypress.config.ts
You may need to update any CLI scripts to ensure that they are referring the new version. This would typically look something like:
"cypress open --config-file=cypress.config.ts"

ChillyBots avatar Jun 13 '22 15:06 ChillyBots

@ChillyBots update cypress-io/github-action@v2 to v4.1.0

developer-ocansey avatar Jun 14 '22 07:06 developer-ocansey

@developer-ocansey: update cypress-io/github-action@v2 to v4.1.0

This worked for me too, and the new summary looks great! https://github.com/alxndr/almost-dead-net/actions/runs/2496531182

What's the recommended way to be notified of new versions of the action?

Screen Shot 2022-06-14 at 9 23 21 AM

alxndr avatar Jun 14 '22 16:06 alxndr

@alxndr, maybe watching for new releases via https://github.com/cypress-io/github-action/releases might be helpful.

developer-ocansey avatar Jun 14 '22 16:06 developer-ocansey

@developer-ocansey thanks it works for me after change from v2 to v4.1.0

zubairkhanshinwari avatar Jun 16 '22 06:06 zubairkhanshinwari

@ChillyBots update cypress-io/github-action@v2 to v4.1.0

Worked for me! Thanks @developer-ocansey :)

lgenzelis avatar Jun 24 '22 22:06 lgenzelis

@ChillyBots update cypress-io/github-action@v2 to v4.1.0

thanks you're my life saver

SirawichDev avatar Jul 05 '22 23:07 SirawichDev

update cypress-io/github-action@v2 to v4.1.0

silly question, how do I update this?

esbarila avatar Jul 06 '22 19:07 esbarila

update cypress-io/github-action@v2 to v4.1.0

silly question, how do I update this?

Not sure how your cypress tests are set up for GitHub actions but Ideally from your project root .github > workflows > [cypress_test].yaml

You should have this line in jobs > steps

uses: cypress-io/github-action@v[4]

Here is an example of what the file looks like: https://github.com/cypress-io/github-action#basic

developer-ocansey avatar Jul 06 '22 19:07 developer-ocansey

I had the same issue but adding this line config-file: cypress.config.ts fixed the issue and this is the code block:

- name: Run Cypress tests
        uses: cypress-io/github-action@v2
        with:
          config-file: cypress.config.ts
          working-directory: truck_mate_front
          build: npm run build
          start: npm start
          wait-on: 'http://localhost:3000'

medmoe avatar May 14 '23 03:05 medmoe

@medmoe

You are using an old version of the action which is not compatible with Cypress 10 and later versions:

- name: Run Cypress tests
        uses: cypress-io/github-action@v2

Your workaround is unnecessary if you use the current version of the action:

- name: Run Cypress tests
        uses: cypress-io/github-action@v5

v2 will be blocked from executing by GitHub at the end of May 2023. See the CHANGELOG. You should update the version of the action which you are using.

MikeMcC399 avatar May 14 '23 04:05 MikeMcC399

Hi @alxndr

I looked at your https://github.com/alxndr/almost-dead-net/blob/main/.github/workflows/main.yml and you are using cypress-io/[email protected]

so although the issue here is solved, your workflow will soon fail. There is a note in the CHANGELOG which says:

Note: GitHub announced their plan to disable save-state and set-output commands by May 31, 2023. This will prevent cypress-io/github-action version v4.2.1, and earlier, running after this date since they use set-output. Affected users should update to using v5 of the cypress-io/github-action action before the deadline.

Unless you have a reason to tie your workflow to a specific minor version and patch version, then I would recommend using simply cypress-io/github-action@v5. See README > Action version.

I suggest anyway to close this issue as the original problem is resolved.

MikeMcC399 avatar May 14 '23 11:05 MikeMcC399

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

nagash77 avatar May 22 '23 13:05 nagash77