Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress does not pick up Node version set by Action #467

Closed
sergiubcn opened this issue Dec 9, 2021 · 6 comments
Closed

Cypress does not pick up Node version set by Action #467

sergiubcn opened this issue Dec 9, 2021 · 6 comments

Comments

@sergiubcn
Copy link
Contributor

Issue: Cypress does not pick up the NodeJS version set by another GH Action

Versions: Cypress 9.x

Steps to reproduce:

  1. Configure a GH Actions pipeline as follows: (a) set up a NodeJS version other than 12 (which is used by default in the Cypress GH Action) and (b) execute any Cypress test.
  2. Notice the NodeJS version that Cypress uses.

Prerequisites: (a) a GH repo and (b) a GH workflow yml config.

Conclusions: Regardless of the NodeJS version set by actions/setup-node@v2 Cypress still uses the default 12. This is working as expected with Cypress 8.x.

Example: https://github.com/sergiubcn/cy-ci-node/runs/4467813743?check_suite_focus=true
https://github.com/sergiubcn/cy-ci-node/blob/master/.github/workflows/cicd.yml

Note: This does not reproduce locally if setting various NodeJS versions via nvm use.
If it actually turns out to be an issue with Cypress I'll gladly move this ticket to that repo.

@magnetikonline
Copy link

Thanks for reporting @sergiubcn - just like to add we're seeing exactly the same behaviour in our workflows.

@BioCarmen
Copy link

BioCarmen commented Dec 16, 2021

Is that fixed now? I am seeing the same issue when I update cypress to 9.*

@unickq
Copy link

unickq commented Jan 7, 2022

Cypress 9.2.0

jobs:
  cypress-run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: 16
      - run: node -v

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

image

@rbayliss
Copy link

There's another issue filed for this, with a proposed (temporary) workaround: #489 (comment)

@MikeMcC399
Copy link
Collaborator

@sergiubcn

This is an old issue and I wanted to give you some feedback that what you describe is the correct way that github-action works. It is the consequence of using Cypress Module API introduced in github-action@v2. Calling Cypress this way allows Cypress to return detailed results to github-action. It does however tie Cypress to using the version of Node.js which is defined in action.yml. For github-action@v5 this is currently Node.js 16.16.0. GitHub currently only offers the node16 environment for the runs.using option of GitHub JavaScript Actions.

It is now documented in the README > Node.js section.

I suggest to now close this issue as as far as I can see there is nothing which should be corrected in github-action regarding this topic.

@sergiubcn
Copy link
Contributor Author

Thanks for the explanation @MikeMcC399 !
It is a bit counterintuitive, but it definitely helps that it's documented.
I'm closing this issue because it's not blocking me in any way, but if other participants feel this is unsatisfactory for their situation they can reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants