-
Notifications
You must be signed in to change notification settings - Fork 347
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
Runner externals Node.js version v16.13.0 always used in GHA runs #642
Comments
This is not a new issue. Action logs in this repository show this behaviour already a couple of months ago e.g. For example https://github.com/cypress-io/github-action/actions/runs/3049498633/jobs/4915628273 from Sep 4, 2022: E2E on Node v14
where the test is supposed to be running under Node.js 14 and Cypress reports v16.13.0. |
Since action.yml in cypress-io/github-action branch v5 specifies Lines 90 to 92 in c5724ed
cypress-io/github-action@v5 will make Cypress run under Node.js 16.
It looks like the The Actions documentation Metadata syntax for GitHub Actions describes this: Please check if I have interpreted this correctly. If so, then the README documentation Node versions would need to be reviewed since it seems that cc: @jaffrepaul |
After setting a repository secret
This confirms that The consequence is that:
I don't know what the best solution would be: change the documentation to match the software behavior or modify the A workaround for simple cases would be to call Cypress directly instead of using - name: Cypress run
run: npx cypress run -s cypress/e2e/spec.cy.js (From a practical side for the production repo I am working on, it is not causing any issue to have Cypress run under |
|
There was a breaking change in Cypress 9.0.0, released Nov 10, 2021: https://docs.cypress.io/guides/references/changelog#9-0-0 "The nodeVersion configuration option now defaults to system. The behavior of the system option has changed to always use the Node.js binary/version that launched Cypress. If Cypress was not launched via the terminal, Cypress will use the bundled Node.js version. This could change the behavior of code within your pluginsFile since it may be run in your system Node.js version. Addresses #18684. The nodeVersion configuration option has been deprecated and will be removed in a future release. The bundled Node.js version was upgraded from 14.17.0 to 16.5.0. This could change the behavior of code within the pluginsFile when using the bundled Node.js version of Cypress. Addressed in #18317." Starting from version 9.0.0, when running github-action v5 under ubuntu-22.04 with Node.js: "Node Version: v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node)" In Cypress version 8, the Node.js version was not reported in the results of running Cypress. The issue remains that running Cypress through |
Thanks for the legwork @MikeMcC399 |
JavaScript actions on GitHub can only currently run in So the document here needs updating and any workflows which incorrectly assume that cypress-io/github-action v5 runs in anything other than the specified |
Viewing the logs from https://github.com/cypress-io/github-action/actions/workflows/example-node-versions.yml?query=branch%3Amaster, for instance https://github.com/cypress-io/github-action/actions/runs/3914280111/jobs/6691164116 for "Cypress v10 E2E on Node v18" shows that:
are each executed under Node.js 18.13.0. Only Cypress itself is running under Node.js v16.13.0:
The theme of this issue was that all of the action runs under v16.13.0. I see now that this is incorrect, so I am closing the issue. Any remaining consequences of this mixed-mode use of Node.js should be covered in other issues if necessary. |
|
Description
When github-action is run, the version of Node.js which the Cypress log shows is being used (v16.13.0) is neither the installed version (18.13.0), nor the default version for the runner (v16.19.0).
Cypress shows: v16.13.0
(/home/runner/runners/2.300.2/externals/node16/bin/node)
Default Node.js in runner ubuntu-22.04 runner: v16.19.0
Installed Node.js: 18.13.0
Found in cache @ /opt/hostedtoolcache/node/18.13.0/x64
Steps to reproduce
Environment:
GitHub runner: ubuntu-22.04
Node.js: lts/hydrogen (18.13.0)
Cypress: 12.3.0
github-action: v5.0.5
Run action with following core instructions:
Note that the log shows
The log shows Node.js version v16.13.0 being used by Cypress, although v18.13.0 was installed before the
github-action
was called.Example action to reproduce
Action log file
Expectation
The action should use the Node.js version installed by actions/setup-node@v3 - in this case 18.13.0 - and not Node.js v16.13.0.
The text was updated successfully, but these errors were encountered: