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

feat: upgrade to use Node v18, remove v12 #637

Merged
merged 1 commit into from Dec 1, 2022
Merged

Conversation

jaffrepaul
Copy link
Member

@jaffrepaul jaffrepaul commented Nov 21, 2022

BREAKING CHANGE:

Add node v18 support & remove deprecated v12.

  • add node v18, remove deprecated v12 in example-node-versions.yml test matrix
  • add node v18, remove v12 in main.yml
  • bump ncc pkg to fix ERR_OSSL_EVP_UNSUPPORTED errors intruduced in node > node v16 (fix: use sha instead of deprecated md5 for hash algorithm vercel/ncc#868)
  • bump @types/node to latest
  • bump actions/setup-node, actions/checkout to v3 to prevent < v16 deprecation warnings
  • rename tests for clarity

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2022

CLA assistant check
All committers have signed the CLA.

@MikeMcC399
Copy link
Collaborator

@jaffrepaul

@jaffrepaul jaffrepaul changed the title add node 18 to matrix feat: add node 18 to matrix Nov 28, 2022
@jaffrepaul jaffrepaul changed the title feat: add node 18 to matrix feat: upgrade to use Node v18, remove v12 Nov 28, 2022
@jaffrepaul jaffrepaul requested a review from a team November 28, 2022 21:58
@jennifer-shehane
Copy link
Member

@jaffrepaul Are these tests actually running on Node 18? I see the 14, 16, and 18 tests showing v16 in the Cypress test output as the Node version for testing.
Screen Shot 2022-11-29 at 2 37 26 PM

@MikeMcC399
Copy link
Collaborator

Perhaps this would be a good time to update the following?

uses: actions/setup-node@v2 to v3
uses: actions/checkout@v2 to v3

The older versions produce deprecation warnings regarding Node.js 12.

@jaffrepaul
Copy link
Member Author

Perhaps this would be a good time to update the following?

uses: actions/setup-node@v2 to v3 uses: actions/checkout@v2 to v3

The older versions produce deprecation warnings regarding Node.js 12.

@MikeMcC399. I'm hoping to update a number of outdated deps throughout this action soon, including these bumps. That will be treated as a separate effort but I don't mind including these here since it's very related 👍

@jaffrepaul
Copy link
Member Author

jaffrepaul commented Nov 30, 2022

@jennifer-shehane I believe that output is just noting the node version of the GH hosted runner (2.299.1) that runs the workflows. The tooling there can change over time. We do specify a v16 runtime in the meta data of our action as required. This is also subject to change once 16 reaches EOL.

As you mentioned the workflow summary shows the correct node version in the setup & echo in each step. Tho it is curious that the output follows those.

@jaffrepaul jaffrepaul merged commit c5724ed into master Dec 1, 2022
@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 2, 2022

@jaffrepaul

There is a tag
https://github.com/cypress-io/github-action/releases/tag/v5.0.0
but no tag
https://github.com/cypress-io/github-action/releases/tag/v5 (as recommended in https://docs.github.com/en/actions/creating-actions/releasing-and-maintaining-actions)
nor a branch
https://github.com/cypress-io/github-action/tree/v5

so specifying cypress-io/github-action@v5 doesn't work.
"Unable to resolve action cypress-io/github-action@v5, unable to find version v5"

Is it intentional not to have released a generic v5 version at the moment?

@MikeMcC399
Copy link
Collaborator

@jennifer-shehane / @jaffrepaul

There seems to be a caching issue with the action. I also see
/opt/hostedtoolcache/node/18.12.1/x64/bin/npx cypress verify
then

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        11.2.0                                                                         │
  │ Browser:        Chrome 107 (headless)                                                          │
  │ Node Version:   v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node)              │

with the wrong Node.js version (v16.13.0) being shown by Cypress instead of the previously selected and expected v18.12.1.

This is using the sequence:

    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

For comparison, if Cypress is called directly then the expected Node,js version 18 is shown in the Cypress log:

┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress:        11.2.0                                                                         │
│ Browser:        Chrome 107 (headless)                                                          │
│ Node Version:   v18.12.1 (/opt/hostedtoolcache/node/18.12.1/x64/bin/node)                      │

executed through:

    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: npm install
        run: npm ci
      - name: Cypress run
        run: npx cypress run -s cypress/e2e/test.cy.js --browser chrome

I guess if this is going to be looked at it should be in a separate new open issue.

@jaffrepaul
Copy link
Member Author

jaffrepaul commented Dec 2, 2022

@jaffrepaul

There is a tag https://github.com/cypress-io/github-action/releases/tag/v5.0.0 but no tag https://github.com/cypress-io/github-action/releases/tag/v5 (as recommended in https://docs.github.com/en/actions/creating-actions/releasing-and-maintaining-actions) nor a branch https://github.com/cypress-io/github-action/tree/v5

so specifying cypress-io/github-action@v5 doesn't work. "Unable to resolve action cypress-io/github-action@v5, unable to find version v5"

Is it intentional not to have released a generic v5 version at the moment?

This step is normally handled in CI. There was an issue with the release trigger during merge and it appears some steps didn't take. Will get a look.

@jaffrepaul
Copy link
Member Author

@MikeMcC399 The v5 tag issue is settled. You can now pull in github-action@v5. Digging into the caching issue.

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 2, 2022

@jaffrepaul

The v5 tag issue is settled. You can now pull in github-action@v5.

Thank you very much. I confirm that this now works!

Digging into the caching issue.

That's good! I set up two tests, one with and one without using the action on https://github.com/MikeMcC399/cypress-test-tiny. They use latest versions of everything: Ubuntu 22.04, Node.js 18 (LTS), Cypress 11.2.0 and github-action@v5

Let me know if you prefer to have a separate issue to track this.

Edit: See issue #642 for logs

@jaffrepaul
Copy link
Member Author

@MikeMcC399 separate issue please 👍

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 2, 2022

@jaffrepaul

I hope this is helpful!

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 3, 2022

I don't think this is a cache issue anymore. See #642 (comment).

@MikeMcC399
Copy link
Collaborator

@jennifer-shehane

Are these tests actually running on Node 18? I see the 14, 16, and 18 tests showing v16 in the Cypress test output as the Node version for testing. Screen Shot 2022-11-29 at 2 37 26 PM

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 6, 2022

@jaffrepaul

This step is normally handled in CI. There was an issue with the release trigger during merge and it appears some steps didn't take. Will get a look.

It looks like the problem was that the "BREAKING CHANGE:" text wasn't in the body of the commit c5724ed. I can only see "feat: upgrade to use Node v18, remove v12" in it.

@jaffrepaul
Copy link
Member Author

@MikeMcC399 Indeed, I noticed that after the fact. We're working on getting a number of things updated on our side and appreciate the extra eyes!

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

Successfully merging this pull request may close these issues.

None yet

4 participants