@cypress/github-action 5.7.2 → 5.8.1
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 +45 -43
- package/action.yml +3 -1
- package/dist/index.js +6 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
|
|
56
56
|
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.
|
|
57
57
|
|
|
58
|
+
Live examples, such as [example-basic.yml](.github/workflows/example-basic.yml) are shown together with a status badge. Click on the status badge to read the source code of the workflow, for example
|
|
59
|
+
|
|
60
|
+
[](.github/workflows/example-basic.yml)
|
|
61
|
+
|
|
58
62
|
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.
|
|
59
63
|
|
|
60
64
|
**Note:** this package assumes that [cypress](https://www.npmjs.com/package/cypress) is declared as a development dependency in the [package.json](https://docs.npmjs.com/creating-a-package-json-file) file. The [cypress npm module](https://www.npmjs.com/package/cypress) is required to run Cypress via its [Module API](https://on.cypress.io/module-api).
|
|
@@ -262,7 +266,7 @@ jobs:
|
|
|
262
266
|
CYPRESS_port: 4222
|
|
263
267
|
```
|
|
264
268
|
|
|
265
|
-
For more examples, see the
|
|
269
|
+
For more examples, see the workflows below, using environment variables for [recording](#record-test-results-on-cypress-cloud).
|
|
266
270
|
|
|
267
271
|
[](.github/workflows/example-env.yml)
|
|
268
272
|
|
|
@@ -287,7 +291,7 @@ jobs:
|
|
|
287
291
|
spec: cypress/e2e/spec1.cy.js
|
|
288
292
|
```
|
|
289
293
|
|
|
290
|
-
You can pass multiple specs and wild card patterns using multi-line parameter, see [example-config.yml](
|
|
294
|
+
You can pass multiple specs and wild card patterns using multi-line parameter, see [example-config.yml](.github/workflows/example-config.yml):
|
|
291
295
|
|
|
292
296
|
```yml
|
|
293
297
|
spec: |
|
|
@@ -345,13 +349,13 @@ jobs:
|
|
|
345
349
|
|
|
346
350
|
[](.github/workflows/example-recording.yml)
|
|
347
351
|
|
|
348
|
-
**Tip 1:** We recommend using the action with `on:
|
|
352
|
+
**Tip 1:** We recommend using the action with `on: push` instead of `on: pull_request` to get the most accurate information related to the commit on Cypress Cloud. With pull requests, the merge commit is created automatically and might not correspond to a meaningful commit in the repository.
|
|
349
353
|
|
|
350
354
|
**Tip 2:** we recommend passing the `GITHUB_TOKEN` secret (created by the GH Action automatically) as an environment variable. This will allow correctly identifying every build and avoid confusion when re-running a build.
|
|
351
355
|
|
|
352
356
|
**Tip 3:** if running on `pull_request` event, the commit message is "merge SHA into SHA", which is not what you want probably. You can overwrite the commit message sent to Cypress Cloud by setting an environment variable. See [issue 124](https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260) for details.
|
|
353
357
|
|
|
354
|
-
**Tip 4:** to record the project needs `projectId`. Typically this value is saved in the
|
|
358
|
+
**Tip 4:** to record the project needs `projectId`. Typically this value is saved in the [Cypress Configuration File](https://docs.cypress.io/guides/references/configuration#Configuration-File). If you want to avoid this, pass the `projectId` using an environment variable:
|
|
355
359
|
|
|
356
360
|
```yml
|
|
357
361
|
name: Cypress tests
|
|
@@ -390,7 +394,7 @@ jobs:
|
|
|
390
394
|
# let's make sure our "app" works on several versions of Node
|
|
391
395
|
strategy:
|
|
392
396
|
matrix:
|
|
393
|
-
node: [16, 18,
|
|
397
|
+
node: [16, 18, 20]
|
|
394
398
|
name: E2E on Node v${{ matrix.node }}
|
|
395
399
|
steps:
|
|
396
400
|
- name: Setup Node
|
|
@@ -453,7 +457,7 @@ See [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration
|
|
|
453
457
|
|
|
454
458
|
### Artifacts
|
|
455
459
|
|
|
456
|
-
If you don't record the test run on Cypress Cloud, you can still store generated videos and screenshots as CI artifacts. See
|
|
460
|
+
If you don't record the test run on Cypress Cloud, you can still store generated videos and screenshots as CI artifacts. See the workflow example below.
|
|
457
461
|
|
|
458
462
|
```yml
|
|
459
463
|
name: Artifacts
|
|
@@ -465,23 +469,19 @@ jobs:
|
|
|
465
469
|
steps:
|
|
466
470
|
- uses: actions/checkout@v3
|
|
467
471
|
- uses: cypress-io/github-action@v5
|
|
468
|
-
# after the test run completes
|
|
469
|
-
# store videos and any screenshots
|
|
470
|
-
# NOTE: screenshots will be generated only if E2E test failed
|
|
471
|
-
# thus we store screenshots only on failures
|
|
472
|
-
# Alternative: create and commit an empty cypress/screenshots folder
|
|
473
|
-
# to always have something to upload
|
|
472
|
+
# after the test run completes store videos and any screenshots
|
|
474
473
|
- uses: actions/upload-artifact@v3
|
|
475
|
-
|
|
474
|
+
# add the line below to store screenshots only on failures
|
|
475
|
+
# if: failure()
|
|
476
476
|
with:
|
|
477
477
|
name: cypress-screenshots
|
|
478
478
|
path: cypress/screenshots
|
|
479
|
-
|
|
479
|
+
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
|
|
480
480
|
- uses: actions/upload-artifact@v3
|
|
481
|
-
if: always()
|
|
482
481
|
with:
|
|
483
482
|
name: cypress-videos
|
|
484
483
|
path: cypress/videos
|
|
484
|
+
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
|
|
485
485
|
```
|
|
486
486
|
|
|
487
487
|
### Quiet flag
|
|
@@ -618,6 +618,8 @@ During staged rollout of a new GitHub-hosted runner version, GitHub may provide
|
|
|
618
618
|
component: true
|
|
619
619
|
```
|
|
620
620
|
|
|
621
|
+
See the example project [component-test](examples/component-tests/) and the [example-component-test.yml](.github/workflows/example-component-test.yml) workflow for more details.
|
|
622
|
+
|
|
621
623
|
### Build app
|
|
622
624
|
|
|
623
625
|
You can run a build step before starting tests
|
|
@@ -639,7 +641,7 @@ jobs:
|
|
|
639
641
|
|
|
640
642
|
### Start server
|
|
641
643
|
|
|
642
|
-
If your tests run against a local server, use `start` parameter
|
|
644
|
+
If your tests run against a local server, use the `start` parameter to start your server. The server will run in the background.
|
|
643
645
|
|
|
644
646
|
```yml
|
|
645
647
|
name: With server
|
|
@@ -656,7 +658,7 @@ jobs:
|
|
|
656
658
|
start: npm start
|
|
657
659
|
```
|
|
658
660
|
|
|
659
|
-
**Note:** sometimes on Windows you need to run a different start command. You can use `start-windows` parameter for this
|
|
661
|
+
**Note:** sometimes on Windows you need to run a different start command. You can use the `start-windows` parameter for this.
|
|
660
662
|
|
|
661
663
|
```yml
|
|
662
664
|
name: With server
|
|
@@ -678,7 +680,7 @@ jobs:
|
|
|
678
680
|
|
|
679
681
|
[](.github/workflows/example-start.yml)
|
|
680
682
|
|
|
681
|
-
**Note:** GitHub
|
|
683
|
+
**Note:** A server continues to run until the end of the GitHub workflow job that started it. At the end of the job the GitHub workflow runner executes a "Complete job" phase automatically where it terminates any server processes which are still running.
|
|
682
684
|
|
|
683
685
|
### Start multiple servers
|
|
684
686
|
|
|
@@ -733,6 +735,8 @@ jobs:
|
|
|
733
735
|
|
|
734
736
|
[](.github/workflows/example-wait-on.yml)
|
|
735
737
|
|
|
738
|
+
[](.github/workflows/example-webpack.yml) (also uses `wait-on`)
|
|
739
|
+
|
|
736
740
|
By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout in seconds using `wait-on-timeout`.
|
|
737
741
|
|
|
738
742
|
```yml
|
|
@@ -744,7 +748,7 @@ By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout i
|
|
|
744
748
|
wait-on-timeout: 120
|
|
745
749
|
```
|
|
746
750
|
|
|
747
|
-
|
|
751
|
+
|
|
748
752
|
|
|
749
753
|
You can wait for multiple URLs to respond by separating urls with a comma
|
|
750
754
|
|
|
@@ -760,7 +764,7 @@ You can wait for multiple URLs to respond by separating urls with a comma
|
|
|
760
764
|
|
|
761
765
|
The action will wait for the first url to respond, then will check the second url, and so on.
|
|
762
766
|
|
|
763
|
-
You can even use your own command (usually by using `npm`, `yarn`, `npx`) to wait for the server to respond. For example, if you want to use [wait-on](https://github.com/jeffbski/wait-on) utility to ping the server and run the Cypress tests after the server responds:
|
|
767
|
+
You can even use your own command (usually by using `npm`, `yarn`, `npx`) to wait for the server to respond. For example, if you want to use the [wait-on](https://github.com/jeffbski/wait-on) utility to ping the server and run the Cypress tests after the server responds:
|
|
764
768
|
|
|
765
769
|
```yml
|
|
766
770
|
- uses: cypress-io/github-action@v5
|
|
@@ -834,7 +838,7 @@ steps:
|
|
|
834
838
|
|
|
835
839
|
**Caution**: using the action parameter `command` causes multiple other parameters to be ignored including: `auto-cancel-after-failures`, `browser`, `ci-build-id`, `command-prefix`, `component`, `config`, `config-file`, `env`, `group`, `headed`, `parallel`, `project`, `publish-summary`, `quiet`, `record`, `spec` and `tag`.
|
|
836
840
|
|
|
837
|
-
See [
|
|
841
|
+
See [example-custom-command.yml](.github/workflows/example-custom-command.yml) file.
|
|
838
842
|
|
|
839
843
|
### Custom build id
|
|
840
844
|
|
|
@@ -868,7 +872,7 @@ jobs:
|
|
|
868
872
|
|
|
869
873
|
### Robust custom build id
|
|
870
874
|
|
|
871
|
-
If you re-run the GitHub workflow, if you use the same custom build id during recording, Cypress Cloud will cancel the run with "Build already finished" error. To avoid this, you need to generate a _new_ custom build id on every workflow re-run. A good solution showing in the [example-custom-ci-build-id.yml](
|
|
875
|
+
If you re-run the GitHub workflow, if you use the same custom build id during recording, Cypress Cloud will cancel the run with "Build already finished" error. To avoid this, you need to generate a _new_ custom build id on every workflow re-run. A good solution showing in the [example-custom-ci-build-id.yml](.github/workflows/example-custom-ci-build-id.yml) file is to run a common job first that just generates a new random ID. This ID can be used by the testing jobs to tie the build together. If the user re-runs the workflow a new unique build id is generated, allowing recording the new Cypress Cloud run.
|
|
872
876
|
|
|
873
877
|
```yml
|
|
874
878
|
jobs:
|
|
@@ -897,7 +901,7 @@ jobs:
|
|
|
897
901
|
CYPRESS_RECORD_KEY: ${{ secrets.EXAMPLE_RECORDING_KEY }}
|
|
898
902
|
```
|
|
899
903
|
|
|
900
|
-
See the [example-custom-ci-build-id.yml](
|
|
904
|
+
See the [example-custom-ci-build-id.yml](.github/workflows/example-custom-ci-build-id.yml) for the full workflow.
|
|
901
905
|
|
|
902
906
|
### Working directory
|
|
903
907
|
|
|
@@ -1050,8 +1054,6 @@ jobs:
|
|
|
1050
1054
|
working-directory: examples/yarn-classic
|
|
1051
1055
|
```
|
|
1052
1056
|
|
|
1053
|
-
See [example-yarn-classic.yml](.github/workflows/example-yarn-classic.yml) for an example.
|
|
1054
|
-
|
|
1055
1057
|
[](.github/workflows/example-yarn-classic.yml)
|
|
1056
1058
|
|
|
1057
1059
|
### Yarn Modern
|
|
@@ -1074,13 +1076,11 @@ jobs:
|
|
|
1074
1076
|
install-command: yarn install
|
|
1075
1077
|
```
|
|
1076
1078
|
|
|
1077
|
-
See [example-yarn-modern.yml](.github/workflows/example-yarn-modern.yml) for an example.
|
|
1078
|
-
|
|
1079
1079
|
[](.github/workflows/example-yarn-modern.yml)
|
|
1080
1080
|
|
|
1081
1081
|
### Yarn Plug'n'Play
|
|
1082
1082
|
|
|
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
|
|
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).
|
|
1084
1084
|
|
|
1085
1085
|
```yaml
|
|
1086
1086
|
name: example-yarn-modern-pnp
|
|
@@ -1096,7 +1096,7 @@ jobs:
|
|
|
1096
1096
|
with:
|
|
1097
1097
|
working-directory: examples/yarn-modern-pnp
|
|
1098
1098
|
install-command: yarn install
|
|
1099
|
-
command: yarn
|
|
1099
|
+
command: yarn cypress run
|
|
1100
1100
|
```
|
|
1101
1101
|
|
|
1102
1102
|
[](https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml)
|
|
@@ -1141,7 +1141,7 @@ jobs:
|
|
|
1141
1141
|
# let's make sure our "app" works on several versions of Node
|
|
1142
1142
|
strategy:
|
|
1143
1143
|
matrix:
|
|
1144
|
-
node: [16, 18,
|
|
1144
|
+
node: [16, 18, 20]
|
|
1145
1145
|
name: E2E on Node v${{ matrix.node }}
|
|
1146
1146
|
steps:
|
|
1147
1147
|
- name: Setup Node
|
|
@@ -1175,7 +1175,7 @@ jobs:
|
|
|
1175
1175
|
runs-on: ubuntu-22.04
|
|
1176
1176
|
strategy:
|
|
1177
1177
|
matrix:
|
|
1178
|
-
node: [16, 18,
|
|
1178
|
+
node: [16, 18, 20]
|
|
1179
1179
|
name: E2E on Node v${{ matrix.node }}
|
|
1180
1180
|
steps:
|
|
1181
1181
|
- uses: actions/setup-node@v3
|
|
@@ -1214,7 +1214,7 @@ jobs:
|
|
|
1214
1214
|
working-directory: e2e
|
|
1215
1215
|
```
|
|
1216
1216
|
|
|
1217
|
-
See [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) for working example.
|
|
1217
|
+
See [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) for a working example.
|
|
1218
1218
|
|
|
1219
1219
|
### Custom install
|
|
1220
1220
|
|
|
@@ -1238,8 +1238,6 @@ If the project has many dependencies, but you want to install just Cypress you c
|
|
|
1238
1238
|
install: false
|
|
1239
1239
|
```
|
|
1240
1240
|
|
|
1241
|
-
See [.github/workflows/example-install-only.yml](.github/workflows/example-install-only.yml) file.
|
|
1242
|
-
|
|
1243
1241
|
[](.github/workflows/example-install-only.yml)
|
|
1244
1242
|
|
|
1245
1243
|
### Timeouts
|
|
@@ -1267,6 +1265,8 @@ See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-ex
|
|
|
1267
1265
|
<!-- prettier-ignore-start -->
|
|
1268
1266
|
| Name | Description |
|
|
1269
1267
|
| ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
1268
|
+
| [cypress-io/cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) | Runs every API command in Cypress using various CI platforms including GitHub Actions |
|
|
1269
|
+
| [cypress-io/cypress-realworld-app](https://github.com/cypress-io/cypress-realworld-app) | A real-world example payment application. Uses GitHub Actions and CircleCI. |
|
|
1270
1270
|
| [cypress-gh-action-small-example](https://github.com/bahmutov/cypress-gh-action-small-example) (legacy) | Runs tests and records them on Cypress Cloud |
|
|
1271
1271
|
| [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 |
|
|
1272
1272
|
| [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) | Splits install and running tests commands, runs Cypress from sub-folder |
|
|
@@ -1274,7 +1274,7 @@ See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-ex
|
|
|
1274
1274
|
| [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 |
|
|
1275
1275
|
| [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 |
|
|
1276
1276
|
| [cypress-examples](https://github.com/bahmutov/cypress-examples) | Shows separate install job from parallel test jobs |
|
|
1277
|
-
| [cypress-gh-action-split-jobs](https://github.com/bahmutov/cypress-gh-action-split-jobs)
|
|
1277
|
+
| [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 |
|
|
1278
1278
|
<!-- prettier-ignore-end -->
|
|
1279
1279
|
|
|
1280
1280
|
## Notes
|
|
@@ -1308,7 +1308,7 @@ You can set the environment variable using GitHub UI interface, or in the workfl
|
|
|
1308
1308
|
DEBUG: '@cypress/github-action'
|
|
1309
1309
|
```
|
|
1310
1310
|
|
|
1311
|
-
See the [example-debug.yml](
|
|
1311
|
+
See the [example-debug.yml](.github/workflows/example-debug.yml) workflow file.
|
|
1312
1312
|
|
|
1313
1313
|
### Logs from the test runner
|
|
1314
1314
|
|
|
@@ -1357,9 +1357,9 @@ If you add `workflow_dispatch` event to your workflow, you will be able to start
|
|
|
1357
1357
|
|
|
1358
1358
|
### Outputs
|
|
1359
1359
|
|
|
1360
|
-
This action sets a GitHub step output `
|
|
1360
|
+
This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that using a [Custom test command](#custom-test-command) with the `command` parameter overrides the `record` parameter and in this case no `resultsUrl` step output is saved.
|
|
1361
1361
|
|
|
1362
|
-
This is an example of using the step output `
|
|
1362
|
+
This is an example of using the step output `resultsUrl`:
|
|
1363
1363
|
|
|
1364
1364
|
```yml
|
|
1365
1365
|
- name: Cypress tests
|
|
@@ -1377,9 +1377,11 @@ This is an example of using the step output `dashboardUrl`:
|
|
|
1377
1377
|
- name: Print Cypress Cloud URL
|
|
1378
1378
|
run: |
|
|
1379
1379
|
echo Cypress finished with: ${{ steps.cypress.outcome }}
|
|
1380
|
-
echo See results at ${{ steps.cypress.outputs.
|
|
1380
|
+
echo See results at ${{ steps.cypress.outputs.resultsUrl }}
|
|
1381
1381
|
```
|
|
1382
1382
|
|
|
1383
|
+
The GitHub step output `dashboardUrl` is deprecated. Cypress Dashboard is now [Cypress Cloud](https://on.cypress.io/cloud-introduction).
|
|
1384
|
+
|
|
1383
1385
|
[](.github/workflows/example-recording.yml)
|
|
1384
1386
|
|
|
1385
1387
|
**Note:** every GitHub workflow step can have `outcome` and `conclusion` properties. See the GitHub [Contexts](https://docs.github.com/en/actions/learn-github-actions/contexts) documentation section [steps context](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#steps-context). In particular, the `outcome` or `conclusion` value can be `success`, `failure`, `cancelled`, or `skipped` which you can use in any following steps.
|
|
@@ -1451,8 +1453,6 @@ jobs:
|
|
|
1451
1453
|
uses: cypress-io/github-action@v5
|
|
1452
1454
|
```
|
|
1453
1455
|
|
|
1454
|
-
See the [example-cron.yml](./.github/workflows/example-cron.yml) workflow.
|
|
1455
|
-
|
|
1456
1456
|
[](.github/workflows/example-cron.yml)
|
|
1457
1457
|
|
|
1458
1458
|
### Suppress test summary
|
|
@@ -1481,7 +1481,8 @@ jobs:
|
|
|
1481
1481
|
Node.js is required to run this action. The current version `v5` supports:
|
|
1482
1482
|
|
|
1483
1483
|
- **Node.js** 16.x
|
|
1484
|
-
- **Node.js** 18.x
|
|
1484
|
+
- **Node.js** 18.x
|
|
1485
|
+
- **Node.js** 20.x and above
|
|
1485
1486
|
|
|
1486
1487
|
and is generally aligned with [Node.js's release schedule](https://github.com/nodejs/Release).
|
|
1487
1488
|
|
|
@@ -1491,6 +1492,7 @@ See [Releases](https://github.com/cypress-io/github-action/releases) for full de
|
|
|
1491
1492
|
|
|
1492
1493
|
| Version | Changes |
|
|
1493
1494
|
| ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1495
|
+
| v5.8.1 | Examples remove Node.js 19. End of support for Node.js 19. |
|
|
1494
1496
|
| v5.6.2 | Examples add Node.js 20. End of support and removal of Node.js 14 examples. |
|
|
1495
1497
|
| v5.2.0 | Examples add Node.js 19. |
|
|
1496
1498
|
| v5.0.0 | Examples add Node.js 18 and remove Node.js 12. |
|
|
@@ -1501,7 +1503,7 @@ See [Releases](https://github.com/cypress-io/github-action/releases) for full de
|
|
|
1501
1503
|
| v2 | Cypress runs using the [Module API](https://docs.cypress.io/guides/guides/module-api) instead of being started via the command line. |
|
|
1502
1504
|
| v1 | *This version is no longer runnable in GitHub due to security changes.* |
|
|
1503
1505
|
|
|
1504
|
-
*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
|
|
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.*
|
|
1505
1507
|
|
|
1506
1508
|
## Contributing
|
|
1507
1509
|
|
package/action.yml
CHANGED
|
@@ -93,7 +93,9 @@ inputs:
|
|
|
93
93
|
default: false
|
|
94
94
|
outputs:
|
|
95
95
|
dashboardUrl:
|
|
96
|
-
description: 'Cypress
|
|
96
|
+
description: 'Cypress Cloud URL if the run was recorded (deprecated)'
|
|
97
|
+
resultsUrl:
|
|
98
|
+
description: 'Cypress Cloud URL if the run was recorded'
|
|
97
99
|
runs:
|
|
98
100
|
using: 'node16'
|
|
99
101
|
main: 'dist/index.js'
|
package/dist/index.js
CHANGED
|
@@ -75091,7 +75091,7 @@ const runTests = async () => {
|
|
|
75091
75091
|
debug(`Cypress options ${JSON.stringify(cypressOptions)}`)
|
|
75092
75092
|
|
|
75093
75093
|
const onTestsFinished = (testResults) => {
|
|
75094
|
-
const
|
|
75094
|
+
const resultsUrl = testResults.runUrl
|
|
75095
75095
|
process.chdir(startWorkingDirectory)
|
|
75096
75096
|
|
|
75097
75097
|
if (testResults.failures) {
|
|
@@ -75112,14 +75112,15 @@ const runTests = async () => {
|
|
|
75112
75112
|
|
|
75113
75113
|
debug(`Cypress tests: ${testResults.totalFailed} failed`)
|
|
75114
75114
|
|
|
75115
|
-
if (
|
|
75116
|
-
debug(`
|
|
75115
|
+
if (resultsUrl) {
|
|
75116
|
+
debug(`resultsUrl ${resultsUrl}`)
|
|
75117
75117
|
} else {
|
|
75118
|
-
debug('There is no
|
|
75118
|
+
debug('There is no resultsUrl')
|
|
75119
75119
|
}
|
|
75120
75120
|
|
|
75121
75121
|
// we still set the output explicitly
|
|
75122
|
-
core.setOutput('dashboardUrl',
|
|
75122
|
+
core.setOutput('dashboardUrl', resultsUrl) // deprecated and retained for backward compatibility
|
|
75123
|
+
core.setOutput('resultsUrl', resultsUrl) // replacement for dashboardUrl
|
|
75123
75124
|
|
|
75124
75125
|
if (testResults.totalFailed) {
|
|
75125
75126
|
return Promise.reject(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/github-action",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
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,7 +46,7 @@
|
|
|
46
46
|
"supports-color": "9.3.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/node": "18.16.
|
|
49
|
+
"@types/node": "18.16.16",
|
|
50
50
|
"@vercel/ncc": "0.36.1",
|
|
51
51
|
"husky": "8.0.3",
|
|
52
52
|
"markdown-link-check": "3.11.1",
|