@cypress/github-action 5.8.3 → 6.0.0
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 +52 -28
- package/action.yml +1 -1
- 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
|
|
@@ -113,7 +117,7 @@ See the example project [component-tests](examples/component-tests/) and the [ex
|
|
|
113
117
|
|
|
114
118
|
**Best practice:**
|
|
115
119
|
|
|
116
|
-
Our examples specify using branch [v5](https://github.com/cypress-io/github-action/tree/v5) which is the action's
|
|
120
|
+
Our examples specify using branch [v5](https://github.com/cypress-io/github-action/tree/v5) which is the action's recommended major version:
|
|
117
121
|
|
|
118
122
|
```yml
|
|
119
123
|
- name: Cypress run
|
|
@@ -209,17 +213,19 @@ jobs:
|
|
|
209
213
|
|
|
210
214
|
### Docker image
|
|
211
215
|
|
|
212
|
-
You can run
|
|
216
|
+
You can run the action in a Docker container.
|
|
213
217
|
|
|
214
218
|
```yml
|
|
215
|
-
name:
|
|
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
|
|
221
|
-
#
|
|
222
|
-
container:
|
|
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-
|
|
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
|
[](.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
|
[](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
|
[](.github/workflows/example-node-versions.yml)
|
|
1189
1211
|
|
|
1190
1212
|
### Split install and tests
|
|
@@ -1475,9 +1497,11 @@ jobs:
|
|
|
1475
1497
|
publish-summary: false
|
|
1476
1498
|
```
|
|
1477
1499
|
|
|
1478
|
-
## Node.js
|
|
1500
|
+
## Node.js
|
|
1479
1501
|
|
|
1480
|
-
|
|
1502
|
+
### Support
|
|
1503
|
+
|
|
1504
|
+
Node.js is required to run this action. The currently recommended version `v5` supports:
|
|
1481
1505
|
|
|
1482
1506
|
- **Node.js** 16.x
|
|
1483
1507
|
- **Node.js** 18.x
|
|
@@ -1485,25 +1509,25 @@ 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
|
+
[](.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). `github-action@v5` uses `node16` and `github-action@v6` uses `node20`.
|
|
1519
|
+
|
|
1488
1520
|
## Changelog
|
|
1489
1521
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
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
|
+
- `v6` is provided for early adopters needing full `node20` support
|
|
1527
|
+
- `v5` is the current recommended version
|
|
1528
|
+
- `v4` is the minimum version required for Cypress `10.x` and later
|
|
1529
|
+
|
|
1530
|
+
Pay attention to any GitHub Actions deprecation warnings shown in logs which may recommend updating.
|
|
1507
1531
|
|
|
1508
1532
|
## Contributing
|
|
1509
1533
|
|
package/action.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/github-action",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
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": "
|
|
49
|
+
"@types/node": "20.5.0",
|
|
50
50
|
"@vercel/ncc": "0.36.1",
|
|
51
51
|
"husky": "8.0.3",
|
|
52
52
|
"markdown-link-check": "3.11.1",
|
|
53
|
-
"prettier": "
|
|
53
|
+
"prettier": "3.0.2"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|