cypress-io / cypress-workshop-ci

A workshop that teaches you how to run Cypress on major CI providers
https://cypress-workshop-ci.netlify.app/
27 stars 21 forks source link

.github/workflows/ci.yml produces multiple deprecations #8

Open MikeMcC399 opened 1 year ago

MikeMcC399 commented 1 year ago

Following the instructions on https://cypress-workshop-ci.netlify.app/?p=generic-ci#/2 produces multiple deprecations.

The instructions are applied to a fork of cypress-io/cypress-workshop-ci-example.

Instructions

The instructions say:

Create new file .github/workflows/ci.yml and paste the following

name: ci
on: [push]
jobs:
  build-and-test:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout ๐Ÿ›Ž
        uses: actions/checkout@v2

      - name: Install dependencies ๐Ÿ“ฆ
        run: npm ci

      - name: Build the app ๐Ÿ—
        run: npm run build

      - name: Start the app ๐Ÿ“ค
        run: npm start &

      - name: Run Cypress tests ๐Ÿงช
        run: npm run cy:run

Results

  1. Cypress is configured to use the legacy version 6.7.1 in package.json
  2. package-lock.json is configured for "lockfileVersion": 1 used by npm v5 and v6. Node.js 14 was the last version with npm v6 bundled and it has been in end-of-life status since Apr 30, 2023. GitHub-hosted runners currently use Node.js 18 LTS as default.
    npm WARN old lockfile
    npm WARN old lockfile The package-lock.json file was created with an old version of npm,
    npm WARN old lockfile so supplemental metadata must be fetched from the registry.
    npm WARN old lockfile
    npm WARN old lockfile This is a one-time fix-up, please be patient...
    npm WARN old lockfile
  3. actions/checkout@v2 causes

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

Suggestion

Since cypress-io/cypress-workshop-ci-example is archived, no updates are possible.

MikeMcC399 commented 1 year ago

The deprecation notice for Node.js 12 is no longer displayed. Instead the action is forced to run under Node.js 16.

MikeMcC399 commented 1 year ago

The deprecation notice for Node.js 12 has changed:

The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

MikeMcC399 commented 9 months ago

Now there are double deprecations:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/