@cypress/github-action 5.8.2 → 5.8.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.
Files changed (3) hide show
  1. package/README.md +49 -26
  2. package/dist/index.js +4 -6
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  > [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm, pnpm and Yarn installation, custom caching and lots of configuration options.
4
4
 
5
+ Placing `use: cypress-io/github-action@v5` into a GitHub Action workflow gives you a simple way to run Cypress. The action takes the project's npm, pnpm or Yarn package manager lock file, installs dependencies and caches these dependencies for future use. It then proceeds to run Cypress end-to-end tests with the built-in Electron browser and provides a test summary after completion.
6
+
7
+ If you are testing against a running server like the [Cypress Kitchen Sink showcase example](https://example.cypress.io/) on https://example.cypress.io/ no other parameters are necessary. In other cases where you need to fire up a development server, you can add the [start](#start-server) parameter to the workflow. Browse through the examples to find other useful parameters.
8
+
5
9
  ## Examples
6
10
 
7
11
  - [End-to-End](#end-to-end-testing) testing
@@ -209,17 +213,19 @@ jobs:
209
213
 
210
214
  ### Docker image
211
215
 
212
- You can run tests in a GH Action in your Docker container.
216
+ You can run the action in a Docker container.
213
217
 
214
218
  ```yml
215
- name: E2E in custom container
219
+ name: Test in Docker
216
220
  on: push
217
221
  jobs:
218
222
  cypress-run:
219
223
  runs-on: ubuntu-22.04
220
- # Cypress Docker image with Chrome v106
221
- # and Firefox v106 pre-installed
222
- container: cypress/browsers:node18.12.0-chrome106-ff106
224
+ # Cypress Docker image from https://hub.docker.com/r/cypress
225
+ # with browsers pre-installed
226
+ container:
227
+ image: cypress/browsers:latest
228
+ options: --user 1001
223
229
  steps:
224
230
  - uses: actions/checkout@v3
225
231
  - uses: cypress-io/github-action@v5
@@ -227,6 +233,12 @@ jobs:
227
233
  browser: chrome
228
234
  ```
229
235
 
236
+ Replace the `latest` tag with a specific version image tag from [`cypress/browsers` on Docker Hub](https://hub.docker.com/r/cypress/browsers/tags) to avoid breaking changes when new images are released (especially when they include new major versions of Node.js).
237
+
238
+ Include `options: --user 1001` to avoid permissions issues.
239
+
240
+ Refer to [cypress-io/cypress-docker-images](https://github.com/cypress-io/cypress-docker-images) for further information about using Cypress Docker images. Cypress offers the [Cypress Docker Factory](https://github.com/cypress-io/cypress-docker-images/tree/master/factory) to generate additional Docker images with selected components and versions.
241
+
230
242
  ### Env
231
243
 
232
244
  Specify the env argument with `env` parameter
@@ -325,6 +337,8 @@ For more information, visit [the Cypress command-line docs](https://on.cypress.i
325
337
 
326
338
  ### Record test results on Cypress Cloud
327
339
 
340
+ By setting the parameter `record` to `true`, you can record your test results into the [Cypress Cloud](https://on.cypress.io/cloud). Read the [Cypress Cloud documentation](https://on.cypress.io/guides/cloud/introduction) to learn how to sign up and create a Cypress Cloud project.
341
+
328
342
  ```yml
329
343
  name: Cypress tests
330
344
  on: push
@@ -657,6 +671,7 @@ jobs:
657
671
  with:
658
672
  start: npm start
659
673
  ```
674
+ **Caution:** use the `start` parameter only to start a server, not to run Cypress, otherwise tests may be run twice. The action runs Cypress tests by default, unless the parameter `runTests` is set to `false`.
660
675
 
661
676
  **Note:** sometimes on Windows you need to run a different start command. You can use the `start-windows` parameter for this.
662
677
 
@@ -1064,7 +1079,7 @@ To install dependencies using a `yarn.lock` file from [Yarn Modern](https://yarn
1064
1079
  name: example-yarn-modern
1065
1080
  on: push
1066
1081
  jobs:
1067
- yarn-classic:
1082
+ yarn-modern:
1068
1083
  runs-on: ubuntu-22.04
1069
1084
  steps:
1070
1085
  - name: Checkout
@@ -1076,11 +1091,14 @@ jobs:
1076
1091
  install-command: yarn install
1077
1092
  ```
1078
1093
 
1094
+ This example covers the [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) configuration `nodeLinker: node-modules` which Yarn uses by default for projects updated from Yarn Classic. For `nodeLinker: pnp` see [Yarn Plug'n'Play](#yarn-plugnplay) below.
1095
+ (Note that `github-action` is not compatible with the `nodeLinker: pnpm` setting.)
1096
+
1079
1097
  [![Yarn Modern example](https://github.com/cypress-io/github-action/workflows/example-yarn-modern/badge.svg?branch=master)](.github/workflows/example-yarn-modern.yml)
1080
1098
 
1081
1099
  ### Yarn Plug'n'Play
1082
1100
 
1083
- When using [Yarn Modern](https://yarnpkg.com/) (Yarn 2 and later) with [Plug'n'Play](https://yarnpkg.com/features/pnp) enabled, you will need to use the `command` parameter to run `yarn` instead of [npx](https://docs.npmjs.com/cli/v9/commands/npx).
1101
+ When using [Yarn Modern](https://yarnpkg.com/) (Yarn 2 and later) with [Plug'n'Play](https://yarnpkg.com/features/pnp) enabled, you will need to use the `command` parameter to run [`yarn`](https://yarnpkg.com/cli/run) instead of [`npx`](https://docs.npmjs.com/cli/v9/commands/npx).
1084
1102
 
1085
1103
  ```yaml
1086
1104
  name: example-yarn-modern-pnp
@@ -1096,9 +1114,11 @@ jobs:
1096
1114
  with:
1097
1115
  working-directory: examples/yarn-modern-pnp
1098
1116
  install-command: yarn install
1099
- command: yarn cypress run
1117
+ command: yarn run --binaries-only cypress run
1100
1118
  ```
1101
1119
 
1120
+ This example covers the [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) configuration when `nodeLinker` is undefined or set to `nodeLinker: pnp` corresponding to Yarn Plug'n'Play. Yarn uses this by default for projects newly created with Yarn Modern.
1121
+
1102
1122
  [![Yarn Plug'n'Play example](https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml/badge.svg?branch=master)](https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml)
1103
1123
 
1104
1124
  **Caution**: using the action parameter `command` causes multiple other parameters to be ignored. [See `command` section for more information.](#custom-test-command)
@@ -1185,6 +1205,8 @@ jobs:
1185
1205
  - uses: cypress-io/github-action@v5
1186
1206
  ```
1187
1207
 
1208
+ See the [Node.js](#nodejs) section for information about supported versions and usage of Node.js.
1209
+
1188
1210
  [![Node versions example](https://github.com/cypress-io/github-action/workflows/example-node-versions/badge.svg?branch=master)](.github/workflows/example-node-versions.yml)
1189
1211
 
1190
1212
  ### Split install and tests
@@ -1475,7 +1497,9 @@ jobs:
1475
1497
  publish-summary: false
1476
1498
  ```
1477
1499
 
1478
- ## Node.js Support
1500
+ ## Node.js
1501
+
1502
+ ### Support
1479
1503
 
1480
1504
  Node.js is required to run this action. The current version `v5` supports:
1481
1505
 
@@ -1485,25 +1509,24 @@ Node.js is required to run this action. The current version `v5` supports:
1485
1509
 
1486
1510
  and is generally aligned with [Node.js's release schedule](https://github.com/nodejs/Release).
1487
1511
 
1512
+ ### Usage
1513
+
1514
+ `github-action` command-type options such as [`install-command`](https://github.com/cypress-io/github-action#custom-install-command), [`build`](https://github.com/cypress-io/github-action#build-app), [`start`](https://github.com/cypress-io/github-action#start-server) and [`command`](https://github.com/cypress-io/github-action#custom-test-command) are executed with the runner's version of Node.js. You can use GitHub's [actions/setup-node](https://github.com/actions/setup-node) to install an explicit Node.js version into the runner.
1515
+
1516
+ [![Node versions example](https://github.com/cypress-io/github-action/workflows/example-node-versions/badge.svg?branch=master)](.github/workflows/example-node-versions.yml)
1517
+
1518
+ Cypress itself runs with a fixed Node.js version specified by the [runs.using](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions) parameter of [action.yml](action.yml). For `github-action@v5` this is `node16`.
1519
+
1488
1520
  ## Changelog
1489
1521
 
1490
- See [Releases](https://github.com/cypress-io/github-action/releases) for full details of changes.
1491
-
1492
- | Version | Changes |
1493
- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
1494
- | v5.8.1 | Examples remove Node.js 19. End of support for Node.js 19. |
1495
- | v5.8.0 | Add GitHub step output `resultsUrl`. Deprecate `dashboardUrl`. |
1496
- | v5.6.2 | Examples add Node.js 20. End of support and removal of Node.js 14 examples. |
1497
- | v5.2.0 | Examples add Node.js 19. |
1498
- | v5.0.0 | Examples add Node.js 18 and remove Node.js 12. |
1499
- | v4.2.2 | Dependency on GitHub `set-output` workflow command removed. |
1500
- | v4.2.0 | Support for `pnpm` added. |
1501
- | v4.0.0 | Support for Cypress 10 and later versions added. |
1502
- | v3 | Action runs under Node.js 16 instead of Node.js 12. |
1503
- | v2 | Cypress runs using the [Module API](https://docs.cypress.io/guides/guides/module-api) instead of being started via the command line. |
1504
- | v1 | *This version is no longer runnable in GitHub due to security changes.* |
1505
-
1506
- *Note: [GitHub announced](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) their plan to disable `save-state` and `set-output` commands. This will prevent [cypress-io/github-action](https://github.com/cypress-io/github-action) version [v4.2.1](https://github.com/cypress-io/github-action/releases/tag/v4.2.1) and earlier from running, since they use `set-output`. Affected users should update to using `v5` of the [cypress-io/github-action](https://github.com/cypress-io/github-action) action.*
1522
+ View the [CHANGELOG](./CHANGELOG.md) document for an overview of version changes.
1523
+
1524
+ ## Compatibility
1525
+
1526
+ - `v5` is the recommended version of [cypress-io/github-action](https://github.com/cypress-io/github-action)
1527
+ - `v4` is the minimum version required for Cypress `10.x` and later
1528
+
1529
+ Pay attention to any GitHub Actions deprecation warnings shown in logs which may recommend updating.
1507
1530
 
1508
1531
  ## Contributing
1509
1532
 
package/dist/index.js CHANGED
@@ -74457,8 +74457,6 @@ const useYarn = () => fs.existsSync(yarnFilename)
74457
74457
  const usePnpm = () => fs.existsSync(pnpmLockFilename)
74458
74458
  const useNpm = () => fs.existsSync(packageLockFilename)
74459
74459
 
74460
- const runPrefix = useYarn() ? 'yarn' : 'npx'
74461
-
74462
74460
  const lockHash = () => {
74463
74461
  const lockFilename = useYarn()
74464
74462
  ? yarnFilename
@@ -74637,9 +74635,9 @@ const listCypressBinaries = () => {
74637
74635
  }
74638
74636
 
74639
74637
  core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
74640
- return io.which(runPrefix, true).then((runPath) => {
74638
+ return io.which('npx', true).then((npxPath) => {
74641
74639
  return exec.exec(
74642
- quote(runPath),
74640
+ quote(npxPath),
74643
74641
  ['cypress', 'cache', 'list'],
74644
74642
  cypressCommandOptions
74645
74643
  )
@@ -74656,9 +74654,9 @@ const verifyCypressBinary = () => {
74656
74654
  }
74657
74655
 
74658
74656
  core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
74659
- return io.which(runPrefix, true).then((runPath) => {
74657
+ return io.which('npx', true).then((npxPath) => {
74660
74658
  return exec.exec(
74661
- quote(runPath),
74659
+ quote(npxPath),
74662
74660
  ['cypress', 'verify'],
74663
74661
  cypressCommandOptions
74664
74662
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "5.8.2",
3
+ "version": "5.8.4",
4
4
  "description": "GitHub Action for running Cypress end-to-end and component tests",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -46,11 +46,11 @@
46
46
  "supports-color": "9.3.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "18.16.16",
49
+ "@types/node": "18.17.5",
50
50
  "@vercel/ncc": "0.36.1",
51
51
  "husky": "8.0.3",
52
52
  "markdown-link-check": "3.11.1",
53
- "prettier": "2.8.4"
53
+ "prettier": "3.0.1"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"