-
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
Hard coded Node.js version #489
Comments
I can second this issue. It seems to be happening because of this commit, combined with the fact that this action uses the Cypress node API rather than executing it as a CLI command. Not sure exactly how to fix this, but a temporary workaround seems to be adding a
This is a backdoor that ends up running a cypress command like:
Not sure what the side effects of this are (we're still testing it now), but I can confirm that when run this way, it invokes with the system node version rather than the action's node version. |
@rbayliss good shout. In case it's of interest, I found a similar workaround by explicitly adding a |
Just wanted to note that the nature of this issue is about to change a bit, since the bump to Node 16 just got merged into this action: #484. We're likely to still be dealing with unexpected node versions, but probably not v12 anymore. |
…ainer node version instead of the GitHub Action version of node (currently node v16) Per #489 (comment)
This issue is still present in Cypress 10:-(. I use Node 14.x, but some how cypress was falling back to Node 12.x |
…ainer node version instead of the GitHub Action version of node (currently node v16) Per #489 (comment)
Also facing this issue with Cypress 10. |
@h2oearth @willitsw guys please check if you're using a container with an old node version. This is the case in the cypress github action example code.
Here is a list with the available node versions, up to node 17 as of today https://github.com/cypress-io/cypress-docker-images/tree/master/browsers |
This comment was marked as outdated.
This comment was marked as outdated.
Before the In the log I noticed that the reported Node Version is v16:
Which matches the version defined in the action: Lines 99 to 101 in d69252d
Since we are using badeball/cypress-cucumber-preprocessor@v18.0.1, which requires Node v18, because it uses findLastIndex(), the
|
If you want to log your cucumber issue separately, we could take a look to see if there is some workaround which may be used. Edit: We would need a specific example which is failing in There is an old comment in this issue from me which I wrote before I began to understand how the JavaScript action GitHub has been asked to provide a later Node.js version after Node.js Probably this issue (#489) should be closed, because it is an architectural restriction of |
Using the github-action command option, Cypress can be run using the Node.js version set up in the runner instead of Please note however the restrictions described in the README for command, as this option by-passes many other options. It should give you a workaround for badeball/cypress-cucumber-preprocessor until GitHub provides a migration path to later Node.js versions. If you have questions about this, I suggest moving to a separate issue for clarity. |
I read through this issue. Is there something for us to do in our GH Action? It looks like you can choose the version from the ones GH supports. I'm not entirely clear if 18 is supported right now (conflicting info). If it is, you should be able to choose that one. If not, it would be blocked, but not by us. |
|
Looks like documenting this is the only actionable item here. Thanks for the PR! |
Looks like we are at the mercy of GH to give us Node.js 18 in their actions. I think the PR doc clarifies; i don't see an other work to do at this point in time, so I will close this. |
Sorry to reply in a closed issue, but this still has more to discuss and I feel it's the correct issue for that. @MikeMcC399 from reading #642 and your comments in other issues, I fully understand why
Yes, but as you point out, then almost all other options are irrelevant. This - name: 'Run end-to-end tests'
id: cypress
timeout-minutes: 15 # must be adjusted with e2e tests progress
uses: cypress-io/github-action@v5
env:
ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu' # see https://github.com/cypress-io/cypress/issues/25357
with:
working-directory: 'e2e-tests'
browser: '${{ steps.setup.outputs.browser }}'
headed: false
config: 'video=false' # see https://github.com/cypress-io/github-action/issues/483
env: 'host="${{ inputs.deployment_url }}",username="${{ inputs.deployment_username }}",password="${{ inputs.deployment_password }}"' must be changed to something like this - name: 'Run end-to-end tests'
id: cypress
timeout-minutes: 15 # must be adjusted with e2e tests progress
uses: cypress-io/github-action@v5
env:
ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu' # see https://github.com/cypress-io/cypress/issues/25357
with:
working-directory: 'e2e-tests'
command: 'npx cypress run -- --e2e --browser ${{ inputs.browser }} --headless --config "video=false" --env "host="${{ inputs.deployment_url }}",username="${{ inputs.deployment_username }}",password="${{ inputs.deployment_password }}""' which is less elegant and prone to issues #272 , #473 and #594 . I tried After reading issue #23 and its resolution through #24 , I tried setting the It didn't work as a way to force using the previous setup Node.js . @MikeMcC399 your replies have been invaluable to understand this GH Action, how to work around some perks and get the most out of it. Kudos! 👍 |
We can definitely accept a PR improving the GH Action! It looks like you tried but no luck. I also don't fully grok why that would fix / make us less prone to those issues.
I think exit code 2 is something to with failed dependencies installation. We can re-open if you think there's a good path forward to properly resolving this. |
Sorry, but I don't have the knowledge to accomplish that. 😓
When using the I understand why the
Before the - name: 'Install dependencies' # see https://docs.cypress.io/guides/continuous-integration/introduction#Dependencies
id: dependencies
run: 'sudo apt-get --quiet --no-install-recommends --assume-yes install libgtk2.0-0 libnotify-dev'
shell: 'bash' Note that the remaining dependencies are already present in the Also note that the exit code matches the number of failed tests. |
The config in
action.yml
overrides any previously set node version (e.g. viaactions/setup-node
):github-action/action.yml
Line 87 in ffbc361
This causes failures if the project requires a more recent version, or it depends on a recent version of @cypress/react >= v5.7.0
Ideally the action should use any version of node already available, or have a configuration switch to explicitly set the desired version (similar to
actions/setup-node
).The text was updated successfully, but these errors were encountered: