Runner externals Node.js version v16.13.0 always used in GHA runs
See original GitHub issueDescription
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.12.1), nor the default version for the runner (v16.18.1).
Cypress shows: v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node)
Default Node.js in runner ubuntu-22.04 runner: v16.18.1
Installed Node.js: 18.12.1 Found in cache @ /opt/hostedtoolcache/node/18.12.1/x64
Steps to reproduce
Environment: GitHub runner: ubuntu-22.04 Node.js: lts/hydrogen (18.12.1) Cypress: 11.2.0 github-action: v5.0.0
Run action with following core instructions:
runs-on: ubuntu-22.04
env:
NO_COLOR: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js 18 environment
uses: actions/setup-node@v3
with:
node-version: 'lts/hydrogen'
- name: Cypress run
uses: cypress-io/github-action@v5.0.0
with:
spec: cypress/e2e/spec.cy.js
Note that the log shows
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 11.2.0 β
β Browser: Electron 106 (headless) β
β Node Version: v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node) β
β Specs: 1 found (spec.cy.js) β
β Searched: cypress/e2e/spec.cy.js β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The log shows Node.js version v16.13.0 being used by Cypress, although v18.12.1 was installed before the github-action
was called.
Example action to reproduce
- https://github.com/MikeMcC399/cypress-test-tiny/blob/node-test/.github/workflows/cypress-action.yaml
Action log file
Expectation
The action should use the Node.js version installed by actions/setup-node@v3 - in this case 18.12.1 - and not Node.js v16.13.0.
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:6 (6 by maintainers)
Thanks for the legwork @MikeMcC399
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:
lts/hydrogen
(18.12.1) installed, Cypress reports:β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
github-action
always reports theexternals
version v16.13.0 whereas running Cypress in a workflow usingnpx cypress
will report the Node.js version installed by the workflow e.g. 18.12.1. Reference to the documentation for github-action implies that the current behavior of github-action is a bug.