From 265e536597788330502521241e8c89d80df66790 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:02:35 +0200 Subject: [PATCH] update ci example workflows to use Node.js 20.x LTS --- .../continuous-integration/aws-codebuild.mdx | 8 ++++--- .../bitbucket-pipelines.mdx | 8 +++---- .../continuous-integration/github-actions.mdx | 6 +++-- .../continuous-integration/gitlab-ci.mdx | 22 ++++++++++--------- .../continuous-integration/introduction.mdx | 2 +- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/docs/guides/continuous-integration/aws-codebuild.mdx b/docs/guides/continuous-integration/aws-codebuild.mdx index 565e6fea60..e910f439b5 100644 --- a/docs/guides/continuous-integration/aws-codebuild.mdx +++ b/docs/guides/continuous-integration/aws-codebuild.mdx @@ -128,7 +128,7 @@ offers a way to specify an image hosted on DockerHub or the The Cypress team maintains the official [Docker Images](https://github.com/cypress-io/cypress-docker-images) for running -Cypress locally and in CI, which are built with Google Chrome and Firefox. For +Cypress locally and in CI, which are built with Google Chrome, Firefox and Microsoft Edge. For example, this allows us to run the tests in Firefox by passing the `--browser firefox` attribute to `cypress run`. @@ -180,13 +180,15 @@ version: 0.2 ## AWS CodeBuild Batch configuration ## https://docs.aws.amazon.com/codebuild/latest/userguide/batch-build-buildspec.html -## Define build to run using the "cypress/browsers:node18.12.0-chrome106-ff106" image from the Cypress Amazon ECR Public Gallery +## Define build to run using the +## "cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1" image +## from the Cypress Amazon ECR Public Gallery batch: fast-fail: false build-list: - identifier: cypress-e2e-tests env: - image: public.ecr.aws/cypress-io/cypress/browsers:node18.12.0-chrome106-ff106 + image: public.ecr.aws/cypress-io/cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 phases: install: diff --git a/docs/guides/continuous-integration/bitbucket-pipelines.mdx b/docs/guides/continuous-integration/bitbucket-pipelines.mdx index 5035e17eb2..6362099dbe 100644 --- a/docs/guides/continuous-integration/bitbucket-pipelines.mdx +++ b/docs/guides/continuous-integration/bitbucket-pipelines.mdx @@ -61,7 +61,7 @@ example, this allows us to run the tests in Firefox by passing the `--browser firefox` attribute to `cypress run`. ```yaml -image: cypress/browsers:node18.12.0-chrome106-ff106 +image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 pipelines: default: @@ -89,7 +89,7 @@ Artifacts from a job can be defined by providing paths to the `artifacts` attribute. ```yaml -image: cypress/browsers:node18.12.0-chrome106-ff106 +image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 pipelines: default: @@ -153,7 +153,7 @@ recording test results to [Cypress Cloud](/guides/cloud/introduction). ::: ```yaml -image: cypress/base:18.12.1 +image: cypress/base:20.9.0 ## job definition for running E2E tests in parallel e2e: &e2e @@ -212,7 +212,7 @@ definitions: The complete `bitbucket-pipelines.yml` is below: ```yaml -image: cypress/base:18.12.1 +image: cypress/base:20.9.0 ## job definition for running E2E tests in parallel e2e: &e2e diff --git a/docs/guides/continuous-integration/github-actions.mdx b/docs/guides/continuous-integration/github-actions.mdx index 6f8c310004..1506de152a 100644 --- a/docs/guides/continuous-integration/github-actions.mdx +++ b/docs/guides/continuous-integration/github-actions.mdx @@ -173,7 +173,9 @@ Cypress locally and in CI. Below we extend the previous example by adding the `container` attribute using a [Cypress Docker Image](https://github.com/cypress-io/cypress-docker-images) -built with Google Chrome `106`. Specifying a browser version allows our tests to +built with the version of Google Chrome embedded in the tag name of the Docker image +shown as `chrome-xxx`. +Specifying a browser version allows our tests to execute without any influence from browser version changes in the GitHub runner image. @@ -186,7 +188,7 @@ jobs: cypress-run: runs-on: ubuntu-22.04 container: - image: cypress/browsers:node18.12.0-chrome106-ff106 + image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 options: --user 1001 steps: - name: Checkout diff --git a/docs/guides/continuous-integration/gitlab-ci.mdx b/docs/guides/continuous-integration/gitlab-ci.mdx index a56bdae238..770c506981 100644 --- a/docs/guides/continuous-integration/gitlab-ci.mdx +++ b/docs/guides/continuous-integration/gitlab-ci.mdx @@ -69,7 +69,7 @@ example project and place the above GitHub Action configuration in The Cypress team maintains the official [Docker Images](https://github.com/cypress-io/cypress-docker-images) for running -Cypress tests locally and in CI, which are built with Google Chrome and Firefox. +Cypress tests locally and in CI, which are built with Google Chrome, Firefox and Microsoft Edge. For example, this allows us to run the tests in Firefox by passing the `--browser firefox` attribute to `cypress run`. @@ -78,7 +78,7 @@ stages: - test test: - image: cypress/browsers:node18.12.0-chrome106-ff106 + image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 stage: test script: # install dependencies @@ -109,7 +109,7 @@ cache: - .npm/ test: - image: cypress/browsers:node18.12.0-chrome106-ff106 + image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 stage: test script: # install dependencies @@ -161,7 +161,8 @@ assign it to the `build` stage. stages: - build -## Set environment variables for folders in "cache" job settings for npm modules and Cypress binary +## Set environment variables for folders in "cache" job settings +## for npm modules and Cypress binary variables: npm_config_cache: '$CI_PROJECT_DIR/.npm' CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress' @@ -173,9 +174,9 @@ cache: - node_modules - build -## Install NPM dependencies and Cypress +## Install npm dependencies and Cypress install: - image: cypress/browsers:node18.12.0-chrome106-ff106 + image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 stage: build script: - npm ci @@ -204,7 +205,8 @@ stages: - build - test -## Set environment variables for folders in "cache" job settings for npm modules and Cypress binary +## Set environment variables for folders in "cache" job settings +## for npm modules and Cypress binary variables: npm_config_cache: '$CI_PROJECT_DIR/.npm' CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress' @@ -217,15 +219,15 @@ cache: - node_modules - build -## Install NPM dependencies and Cypress +## Install npm dependencies and Cypress install: - image: cypress/browsers:node18.12.0-chrome106-ff106 + image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 stage: build script: - npm ci ui-chrome-tests: - image: cypress/browsers:node18.12.0-chrome106-ff106 + image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1 stage: test parallel: 5 script: diff --git a/docs/guides/continuous-integration/introduction.mdx b/docs/guides/continuous-integration/introduction.mdx index 0feb9a53c0..0ae3612637 100644 --- a/docs/guides/continuous-integration/introduction.mdx +++ b/docs/guides/continuous-integration/introduction.mdx @@ -225,7 +225,7 @@ Mounting a project directory with an existing `node_modules` into a `cypress/base` docker image **will not work**: ```shell -docker run -it -v /app:/app cypress/base:18.12.1 bash -c 'cypress run' +docker run -it -v /app:/app cypress/base:20.9.0 bash -c 'cypress run' Error: the cypress binary is not installed ```