@cypress/github-action 7.4.3 → 7.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -188,7 +188,11 @@ jobs:
188
188
 
189
189
  ### Chrome for Testing
190
190
 
191
- To install [Google Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/), specify a partial or full numerical Chrome for Testing version using [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome). Refer to [Chrome for Testing availability](https://googlechromelabs.github.io/chrome-for-testing/) for current versions or [JSON API endpoints](https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints) for all available versions.
191
+ To install [Google Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/)
192
+ use [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome).
193
+ Refer to [Chrome for Testing availability](https://googlechromelabs.github.io/chrome-for-testing/) for current versions
194
+ or [JSON API endpoints](https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints)
195
+ for all available versions.
192
196
 
193
197
  ```yml
194
198
  name: Chrome for Testing
@@ -200,8 +204,6 @@ jobs:
200
204
  steps:
201
205
  - uses: actions/checkout@v7
202
206
  - uses: browser-actions/setup-chrome@v2
203
- with:
204
- chrome-version: 140
205
207
  - uses: cypress-io/github-action@v7
206
208
  with:
207
209
  browser: chrome-for-testing
@@ -317,7 +319,9 @@ Refer to [cypress-io/cypress-docker-images](https://github.com/cypress-io/cypres
317
319
 
318
320
  ### Env
319
321
 
320
- Specify the env argument with `env` parameter
322
+ To pass an environment variable to Cypress <15.10.0 use the action's `env` parameter.
323
+ In Cypress 15.10.0 and above, the `env` is specified for use with secret environment variables.
324
+ It is replaced with the [expose](#expose) action parameter for public, non-sensitive environment variables.
321
325
 
322
326
  ```yml
323
327
  name: Cypress tests
@@ -751,7 +755,9 @@ jobs:
751
755
 
752
756
  **Note:** Cypress parallelization requires a [Cypress Cloud](https://on.cypress.io/cloud-introduction) account.
753
757
 
754
- You can spin multiple containers running in parallel using `strategy: matrix` argument. Just add more dummy items to the `containers: [1, 2, ...]` array to spin more free or paid containers. Then use `record` and `parallel` parameters to [load balance tests](https://on.cypress.io/parallelization).
758
+ You can spin multiple jobs running in parallel using the `strategy: matrix` argument.
759
+ Just add more dummy items to the `recording-job: [1, 2, ...]` array to create multiple job runs.
760
+ Then use `record` and `parallel` parameters to [load balance tests](https://on.cypress.io/parallelization).
755
761
 
756
762
  ```yml
757
763
  name: Parallel Cypress Tests
@@ -768,13 +774,16 @@ jobs:
768
774
  fail-fast: false
769
775
  matrix:
770
776
  # run 3 copies of the current job in parallel
771
- containers: [1, 2, 3]
777
+ recording-job: [1, 2, 3]
778
+ container:
779
+ image: cypress/browsers:latest
780
+ options: --user 1001
772
781
  steps:
773
782
  - name: Checkout
774
783
  uses: actions/checkout@v7
775
784
 
776
785
  # because of "record" and "parallel" parameters
777
- # these containers will load balance all found tests among themselves
786
+ # these jobs will load balance all found tests among themselves
778
787
  - name: Cypress run
779
788
  uses: cypress-io/github-action@v7
780
789
  with:
@@ -784,14 +793,18 @@ jobs:
784
793
  env:
785
794
  # pass the Cypress Cloud record key as an environment variable
786
795
  CYPRESS_RECORD_KEY: ${{ secrets.EXAMPLE_RECORDING_KEY }}
787
- # Recommended: pass the GitHub token lets this action correctly
796
+ # Recommended: passing the GitHub token lets this action correctly
788
797
  # determine the unique run id necessary to re-run the checks
789
798
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
790
799
  ```
791
800
 
792
801
  ![Parallel run](images/parallel.png)
793
802
 
794
- The Cypress GH Action does not spawn or create any additional containers - it only links the multiple containers spawned using the matrix strategy into a single logical Cypress Cloud run where it splits the specs amongst the machines. See the [Cypress Cloud Smart Orchestration](https://docs.cypress.io/cloud/features/smart-orchestration/overview/) guide for a detailed explanation.
803
+ The Cypress GitHub Action does not spawn or create any additional jobs -
804
+ it only links the multiple jobs spawned using the matrix strategy into a single logical Cypress Cloud run
805
+ where it splits the specs amongst the machines.
806
+ See the [Cypress Cloud Smart Orchestration](https://docs.cypress.io/cloud/features/smart-orchestration/overview/) guide
807
+ for a detailed explanation.
795
808
 
796
809
  If you use the GitHub Actions facility for [Re-running workflows and jobs](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs), note that [Re-running failed jobs in a workflow](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs?tool=webui#re-running-failed-jobs-in-a-workflow) is not suited for use with parallel recording into Cypress Cloud. Re-running failed jobs in this situation does not simply re-run failed Cypress tests. Instead it re-runs **all** Cypress tests, load-balanced over the containers with failed jobs.
797
810
 
@@ -800,7 +813,17 @@ To optimize runs when there are failing tests present, refer to optional [Cypres
800
813
  - [Spec Prioritization](https://docs.cypress.io/cloud/features/smart-orchestration/spec-prioritization)
801
814
  - [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration/run-cancellation). See also [Auto cancel after failures](#auto-cancel-after-failures) for details of how to set this option in a Cypress GitHub Action workflow.
802
815
 
803
- During staged rollout of a new GitHub-hosted runner version, GitHub may provide a mixture of current and new image versions used by the container matrix. It is recommended to use a [Docker image](#docker-image) in the parallel job run which avoids any Cypress Cloud errors due to browser major version mismatch from the two different image versions. A [Docker image](#docker-image) is not necessary if testing against the default built-in Electron browser because this browser version is fixed by the Cypress version in use and it is unaffected by any GitHub runner image rollout.
816
+ During staged rollout of a new [GitHub-hosted runner image](https://github.com/actions/runner-images#readme) version,
817
+ GitHub may provide a mixture of current and new image versions used by the job matrix.
818
+ When running parallel jobs under GitHub-hosted Ubuntu runner images,
819
+ it is recommended to use a [Docker image](#docker-image)
820
+ to avoid any Cypress Cloud errors due to browser major version mismatch between the current and new image versions.
821
+
822
+ Avoid using parallel jobs with GitHub-hosted macOS or Windows runner images,
823
+ since there is currently no workaround for the deployment mismatch issue.
824
+ On macOS the problem can also occur when there is an upgrade to the macOS version.
825
+
826
+ [![recording example](https://github.com/cypress-io/github-action/actions/workflows/example-recording.yml/badge.svg)](.github/workflows/example-recording.yml)
804
827
 
805
828
  ### Component and E2E Testing
806
829
 
@@ -1063,7 +1086,10 @@ jobs:
1063
1086
  strategy:
1064
1087
  matrix:
1065
1088
  # run 3 copies of the current job in parallel
1066
- containers: [1, 2, 3]
1089
+ recording-job: [1, 2, 3]
1090
+ container:
1091
+ image: cypress/browsers:latest
1092
+ options: --user 1001
1067
1093
  steps:
1068
1094
  - uses: actions/checkout@v7
1069
1095
  - uses: cypress-io/github-action@v7
@@ -1099,6 +1125,9 @@ jobs:
1099
1125
  run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT
1100
1126
  smoke-tests:
1101
1127
  needs: ['prepare']
1128
+ container:
1129
+ image: cypress/browsers:latest
1130
+ options: --user 1001
1102
1131
  steps:
1103
1132
  - uses: actions/checkout@v7
1104
1133
  - uses: cypress-io/github-action@v7