@cypress/github-action 5.2.0 → 5.3.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 +43 -17
- package/action.yml +4 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,8 +42,13 @@
|
|
|
42
42
|
- [timeouts](#timeouts) to avoid hanging CI jobs
|
|
43
43
|
- [print Cypress info](#print-cypress-info) like detected browsers
|
|
44
44
|
- [run tests nightly](#nightly-tests) or on any schedule
|
|
45
|
+
- [Suppress test summary](#suppress-test-summary)
|
|
45
46
|
- [more examples](#more-examples)
|
|
46
47
|
|
|
48
|
+
Current examples contained in this repository are based on Cypress 12.x and can be found in the [examples](./examples) directory. Examples for [Legacy Configuration](https://on.cypress.io/guides/references/legacy-configuration) use Cypress `9.7.0` and are kept in the [examples/v9](./examples/v9) directory.
|
|
49
|
+
|
|
50
|
+
Some older **external** examples, linked to by this document, are based solely on Cypress 9 and below and therefore use a [Legacy Configuration](https://on.cypress.io/guides/references/legacy-configuration). These may need modification to be applied to Cypress 10 and later. Each of these external links is listed with a `(legacy)` notation.
|
|
51
|
+
|
|
47
52
|
### Basic
|
|
48
53
|
|
|
49
54
|
```yml
|
|
@@ -437,7 +442,7 @@ See [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration
|
|
|
437
442
|
|
|
438
443
|
### Artifacts
|
|
439
444
|
|
|
440
|
-
If you don't record the test run on Cypress Cloud, you can still store generated videos and screenshots as CI artifacts. See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example) and the workflow example below
|
|
445
|
+
If you don't record the test run on Cypress Cloud, you can still store generated videos and screenshots as CI artifacts. See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example) (legacy) and the workflow example below
|
|
441
446
|
|
|
442
447
|
```yml
|
|
443
448
|
name: Artifacts
|
|
@@ -963,7 +968,7 @@ jobs:
|
|
|
963
968
|
working-directory: e2e
|
|
964
969
|
```
|
|
965
970
|
|
|
966
|
-
See [cypress-gh-action-subfolders](https://github.com/bahmutov/cypress-gh-action-subfolders) for example.
|
|
971
|
+
See [cypress-gh-action-subfolders](https://github.com/bahmutov/cypress-gh-action-subfolders) (legacy) for example.
|
|
967
972
|
|
|
968
973
|
### Yarn workspaces
|
|
969
974
|
|
|
@@ -1082,7 +1087,7 @@ See [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-m
|
|
|
1082
1087
|
|
|
1083
1088
|
### Custom install
|
|
1084
1089
|
|
|
1085
|
-
Finally, you might not need this GH Action at all. For example, if you want to split the NPM dependencies installation from the Cypress binary installation, then it makes no sense to use this action. Instead you can install and cache Cypress yourself. See [cypress-gh-action-split-install](https://github.com/bahmutov/cypress-gh-action-split-install) for working example.
|
|
1090
|
+
Finally, you might not need this GH Action at all. For example, if you want to split the NPM dependencies installation from the Cypress binary installation, then it makes no sense to use this action. Instead you can install and cache Cypress yourself. See [cypress-gh-action-split-install](https://github.com/bahmutov/cypress-gh-action-split-install) (legacy) for a working example.
|
|
1086
1091
|
|
|
1087
1092
|
### Install Cypress only
|
|
1088
1093
|
|
|
@@ -1124,23 +1129,23 @@ jobs:
|
|
|
1124
1129
|
timeout-minutes: 5
|
|
1125
1130
|
```
|
|
1126
1131
|
|
|
1127
|
-
See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example)
|
|
1132
|
+
See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example) (legacy).
|
|
1128
1133
|
|
|
1129
1134
|
### More examples
|
|
1130
1135
|
|
|
1131
1136
|
<!-- prettier-ignore-start -->
|
|
1132
|
-
Name
|
|
1133
|
-
|
|
1134
|
-
[cypress-gh-action-small-example](https://github.com/bahmutov/cypress-gh-action-small-example) | Runs tests and records them on Cypress Cloud
|
|
1135
|
-
[cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example)
|
|
1136
|
-
[cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo)
|
|
1137
|
-
[cypress-gh-action-subfolders](https://github.com/bahmutov/cypress-gh-action-subfolders) | separate folder for Cypress dependencies
|
|
1138
|
-
[cypress-gh-action-split-install](https://github.com/bahmutov/cypress-gh-action-split-install) |
|
|
1139
|
-
[test-personal-site](https://github.com/bahmutov/test-personal-site) | Testing an external website every night and by manually clicking a button
|
|
1140
|
-
[cypress-gh-action-changed-files](https://github.com/bahmutov/cypress-gh-action-changed-files) | Shows how to run different Cypress projects depending on changed files
|
|
1141
|
-
[cypress-examples](https://github.com/bahmutov/cypress-examples)
|
|
1142
|
-
[cypress-gh-action-split-jobs](https://github.com/bahmutov/cypress-gh-action-split-jobs) | Shows a separate install job with the build step, and another job that runs the tests
|
|
1143
|
-
[cypress-react-component-example](https://github.com/bahmutov/cypress-react-component-example) | Run E2E and component tests using this action
|
|
1137
|
+
| Name | Description |
|
|
1138
|
+
| ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
1139
|
+
| [cypress-gh-action-small-example](https://github.com/bahmutov/cypress-gh-action-small-example) (legacy) | Runs tests and records them on Cypress Cloud |
|
|
1140
|
+
| [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example) (legacy) | Uses Yarn, and runs in parallel on several versions of Node, different browsers, and more |
|
|
1141
|
+
| [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) | Splits install and running tests commands, runs Cypress from sub-folder |
|
|
1142
|
+
| [cypress-gh-action-subfolders](https://github.com/bahmutov/cypress-gh-action-subfolders) (legacy) | Has separate folder for Cypress dependencies |
|
|
1143
|
+
| [cypress-gh-action-split-install](https://github.com/bahmutov/cypress-gh-action-split-install) (legacy) | Only install NPM dependencies, then install and cache Cypress binary yourself |
|
|
1144
|
+
| [test-personal-site](https://github.com/bahmutov/test-personal-site) (legacy) | Testing an external website every night and by manually clicking a button |
|
|
1145
|
+
| [cypress-gh-action-changed-files](https://github.com/bahmutov/cypress-gh-action-changed-files) (legacy) | Shows how to run different Cypress projects depending on changed files |
|
|
1146
|
+
| [cypress-examples](https://github.com/bahmutov/cypress-examples) | Shows separate install job from parallel test jobs |
|
|
1147
|
+
| [cypress-gh-action-split-jobs](https://github.com/bahmutov/cypress-gh-action-split-jobs) (legacy) | Shows a separate install job with the build step, and another job that runs the tests |
|
|
1148
|
+
| [cypress-react-component-example](https://github.com/bahmutov/cypress-react-component-example) (legacy) | Run E2E and component tests using this action |
|
|
1144
1149
|
<!-- prettier-ignore-end -->
|
|
1145
1150
|
|
|
1146
1151
|
## Notes
|
|
@@ -1256,7 +1261,7 @@ This GH Action sets an output `dashboardUrl` if the run was recorded on [Cypress
|
|
|
1256
1261
|
|
|
1257
1262
|
### Docker image
|
|
1258
1263
|
|
|
1259
|
-
If your repository does not have `package.json` or `yarn.json` (maybe it contains a static site and does not need any dependencies), you can run Cypress tests using `cypress/included:...` [Cypress Docker images](https://github.com/cypress-io/cypress-docker-images/tree/master/included). In that case you don't even need this GH Action, instead use the Docker container and write `cypress run` command like this example from [cypress-gh-action-included](https://github.com/bahmutov/cypress-gh-action-included)
|
|
1264
|
+
If your repository does not have `package.json` or `yarn.json` (maybe it contains a static site and does not need any dependencies), you can run Cypress tests using `cypress/included:...` [Cypress Docker images](https://github.com/cypress-io/cypress-docker-images/tree/master/included). In that case you don't even need this GH Action, instead use the Docker container and write `cypress run` command like this example from [cypress-gh-action-included](https://github.com/bahmutov/cypress-gh-action-included) (legacy)
|
|
1260
1265
|
|
|
1261
1266
|
```yml
|
|
1262
1267
|
name: included
|
|
@@ -1343,6 +1348,27 @@ See the [example-cron.yml](./.github/workflows/example-cron.yml) workflow.
|
|
|
1343
1348
|
|
|
1344
1349
|
[](.github/workflows/example-cron.yml)
|
|
1345
1350
|
|
|
1351
|
+
### Suppress test summary
|
|
1352
|
+
|
|
1353
|
+
The default test summary can be suppressed by using the parameter `publish-summary` and setting its value to `false`.
|
|
1354
|
+
Sometimes users want to publish test summary using a specific action.
|
|
1355
|
+
For example, a user running Cypress tests using a matrix and wants to retrieve the test summary for each matrix job and use a specific action that merges reports.
|
|
1356
|
+
|
|
1357
|
+
```yml
|
|
1358
|
+
name: Example no summary
|
|
1359
|
+
on: push
|
|
1360
|
+
jobs:
|
|
1361
|
+
cypress-run:
|
|
1362
|
+
runs-on: ubuntu-22.04
|
|
1363
|
+
steps:
|
|
1364
|
+
- name: Checkout
|
|
1365
|
+
uses: actions/checkout@v3
|
|
1366
|
+
- name: Cypress run
|
|
1367
|
+
uses: cypress-io/github-action@v5
|
|
1368
|
+
with:
|
|
1369
|
+
publish-summary: false
|
|
1370
|
+
```
|
|
1371
|
+
|
|
1346
1372
|
## Changelog
|
|
1347
1373
|
|
|
1348
1374
|
See [Releases](https://github.com/cypress-io/github-action/releases) for full details of changes.
|
package/action.yml
CHANGED
|
@@ -65,6 +65,10 @@ inputs:
|
|
|
65
65
|
headed:
|
|
66
66
|
description: 'Whether or not to use headed mode'
|
|
67
67
|
required: false
|
|
68
|
+
publish-summary:
|
|
69
|
+
description: 'Whether or not to publish job summary'
|
|
70
|
+
required: false
|
|
71
|
+
default: true
|
|
68
72
|
spec:
|
|
69
73
|
description: 'Provide a specific specs to run'
|
|
70
74
|
required: false
|
package/dist/index.js
CHANGED
|
@@ -79227,7 +79227,8 @@ const runTests = async () => {
|
|
|
79227
79227
|
|
|
79228
79228
|
// Summary is not available for GitHub Enterprise at the moment
|
|
79229
79229
|
const isSummaryEnabled = () => {
|
|
79230
|
-
|
|
79230
|
+
const isSummaryInput = getInputBool('publish-summary')
|
|
79231
|
+
return process.env[SUMMARY_ENV_VAR] !== undefined && isSummaryInput
|
|
79231
79232
|
}
|
|
79232
79233
|
|
|
79233
79234
|
const generateSummary = async (testResults) => {
|