From cfe7ae36d82941fc0967b105783af3536520d3bf Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Wed, 12 Apr 2023 09:22:12 +0200 Subject: [PATCH] fix gha docker example --- .../continuous-integration/github-actions.mdx | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/guides/continuous-integration/github-actions.mdx b/docs/guides/continuous-integration/github-actions.mdx index aa47991d4f..e9a31f99d1 100644 --- a/docs/guides/continuous-integration/github-actions.mdx +++ b/docs/guides/continuous-integration/github-actions.mdx @@ -154,18 +154,18 @@ the above example to select Chrome instead of the default browser Electron, add For more examples, see the action's [Browser](https://github.com/cypress-io/github-action#browser) section. -## Testing in Chrome and Firefox with Cypress Docker Images +## Testing with Cypress Docker Images GitHub Actions provides the option to specify a container image for the job. Cypress offers various [Docker Images](https://github.com/cypress-io/cypress-docker-images) for running Cypress locally and in CI. -Below we add the `container` attribute using a +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 and Firefox. For example, this allows us to run the -tests in Firefox by passing the `browser: firefox` attribute to the -[Cypress GitHub Action](https://github.com/marketplace/actions/cypress-io). +built with Google Chrome `107`. This allows us to fix our test to a specific +browser version without any influence due to browser version changes in the +GitHub runner image. ```yaml name: Cypress Tests using Cypress Docker Image @@ -175,18 +175,16 @@ on: push jobs: cypress-run: runs-on: ubuntu-22.04 - container: cypress/browsers:node12.18.3-chrome87-ff82 + container: cypress/browsers:node18.12.0-chrome107 steps: - name: Checkout uses: actions/checkout@v3 - - # Install NPM dependencies, cache them correctly - # and run all Cypress tests - name: Cypress run uses: cypress-io/github-action@v5 with: - # Specify Browser since container image is compiled with Firefox - browser: firefox + build: npm run build + start: npm start + browser: chrome ``` ## Caching Dependencies and Build Artifacts