@cypress/github-action 5.1.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 +101 -64
- package/action.yml +4 -0
- package/dist/index.js +2 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
- [Basic](#basic)
|
|
8
8
|
- [Explicit version](#explicit-version)
|
|
9
9
|
- Run tests in a given [browser](#browser)
|
|
10
|
+
- using [Chrome](#chrome)
|
|
10
11
|
- using [Firefox](#firefox)
|
|
11
|
-
- using [Edge](#edge)
|
|
12
|
+
- using [Edge](#edge)
|
|
12
13
|
- using [headed mode](#headed)
|
|
13
14
|
- Using [Docker image](#docker-image)
|
|
14
15
|
- Specify [environment variables](#env)
|
|
@@ -41,13 +42,18 @@
|
|
|
41
42
|
- [timeouts](#timeouts) to avoid hanging CI jobs
|
|
42
43
|
- [print Cypress info](#print-cypress-info) like detected browsers
|
|
43
44
|
- [run tests nightly](#nightly-tests) or on any schedule
|
|
45
|
+
- [Suppress test summary](#suppress-test-summary)
|
|
44
46
|
- [more examples](#more-examples)
|
|
45
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
|
+
|
|
46
52
|
### Basic
|
|
47
53
|
|
|
48
54
|
```yml
|
|
49
55
|
name: End-to-end tests
|
|
50
|
-
on:
|
|
56
|
+
on: push
|
|
51
57
|
jobs:
|
|
52
58
|
cypress-run:
|
|
53
59
|
runs-on: ubuntu-22.04
|
|
@@ -88,15 +94,16 @@ By using the full version tag, you will avoid accidentally using a newer version
|
|
|
88
94
|
|
|
89
95
|
### Browser
|
|
90
96
|
|
|
91
|
-
Specify the browser name or path with `browser` parameter
|
|
97
|
+
Specify the browser name or path with the `browser` parameter. The default browser, if none is specified, is the built-in [Electron browser](https://on.cypress.io/guides/guides/launching-browsers#Electron-Browser).
|
|
98
|
+
|
|
99
|
+
### Chrome
|
|
92
100
|
|
|
93
101
|
```yml
|
|
94
|
-
name:
|
|
95
|
-
on:
|
|
102
|
+
name: Chrome
|
|
103
|
+
on: push
|
|
96
104
|
jobs:
|
|
97
|
-
|
|
105
|
+
chrome:
|
|
98
106
|
runs-on: ubuntu-22.04
|
|
99
|
-
# let's make sure our tests pass on Chrome browser
|
|
100
107
|
name: E2E on Chrome
|
|
101
108
|
steps:
|
|
102
109
|
- uses: actions/checkout@v3
|
|
@@ -109,17 +116,13 @@ jobs:
|
|
|
109
116
|
|
|
110
117
|
### Firefox
|
|
111
118
|
|
|
112
|
-
In order to run Firefox, you need to use non-root user (Firefox security restriction).
|
|
113
|
-
|
|
114
119
|
```yml
|
|
115
120
|
name: Firefox
|
|
116
121
|
on: push
|
|
117
122
|
jobs:
|
|
118
123
|
firefox:
|
|
119
124
|
runs-on: ubuntu-22.04
|
|
120
|
-
|
|
121
|
-
image: cypress/browsers:node18.12.0-chrome106-ff106
|
|
122
|
-
options: --user 1001
|
|
125
|
+
name: E2E on Firefox
|
|
123
126
|
steps:
|
|
124
127
|
- uses: actions/checkout@v3
|
|
125
128
|
- uses: cypress-io/github-action@v5
|
|
@@ -129,16 +132,15 @@ jobs:
|
|
|
129
132
|
|
|
130
133
|
[](.github/workflows/example-firefox.yml)
|
|
131
134
|
|
|
132
|
-
**Note:** the magical user id `1001` works because it matches permissions settings on the home folder, see issue [#104](https://github.com/cypress-io/github-action/issues/104)
|
|
133
|
-
|
|
134
135
|
### Edge
|
|
135
136
|
|
|
136
137
|
```yml
|
|
137
138
|
name: Edge
|
|
138
139
|
on: push
|
|
139
140
|
jobs:
|
|
140
|
-
|
|
141
|
+
edge:
|
|
141
142
|
runs-on: windows-latest
|
|
143
|
+
name: E2E on Edge
|
|
142
144
|
steps:
|
|
143
145
|
- uses: actions/checkout@v3
|
|
144
146
|
- uses: cypress-io/github-action@v5
|
|
@@ -154,7 +156,7 @@ Run the browser in headed mode - as of Cypress v8.0 the `cypress run` command ex
|
|
|
154
156
|
|
|
155
157
|
```yml
|
|
156
158
|
name: Chrome headed
|
|
157
|
-
on:
|
|
159
|
+
on: push
|
|
158
160
|
jobs:
|
|
159
161
|
cypress-run:
|
|
160
162
|
runs-on: ubuntu-22.04
|
|
@@ -172,7 +174,7 @@ You can run tests in a GH Action in your Docker container.
|
|
|
172
174
|
|
|
173
175
|
```yml
|
|
174
176
|
name: E2E in custom container
|
|
175
|
-
on:
|
|
177
|
+
on: push
|
|
176
178
|
jobs:
|
|
177
179
|
cypress-run:
|
|
178
180
|
runs-on: ubuntu-22.04
|
|
@@ -192,7 +194,7 @@ Specify the env argument with `env` parameter
|
|
|
192
194
|
|
|
193
195
|
```yml
|
|
194
196
|
name: Cypress tests
|
|
195
|
-
on:
|
|
197
|
+
on: push
|
|
196
198
|
jobs:
|
|
197
199
|
cypress-run:
|
|
198
200
|
runs-on: ubuntu-22.04
|
|
@@ -210,7 +212,7 @@ When passing the environment variables this way, unfortunately due to GitHub Act
|
|
|
210
212
|
|
|
211
213
|
```yml
|
|
212
214
|
name: Cypress tests
|
|
213
|
-
on:
|
|
215
|
+
on: push
|
|
214
216
|
jobs:
|
|
215
217
|
cypress-run:
|
|
216
218
|
runs-on: ubuntu-22.04
|
|
@@ -235,7 +237,7 @@ Specify the [spec files to run](https://docs.cypress.io/guides/guides/command-li
|
|
|
235
237
|
|
|
236
238
|
```yml
|
|
237
239
|
name: Cypress tests
|
|
238
|
-
on:
|
|
240
|
+
on: push
|
|
239
241
|
jobs:
|
|
240
242
|
cypress-run:
|
|
241
243
|
name: Cypress run
|
|
@@ -266,7 +268,7 @@ Specify the [project to run](https://docs.cypress.io/guides/guides/command-line.
|
|
|
266
268
|
|
|
267
269
|
```yml
|
|
268
270
|
name: Cypress tests
|
|
269
|
-
on:
|
|
271
|
+
on: push
|
|
270
272
|
jobs:
|
|
271
273
|
cypress-run:
|
|
272
274
|
name: Cypress run
|
|
@@ -286,7 +288,7 @@ For more information, visit [the Cypress command-line docs](https://on.cypress.i
|
|
|
286
288
|
|
|
287
289
|
```yml
|
|
288
290
|
name: Cypress tests
|
|
289
|
-
on:
|
|
291
|
+
on: push
|
|
290
292
|
jobs:
|
|
291
293
|
cypress-run:
|
|
292
294
|
name: Cypress run
|
|
@@ -318,7 +320,7 @@ jobs:
|
|
|
318
320
|
|
|
319
321
|
```yml
|
|
320
322
|
name: Cypress tests
|
|
321
|
-
on:
|
|
323
|
+
on: push
|
|
322
324
|
jobs:
|
|
323
325
|
cypress-run:
|
|
324
326
|
name: Cypress run
|
|
@@ -346,7 +348,7 @@ You can provide `quiet` flag for cypress run to silence any Cypress specific out
|
|
|
346
348
|
|
|
347
349
|
```yml
|
|
348
350
|
name: example-quiet
|
|
349
|
-
on:
|
|
351
|
+
on: push
|
|
350
352
|
jobs:
|
|
351
353
|
cypress-run:
|
|
352
354
|
runs-on: ubuntu-22.04
|
|
@@ -370,7 +372,7 @@ You can pass a single or multiple tags when recording a run. For example
|
|
|
370
372
|
|
|
371
373
|
```yml
|
|
372
374
|
name: tags
|
|
373
|
-
on:
|
|
375
|
+
on: push
|
|
374
376
|
jobs:
|
|
375
377
|
cypress-run:
|
|
376
378
|
runs-on: ubuntu-22.04
|
|
@@ -413,7 +415,7 @@ This feature requires Cypress 12.6.0 or later and a [Cypress Cloud Business or E
|
|
|
413
415
|
|
|
414
416
|
```yml
|
|
415
417
|
name: Cypress E2E Tests
|
|
416
|
-
on:
|
|
418
|
+
on: push
|
|
417
419
|
jobs:
|
|
418
420
|
cypress-run:
|
|
419
421
|
runs-on: ubuntu-22.04
|
|
@@ -440,11 +442,11 @@ See [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration
|
|
|
440
442
|
|
|
441
443
|
### Artifacts
|
|
442
444
|
|
|
443
|
-
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
|
|
444
446
|
|
|
445
447
|
```yml
|
|
446
448
|
name: Artifacts
|
|
447
|
-
on:
|
|
449
|
+
on: push
|
|
448
450
|
jobs:
|
|
449
451
|
cypress-run:
|
|
450
452
|
runs-on: ubuntu-22.04
|
|
@@ -477,7 +479,7 @@ Specify [configuration](https://docs.cypress.io/guides/references/configuration.
|
|
|
477
479
|
|
|
478
480
|
```yml
|
|
479
481
|
name: Cypress tests
|
|
480
|
-
on:
|
|
482
|
+
on: push
|
|
481
483
|
jobs:
|
|
482
484
|
cypress-run:
|
|
483
485
|
name: Cypress run
|
|
@@ -500,7 +502,7 @@ Specify the path to your config file with `config-file` parameter
|
|
|
500
502
|
|
|
501
503
|
```yml
|
|
502
504
|
name: Cypress tests
|
|
503
|
-
on:
|
|
505
|
+
on: push
|
|
504
506
|
jobs:
|
|
505
507
|
cypress-run:
|
|
506
508
|
name: Cypress run
|
|
@@ -523,9 +525,7 @@ You can spin multiple containers running in parallel using `strategy: matrix` ar
|
|
|
523
525
|
|
|
524
526
|
```yml
|
|
525
527
|
name: Parallel Cypress Tests
|
|
526
|
-
|
|
527
|
-
on: [push]
|
|
528
|
-
|
|
528
|
+
on: push
|
|
529
529
|
jobs:
|
|
530
530
|
test:
|
|
531
531
|
name: Cypress run
|
|
@@ -590,7 +590,7 @@ You can run a build step before starting tests
|
|
|
590
590
|
|
|
591
591
|
```yml
|
|
592
592
|
name: Build
|
|
593
|
-
on:
|
|
593
|
+
on: push
|
|
594
594
|
jobs:
|
|
595
595
|
cypress-run:
|
|
596
596
|
runs-on: ubuntu-22.04
|
|
@@ -609,7 +609,7 @@ If your tests run against a local server, use `start` parameter, the server will
|
|
|
609
609
|
|
|
610
610
|
```yml
|
|
611
611
|
name: With server
|
|
612
|
-
on:
|
|
612
|
+
on: push
|
|
613
613
|
jobs:
|
|
614
614
|
cypress-run:
|
|
615
615
|
runs-on: ubuntu-22.04
|
|
@@ -626,7 +626,7 @@ jobs:
|
|
|
626
626
|
|
|
627
627
|
```yml
|
|
628
628
|
name: With server
|
|
629
|
-
on:
|
|
629
|
+
on: push
|
|
630
630
|
jobs:
|
|
631
631
|
cypress-run:
|
|
632
632
|
runs-on: ubuntu-22.04
|
|
@@ -652,7 +652,7 @@ You can start multiple server processes. For example, if you have an API to star
|
|
|
652
652
|
|
|
653
653
|
```yml
|
|
654
654
|
name: With servers
|
|
655
|
-
on:
|
|
655
|
+
on: push
|
|
656
656
|
jobs:
|
|
657
657
|
cypress-run:
|
|
658
658
|
runs-on: ubuntu-22.04
|
|
@@ -682,7 +682,7 @@ If you are starting a local server and it takes a while to start, you can add a
|
|
|
682
682
|
|
|
683
683
|
```yml
|
|
684
684
|
name: After server responds
|
|
685
|
-
on:
|
|
685
|
+
on: push
|
|
686
686
|
jobs:
|
|
687
687
|
cypress-run:
|
|
688
688
|
runs-on: ubuntu-22.04
|
|
@@ -739,6 +739,14 @@ See [example-wait-on.yml](.github/workflows/example-wait-on.yml) workflow file.
|
|
|
739
739
|
|
|
740
740
|
If this action times out waiting for the server to respond, please see [Debugging](#debugging) section in this README file.
|
|
741
741
|
|
|
742
|
+
#### `wait-on` with Node.js 18+
|
|
743
|
+
|
|
744
|
+
Under Node.js version 18 and later, `wait-on` may fail to recognize that a `localhost` server is running. This affects development web servers which do not listen on both IPv4 and IPv6 network stacks.
|
|
745
|
+
|
|
746
|
+
- Check your server documentation to see if it can be started using `0.0.0.0` (all addresses) and use this if available. If this option is not available or does not resolve the issue then carry on to the next steps:
|
|
747
|
+
- If the action log shows that `wait-on` is failing to connect to `127.0.0.1`, replace `localhost` by `[::1]` (the IPv6 loopback address)
|
|
748
|
+
- If the action log shows that `wait-on` is failing to connect to `::1`, replace `localhost` by `127.0.0.1` (the IPv4 loopback address)
|
|
749
|
+
|
|
742
750
|
### Custom install command
|
|
743
751
|
|
|
744
752
|
If you want to overwrite the install command
|
|
@@ -757,7 +765,7 @@ You can prefix the default test command using the `command-prefix` option. This
|
|
|
757
765
|
|
|
758
766
|
```yml
|
|
759
767
|
name: Visual
|
|
760
|
-
on:
|
|
768
|
+
on: push
|
|
761
769
|
jobs:
|
|
762
770
|
e2e:
|
|
763
771
|
runs-on: ubuntu-22.04
|
|
@@ -798,7 +806,7 @@ You can overwrite [`ci-build-id`](https://on.cypress.io/parallelization#Linking-
|
|
|
798
806
|
|
|
799
807
|
```yml
|
|
800
808
|
name: Parallel
|
|
801
|
-
on:
|
|
809
|
+
on: push
|
|
802
810
|
jobs:
|
|
803
811
|
test:
|
|
804
812
|
runs-on: ubuntu-22.04
|
|
@@ -838,7 +846,7 @@ jobs:
|
|
|
838
846
|
# take the current commit + timestamp together
|
|
839
847
|
# the typical value would be something like
|
|
840
848
|
# "sha-5d3fe...35d3-time-1620841214"
|
|
841
|
-
run: echo "
|
|
849
|
+
run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT
|
|
842
850
|
smoke-tests:
|
|
843
851
|
needs: ['prepare']
|
|
844
852
|
steps:
|
|
@@ -905,7 +913,7 @@ repo/
|
|
|
905
913
|
You can specify the `app-test` working directory when running Cypress tests using the `working-directory` parameter
|
|
906
914
|
|
|
907
915
|
```yml
|
|
908
|
-
on:
|
|
916
|
+
on: push
|
|
909
917
|
jobs:
|
|
910
918
|
cypress-run:
|
|
911
919
|
runs-on: ubuntu-22.04
|
|
@@ -960,7 +968,7 @@ jobs:
|
|
|
960
968
|
working-directory: e2e
|
|
961
969
|
```
|
|
962
970
|
|
|
963
|
-
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.
|
|
964
972
|
|
|
965
973
|
### Yarn workspaces
|
|
966
974
|
|
|
@@ -968,7 +976,7 @@ This action should discover the Yarn workspaces correctly. For example, see fold
|
|
|
968
976
|
|
|
969
977
|
```yaml
|
|
970
978
|
name: example-start-and-yarn-workspaces
|
|
971
|
-
on:
|
|
979
|
+
on: push
|
|
972
980
|
jobs:
|
|
973
981
|
single:
|
|
974
982
|
# the example has Yarn workspace in its "root" folder
|
|
@@ -993,7 +1001,7 @@ Sometimes the default cache key does not work. For example, if you cannot share
|
|
|
993
1001
|
|
|
994
1002
|
```yml
|
|
995
1003
|
name: End-to-end tests
|
|
996
|
-
on:
|
|
1004
|
+
on: push
|
|
997
1005
|
jobs:
|
|
998
1006
|
cypress-run:
|
|
999
1007
|
runs-on: ubuntu-22.04
|
|
@@ -1028,7 +1036,7 @@ You can run your tests across multiple Node versions.
|
|
|
1028
1036
|
|
|
1029
1037
|
```yml
|
|
1030
1038
|
name: Node versions
|
|
1031
|
-
on:
|
|
1039
|
+
on: push
|
|
1032
1040
|
jobs:
|
|
1033
1041
|
cypress-run:
|
|
1034
1042
|
runs-on: ubuntu-22.04
|
|
@@ -1079,7 +1087,7 @@ See [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-m
|
|
|
1079
1087
|
|
|
1080
1088
|
### Custom install
|
|
1081
1089
|
|
|
1082
|
-
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.
|
|
1083
1091
|
|
|
1084
1092
|
### Install Cypress only
|
|
1085
1093
|
|
|
@@ -1121,23 +1129,23 @@ jobs:
|
|
|
1121
1129
|
timeout-minutes: 5
|
|
1122
1130
|
```
|
|
1123
1131
|
|
|
1124
|
-
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).
|
|
1125
1133
|
|
|
1126
1134
|
### More examples
|
|
1127
1135
|
|
|
1128
1136
|
<!-- prettier-ignore-start -->
|
|
1129
|
-
Name
|
|
1130
|
-
|
|
1131
|
-
[cypress-gh-action-small-example](https://github.com/bahmutov/cypress-gh-action-small-example) | Runs tests and records them on Cypress Cloud
|
|
1132
|
-
[cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example)
|
|
1133
|
-
[cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo)
|
|
1134
|
-
[cypress-gh-action-subfolders](https://github.com/bahmutov/cypress-gh-action-subfolders) | separate folder for Cypress dependencies
|
|
1135
|
-
[cypress-gh-action-split-install](https://github.com/bahmutov/cypress-gh-action-split-install) |
|
|
1136
|
-
[test-personal-site](https://github.com/bahmutov/test-personal-site) | Testing an external website every night and by manually clicking a button
|
|
1137
|
-
[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
|
|
1138
|
-
[cypress-examples](https://github.com/bahmutov/cypress-examples)
|
|
1139
|
-
[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
|
|
1140
|
-
[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 |
|
|
1141
1149
|
<!-- prettier-ignore-end -->
|
|
1142
1150
|
|
|
1143
1151
|
## Notes
|
|
@@ -1146,6 +1154,14 @@ Name | Description
|
|
|
1146
1154
|
|
|
1147
1155
|
This action installs local dependencies using lock files. If `yarn.lock` file is found, the install uses `yarn --frozen-lockfile` command. Otherwise it expects to find `package-lock.json` and install using `npm ci` command.
|
|
1148
1156
|
|
|
1157
|
+
The above default `yarn` installation command can be replaced for [Yarn Berry](https://yarnpkg.com/) (Yarn 2 and later) using the `install-command` parameter, for example:
|
|
1158
|
+
|
|
1159
|
+
```yml
|
|
1160
|
+
- uses: cypress-io/github-action@v5
|
|
1161
|
+
with:
|
|
1162
|
+
install-command: yarn install
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1149
1165
|
This action uses several production dependencies. The minimum Node version required to run this action depends on the minimum Node required by the dependencies.
|
|
1150
1166
|
|
|
1151
1167
|
## Debugging
|
|
@@ -1245,11 +1261,11 @@ This GH Action sets an output `dashboardUrl` if the run was recorded on [Cypress
|
|
|
1245
1261
|
|
|
1246
1262
|
### Docker image
|
|
1247
1263
|
|
|
1248
|
-
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)
|
|
1249
1265
|
|
|
1250
1266
|
```yml
|
|
1251
1267
|
name: included
|
|
1252
|
-
on:
|
|
1268
|
+
on: push
|
|
1253
1269
|
jobs:
|
|
1254
1270
|
cypress-run:
|
|
1255
1271
|
runs-on: ubuntu-22.04
|
|
@@ -1269,7 +1285,7 @@ If you are NOT using the `build` command in your project, you can run the `cypre
|
|
|
1269
1285
|
|
|
1270
1286
|
```yml
|
|
1271
1287
|
name: info
|
|
1272
|
-
on:
|
|
1288
|
+
on: push
|
|
1273
1289
|
jobs:
|
|
1274
1290
|
cypress-run:
|
|
1275
1291
|
runs-on: ubuntu-22.04
|
|
@@ -1286,7 +1302,7 @@ If you are already using the `build` parameter, you can split the [installation
|
|
|
1286
1302
|
|
|
1287
1303
|
```yml
|
|
1288
1304
|
name: info
|
|
1289
|
-
on:
|
|
1305
|
+
on: push
|
|
1290
1306
|
jobs:
|
|
1291
1307
|
cypress-run:
|
|
1292
1308
|
runs-on: ubuntu-22.04
|
|
@@ -1332,6 +1348,27 @@ See the [example-cron.yml](./.github/workflows/example-cron.yml) workflow.
|
|
|
1332
1348
|
|
|
1333
1349
|
[](.github/workflows/example-cron.yml)
|
|
1334
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
|
+
|
|
1335
1372
|
## Changelog
|
|
1336
1373
|
|
|
1337
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) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/github-action",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.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",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"test": "echo \"There are no tests :(\"",
|
|
14
14
|
"build": "ncc build -o dist index.js",
|
|
15
15
|
"format": "prettier --write index.js",
|
|
16
|
-
"check:markdown": "find *.md -print0 | xargs -0 -n1 markdown-link-check -c md-linkcheck.json",
|
|
17
|
-
"
|
|
16
|
+
"check:markdown": "find *.md docs/*.md -print0 | xargs -0 -n1 markdown-link-check -c md-linkcheck.json",
|
|
17
|
+
"update:cypress": "./scripts/update-cypress-latest.sh"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"quote": "0.4.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "18.
|
|
48
|
+
"@types/node": "18.14.6",
|
|
49
49
|
"@vercel/ncc": "0.36.1",
|
|
50
50
|
"husky": "7.0.4",
|
|
51
51
|
"markdown-link-check": "3.10.3",
|