@cypress/github-action 6.4.0 → 6.6.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 +121 -77
- package/action.yml +4 -1
- package/dist/index.js +3 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
- Use [timeouts](#timeouts) to avoid hanging CI jobs
|
|
55
55
|
- Print [Cypress info](#print-cypress-info) like detected browsers
|
|
56
56
|
- Run [tests nightly](#nightly-tests) or on any schedule
|
|
57
|
-
-
|
|
57
|
+
- Specify [job summary title](#job-summary-title)
|
|
58
|
+
- Suppress [job summary](#suppress-job-summary)
|
|
58
59
|
- [More examples](#more-examples)
|
|
59
60
|
|
|
60
61
|
Examples contained in this repository, based on current Cypress versions, can be found in the [examples](./examples) directory. Examples for [Legacy Configuration](https://on.cypress.io/guides/references/legacy-configuration), which use Cypress `9.7.0`, are no longer maintained. They can be referred to in the [examples/v9](https://github.com/cypress-io/github-action/tree/v5/examples/v9) directory of the [v5](https://github.com/cypress-io/github-action/tree/v5/) branch.
|
|
@@ -77,7 +78,7 @@ jobs:
|
|
|
77
78
|
runs-on: ubuntu-22.04
|
|
78
79
|
steps:
|
|
79
80
|
- name: Checkout
|
|
80
|
-
uses: actions/checkout@
|
|
81
|
+
uses: actions/checkout@v4
|
|
81
82
|
# Install npm dependencies, cache them correctly
|
|
82
83
|
# and run all Cypress tests
|
|
83
84
|
- name: Cypress run
|
|
@@ -102,7 +103,7 @@ jobs:
|
|
|
102
103
|
runs-on: ubuntu-22.04
|
|
103
104
|
steps:
|
|
104
105
|
- name: Checkout
|
|
105
|
-
uses: actions/checkout@
|
|
106
|
+
uses: actions/checkout@v4
|
|
106
107
|
- name: Cypress run
|
|
107
108
|
uses: cypress-io/github-action@v6
|
|
108
109
|
with:
|
|
@@ -117,14 +118,14 @@ See the example project [component-tests](examples/component-tests/) and the [ex
|
|
|
117
118
|
|
|
118
119
|
**Best practice:**
|
|
119
120
|
|
|
120
|
-
Our examples specify using branch [
|
|
121
|
+
Our examples specify using branch [v6](https://github.com/cypress-io/github-action/tree/v6) which is the action's recommended major version:
|
|
121
122
|
|
|
122
123
|
```yml
|
|
123
124
|
- name: Cypress run
|
|
124
125
|
uses: cypress-io/github-action@v6
|
|
125
126
|
```
|
|
126
127
|
|
|
127
|
-
When using `cypress-io/github-action@v6` from your workflow file, you will automatically use the latest [tag](https://github.com/cypress-io/github-action/tags) from branch [
|
|
128
|
+
When using `cypress-io/github-action@v6` from your workflow file, you will automatically use the latest [tag](https://github.com/cypress-io/github-action/tags) from branch [v6](https://github.com/cypress-io/github-action/tree/v6).
|
|
128
129
|
|
|
129
130
|
Alternatively, to mitigate unforeseen breaks, bind to a specific [tag](https://github.com/cypress-io/github-action/tags), for example:
|
|
130
131
|
|
|
@@ -149,7 +150,7 @@ jobs:
|
|
|
149
150
|
runs-on: ubuntu-22.04
|
|
150
151
|
name: E2E on Chrome
|
|
151
152
|
steps:
|
|
152
|
-
- uses: actions/checkout@
|
|
153
|
+
- uses: actions/checkout@v4
|
|
153
154
|
- uses: cypress-io/github-action@v6
|
|
154
155
|
with:
|
|
155
156
|
browser: chrome
|
|
@@ -167,7 +168,7 @@ jobs:
|
|
|
167
168
|
runs-on: ubuntu-22.04
|
|
168
169
|
name: E2E on Firefox
|
|
169
170
|
steps:
|
|
170
|
-
- uses: actions/checkout@
|
|
171
|
+
- uses: actions/checkout@v4
|
|
171
172
|
- uses: cypress-io/github-action@v6
|
|
172
173
|
with:
|
|
173
174
|
browser: firefox
|
|
@@ -185,7 +186,7 @@ jobs:
|
|
|
185
186
|
runs-on: ubuntu-22.04
|
|
186
187
|
name: E2E on Edge
|
|
187
188
|
steps:
|
|
188
|
-
- uses: actions/checkout@
|
|
189
|
+
- uses: actions/checkout@v4
|
|
189
190
|
- uses: cypress-io/github-action@v6
|
|
190
191
|
with:
|
|
191
192
|
browser: edge
|
|
@@ -204,7 +205,7 @@ jobs:
|
|
|
204
205
|
cypress-run:
|
|
205
206
|
runs-on: ubuntu-22.04
|
|
206
207
|
steps:
|
|
207
|
-
- uses: actions/checkout@
|
|
208
|
+
- uses: actions/checkout@v4
|
|
208
209
|
- uses: cypress-io/github-action@v6
|
|
209
210
|
with:
|
|
210
211
|
browser: chrome
|
|
@@ -227,7 +228,7 @@ jobs:
|
|
|
227
228
|
image: cypress/browsers:latest
|
|
228
229
|
options: --user 1001
|
|
229
230
|
steps:
|
|
230
|
-
- uses: actions/checkout@
|
|
231
|
+
- uses: actions/checkout@v4
|
|
231
232
|
- uses: cypress-io/github-action@v6
|
|
232
233
|
with:
|
|
233
234
|
browser: chrome
|
|
@@ -239,6 +240,8 @@ Include `options: --user 1001` to avoid permissions issues.
|
|
|
239
240
|
|
|
240
241
|
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
242
|
|
|
243
|
+
[](.github/workflows/example-docker.yml)
|
|
244
|
+
|
|
242
245
|
### Env
|
|
243
246
|
|
|
244
247
|
Specify the env argument with `env` parameter
|
|
@@ -251,7 +254,7 @@ jobs:
|
|
|
251
254
|
runs-on: ubuntu-22.04
|
|
252
255
|
steps:
|
|
253
256
|
- name: Checkout
|
|
254
|
-
uses: actions/checkout@
|
|
257
|
+
uses: actions/checkout@v4
|
|
255
258
|
|
|
256
259
|
- name: Cypress run with env
|
|
257
260
|
uses: cypress-io/github-action@v6
|
|
@@ -269,7 +272,7 @@ jobs:
|
|
|
269
272
|
runs-on: ubuntu-22.04
|
|
270
273
|
steps:
|
|
271
274
|
- name: Checkout
|
|
272
|
-
uses: actions/checkout@
|
|
275
|
+
uses: actions/checkout@v4
|
|
273
276
|
|
|
274
277
|
- name: Cypress run with env
|
|
275
278
|
uses: cypress-io/github-action@v6
|
|
@@ -295,7 +298,7 @@ jobs:
|
|
|
295
298
|
runs-on: ubuntu-22.04
|
|
296
299
|
steps:
|
|
297
300
|
- name: Checkout
|
|
298
|
-
uses: actions/checkout@
|
|
301
|
+
uses: actions/checkout@v4
|
|
299
302
|
|
|
300
303
|
- name: Cypress run
|
|
301
304
|
uses: cypress-io/github-action@v6
|
|
@@ -326,7 +329,7 @@ jobs:
|
|
|
326
329
|
runs-on: ubuntu-22.04
|
|
327
330
|
steps:
|
|
328
331
|
- name: Checkout
|
|
329
|
-
uses: actions/checkout@
|
|
332
|
+
uses: actions/checkout@v4
|
|
330
333
|
- name: Cypress run
|
|
331
334
|
uses: cypress-io/github-action@v6
|
|
332
335
|
with:
|
|
@@ -348,7 +351,7 @@ jobs:
|
|
|
348
351
|
runs-on: ubuntu-22.04
|
|
349
352
|
steps:
|
|
350
353
|
- name: Checkout
|
|
351
|
-
uses: actions/checkout@
|
|
354
|
+
uses: actions/checkout@v4
|
|
352
355
|
|
|
353
356
|
- name: Cypress run
|
|
354
357
|
uses: cypress-io/github-action@v6
|
|
@@ -380,7 +383,7 @@ jobs:
|
|
|
380
383
|
runs-on: ubuntu-22.04
|
|
381
384
|
steps:
|
|
382
385
|
- name: Checkout
|
|
383
|
-
uses: actions/checkout@
|
|
386
|
+
uses: actions/checkout@v4
|
|
384
387
|
|
|
385
388
|
- name: Cypress run
|
|
386
389
|
uses: cypress-io/github-action@v6
|
|
@@ -408,17 +411,17 @@ jobs:
|
|
|
408
411
|
# let's make sure our "app" works on several versions of Node
|
|
409
412
|
strategy:
|
|
410
413
|
matrix:
|
|
411
|
-
node: [
|
|
414
|
+
node: [18, 20, 21]
|
|
412
415
|
name: E2E on Node v${{ matrix.node }}
|
|
413
416
|
steps:
|
|
414
417
|
- name: Setup Node
|
|
415
|
-
uses: actions/setup-node@
|
|
418
|
+
uses: actions/setup-node@v4
|
|
416
419
|
with:
|
|
417
420
|
node-version: ${{ matrix.node }}
|
|
418
421
|
- run: node -v
|
|
419
422
|
|
|
420
423
|
- name: Checkout
|
|
421
|
-
uses: actions/checkout@
|
|
424
|
+
uses: actions/checkout@v4
|
|
422
425
|
|
|
423
426
|
- name: Cypress run
|
|
424
427
|
uses: cypress-io/github-action@v6
|
|
@@ -450,11 +453,9 @@ jobs:
|
|
|
450
453
|
runs-on: ubuntu-22.04
|
|
451
454
|
name: E2E
|
|
452
455
|
steps:
|
|
453
|
-
- name: Setup Node
|
|
454
|
-
uses: actions/setup-node@v3
|
|
455
456
|
|
|
456
457
|
- name: Checkout
|
|
457
|
-
uses: actions/checkout@
|
|
458
|
+
uses: actions/checkout@v4
|
|
458
459
|
|
|
459
460
|
- name: Cypress run
|
|
460
461
|
uses: cypress-io/github-action@v6
|
|
@@ -481,7 +482,7 @@ jobs:
|
|
|
481
482
|
runs-on: ubuntu-22.04
|
|
482
483
|
name: Artifacts
|
|
483
484
|
steps:
|
|
484
|
-
- uses: actions/checkout@
|
|
485
|
+
- uses: actions/checkout@v4
|
|
485
486
|
- uses: cypress-io/github-action@v6
|
|
486
487
|
# after the test run completes store videos and any screenshots
|
|
487
488
|
- uses: actions/upload-artifact@v3
|
|
@@ -510,7 +511,7 @@ jobs:
|
|
|
510
511
|
runs-on: ubuntu-22.04
|
|
511
512
|
steps:
|
|
512
513
|
- name: Checkout
|
|
513
|
-
uses: actions/checkout@
|
|
514
|
+
uses: actions/checkout@v4
|
|
514
515
|
# Install npm dependencies, cache them correctly
|
|
515
516
|
# and run all Cypress tests with `quiet` parameter
|
|
516
517
|
- name: Cypress run
|
|
@@ -535,7 +536,7 @@ jobs:
|
|
|
535
536
|
runs-on: ubuntu-22.04
|
|
536
537
|
steps:
|
|
537
538
|
- name: Checkout
|
|
538
|
-
uses: actions/checkout@
|
|
539
|
+
uses: actions/checkout@v4
|
|
539
540
|
|
|
540
541
|
- name: Cypress run
|
|
541
542
|
uses: cypress-io/github-action@v6
|
|
@@ -547,7 +548,7 @@ jobs:
|
|
|
547
548
|
|
|
548
549
|
### Config File
|
|
549
550
|
|
|
550
|
-
Specify the path to your
|
|
551
|
+
Specify the path to your [Configuration File](https://on.cypress.io/guides/references/configuration#Configuration-File) with `config-file` parameter
|
|
551
552
|
|
|
552
553
|
```yml
|
|
553
554
|
name: Cypress tests
|
|
@@ -558,14 +559,16 @@ jobs:
|
|
|
558
559
|
runs-on: ubuntu-22.04
|
|
559
560
|
steps:
|
|
560
561
|
- name: Checkout
|
|
561
|
-
uses: actions/checkout@
|
|
562
|
+
uses: actions/checkout@v4
|
|
562
563
|
|
|
563
564
|
- name: Cypress run
|
|
564
565
|
uses: cypress-io/github-action@v6
|
|
565
566
|
with:
|
|
566
|
-
config-file:
|
|
567
|
+
config-file: cypress.config-alternate.js
|
|
567
568
|
```
|
|
568
569
|
|
|
570
|
+
[](.github/workflows/example-config.yml)
|
|
571
|
+
|
|
569
572
|
### Parallel
|
|
570
573
|
|
|
571
574
|
**Note:** Cypress parallelization requires a [Cypress Cloud](https://on.cypress.io/cloud-introduction) account.
|
|
@@ -590,7 +593,7 @@ jobs:
|
|
|
590
593
|
containers: [1, 2, 3]
|
|
591
594
|
steps:
|
|
592
595
|
- name: Checkout
|
|
593
|
-
uses: actions/checkout@
|
|
596
|
+
uses: actions/checkout@v4
|
|
594
597
|
|
|
595
598
|
# because of "record" and "parallel" parameters
|
|
596
599
|
# these containers will load balance all found tests among themselves
|
|
@@ -646,7 +649,7 @@ jobs:
|
|
|
646
649
|
runs-on: ubuntu-22.04
|
|
647
650
|
steps:
|
|
648
651
|
- name: Checkout
|
|
649
|
-
uses: actions/checkout@
|
|
652
|
+
uses: actions/checkout@v4
|
|
650
653
|
- name: Cypress run
|
|
651
654
|
uses: cypress-io/github-action@v6
|
|
652
655
|
with:
|
|
@@ -665,7 +668,7 @@ jobs:
|
|
|
665
668
|
runs-on: ubuntu-22.04
|
|
666
669
|
steps:
|
|
667
670
|
- name: Checkout
|
|
668
|
-
uses: actions/checkout@
|
|
671
|
+
uses: actions/checkout@v4
|
|
669
672
|
- name: Cypress run
|
|
670
673
|
uses: cypress-io/github-action@v6
|
|
671
674
|
with:
|
|
@@ -683,7 +686,7 @@ jobs:
|
|
|
683
686
|
runs-on: ubuntu-22.04
|
|
684
687
|
steps:
|
|
685
688
|
- name: Checkout
|
|
686
|
-
uses: actions/checkout@
|
|
689
|
+
uses: actions/checkout@v4
|
|
687
690
|
- name: Cypress run
|
|
688
691
|
uses: cypress-io/github-action@v6
|
|
689
692
|
with:
|
|
@@ -709,7 +712,7 @@ jobs:
|
|
|
709
712
|
runs-on: ubuntu-22.04
|
|
710
713
|
steps:
|
|
711
714
|
- name: Checkout
|
|
712
|
-
uses: actions/checkout@
|
|
715
|
+
uses: actions/checkout@v4
|
|
713
716
|
- name: Cypress run
|
|
714
717
|
uses: cypress-io/github-action@v6
|
|
715
718
|
with:
|
|
@@ -739,7 +742,7 @@ jobs:
|
|
|
739
742
|
runs-on: ubuntu-22.04
|
|
740
743
|
steps:
|
|
741
744
|
- name: Checkout
|
|
742
|
-
uses: actions/checkout@
|
|
745
|
+
uses: actions/checkout@v4
|
|
743
746
|
- name: Cypress run
|
|
744
747
|
uses: cypress-io/github-action@v6
|
|
745
748
|
with:
|
|
@@ -824,7 +827,7 @@ jobs:
|
|
|
824
827
|
runs-on: ubuntu-22.04
|
|
825
828
|
steps:
|
|
826
829
|
- name: Checkout
|
|
827
|
-
uses: actions/checkout@
|
|
830
|
+
uses: actions/checkout@v4
|
|
828
831
|
- name: Cypress run
|
|
829
832
|
uses: cypress-io/github-action@v6
|
|
830
833
|
with:
|
|
@@ -843,7 +846,7 @@ You can overwrite the Cypress run command with your own command.
|
|
|
843
846
|
```yml
|
|
844
847
|
steps:
|
|
845
848
|
- name: Checkout 🛎
|
|
846
|
-
uses: actions/checkout@
|
|
849
|
+
uses: actions/checkout@v4
|
|
847
850
|
|
|
848
851
|
- name: Custom tests 🧪
|
|
849
852
|
uses: cypress-io/github-action@v6
|
|
@@ -870,7 +873,7 @@ jobs:
|
|
|
870
873
|
# run 3 copies of the current job in parallel
|
|
871
874
|
containers: [1, 2, 3]
|
|
872
875
|
steps:
|
|
873
|
-
- uses: actions/checkout@
|
|
876
|
+
- uses: actions/checkout@v4
|
|
874
877
|
- uses: cypress-io/github-action@v6
|
|
875
878
|
with:
|
|
876
879
|
record: true
|
|
@@ -905,7 +908,7 @@ jobs:
|
|
|
905
908
|
smoke-tests:
|
|
906
909
|
needs: ['prepare']
|
|
907
910
|
steps:
|
|
908
|
-
- uses: actions/checkout@
|
|
911
|
+
- uses: actions/checkout@v4
|
|
909
912
|
- uses: cypress-io/github-action@v6
|
|
910
913
|
with:
|
|
911
914
|
record: true
|
|
@@ -945,7 +948,7 @@ jobs:
|
|
|
945
948
|
cypress-run:
|
|
946
949
|
runs-on: ubuntu-22.04
|
|
947
950
|
steps:
|
|
948
|
-
- uses: actions/checkout@
|
|
951
|
+
- uses: actions/checkout@v4
|
|
949
952
|
- uses: cypress-io/github-action@v6
|
|
950
953
|
with:
|
|
951
954
|
start: npm start
|
|
@@ -958,7 +961,7 @@ Each of the examples in this monorepo is separated from other examples by using
|
|
|
958
961
|
|
|
959
962
|
### Subfolders
|
|
960
963
|
|
|
961
|
-
Sometimes
|
|
964
|
+
Sometimes the application under test and the Cypress end-to-end tests may have separately defined dependencies. In the example below, Cypress has its own `package.json` file in a subfolder:
|
|
962
965
|
|
|
963
966
|
```text
|
|
964
967
|
root/
|
|
@@ -966,15 +969,15 @@ root/
|
|
|
966
969
|
(code for installing and running Cypress tests)
|
|
967
970
|
package.json
|
|
968
971
|
package-lock.json
|
|
969
|
-
cypress.
|
|
970
|
-
cypress
|
|
972
|
+
cypress.config.js
|
|
973
|
+
cypress/
|
|
971
974
|
|
|
972
975
|
(code for running the "app" with "npm start")
|
|
973
976
|
package.json
|
|
974
|
-
|
|
977
|
+
package-lock.json
|
|
975
978
|
```
|
|
976
979
|
|
|
977
|
-
In
|
|
980
|
+
In this case you can first install the dependencies for the application (`npm ci`), then start the application server (`npm start`) before calling `cypress-io/github-action` to install the dependencies for Cypress and to run Cypress. You may also need to use the [wait-on](#wait-on) parameter to make sure that the app server is fully available.
|
|
978
981
|
|
|
979
982
|
```yml
|
|
980
983
|
name: E2E
|
|
@@ -983,9 +986,9 @@ jobs:
|
|
|
983
986
|
test:
|
|
984
987
|
runs-on: ubuntu-22.04
|
|
985
988
|
steps:
|
|
986
|
-
- uses: actions/checkout@
|
|
989
|
+
- uses: actions/checkout@v4
|
|
987
990
|
- name: Install root dependencies
|
|
988
|
-
|
|
991
|
+
run: npm ci
|
|
989
992
|
|
|
990
993
|
- name: Start server in the background
|
|
991
994
|
run: npm start &
|
|
@@ -1000,6 +1003,7 @@ jobs:
|
|
|
1000
1003
|
### pnpm
|
|
1001
1004
|
|
|
1002
1005
|
The package manager `pnpm` is not pre-installed in [GitHub Actions runner images](https://github.com/actions/runner-images) (unlike `npm` and `yarn`): to install `pnpm` include [pnpm/action-setup](https://github.com/pnpm/action-setup) in your workflow. If the action finds a `pnpm-lock.yaml` file, it uses the [pnpm](https://pnpm.io/cli/install) command `pnpm install --frozen-lockfile` by default to install dependencies.
|
|
1006
|
+
At this time the action does not automatically cache dependencies installed by pnpm. The example below includes steps to locate the pnpm store directory and to cache its contents for later use.
|
|
1003
1007
|
|
|
1004
1008
|
```yaml
|
|
1005
1009
|
name: example-basic-pnpm
|
|
@@ -1009,11 +1013,22 @@ jobs:
|
|
|
1009
1013
|
runs-on: ubuntu-22.04
|
|
1010
1014
|
steps:
|
|
1011
1015
|
- name: Checkout
|
|
1012
|
-
uses: actions/checkout@
|
|
1016
|
+
uses: actions/checkout@v4
|
|
1013
1017
|
- name: Install pnpm
|
|
1014
1018
|
uses: pnpm/action-setup@v2
|
|
1015
1019
|
with:
|
|
1016
1020
|
version: 8
|
|
1021
|
+
- name: Get pnpm store directory
|
|
1022
|
+
shell: bash
|
|
1023
|
+
run: |
|
|
1024
|
+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
1025
|
+
- name: Setup pnpm cache
|
|
1026
|
+
uses: actions/cache@v3
|
|
1027
|
+
with:
|
|
1028
|
+
path: ${{ env.STORE_PATH }}
|
|
1029
|
+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
|
|
1030
|
+
restore-keys: |
|
|
1031
|
+
${{ runner.os }}-pnpm-store-
|
|
1017
1032
|
- name: Cypress run
|
|
1018
1033
|
uses: cypress-io/github-action@v6
|
|
1019
1034
|
with:
|
|
@@ -1034,7 +1049,7 @@ jobs:
|
|
|
1034
1049
|
runs-on: ubuntu-22.04
|
|
1035
1050
|
steps:
|
|
1036
1051
|
- name: Checkout
|
|
1037
|
-
uses: actions/checkout@
|
|
1052
|
+
uses: actions/checkout@v4
|
|
1038
1053
|
- name: Cypress run
|
|
1039
1054
|
uses: cypress-io/github-action@v6
|
|
1040
1055
|
with:
|
|
@@ -1055,7 +1070,7 @@ jobs:
|
|
|
1055
1070
|
runs-on: ubuntu-22.04
|
|
1056
1071
|
steps:
|
|
1057
1072
|
- name: Checkout
|
|
1058
|
-
uses: actions/checkout@
|
|
1073
|
+
uses: actions/checkout@v4
|
|
1059
1074
|
- name: Cypress run
|
|
1060
1075
|
uses: cypress-io/github-action@v6
|
|
1061
1076
|
with:
|
|
@@ -1080,7 +1095,7 @@ jobs:
|
|
|
1080
1095
|
runs-on: ubuntu-22.04
|
|
1081
1096
|
steps:
|
|
1082
1097
|
- name: Checkout
|
|
1083
|
-
uses: actions/checkout@
|
|
1098
|
+
uses: actions/checkout@v4
|
|
1084
1099
|
- name: Cypress run
|
|
1085
1100
|
uses: cypress-io/github-action@v6
|
|
1086
1101
|
with:
|
|
@@ -1109,7 +1124,7 @@ jobs:
|
|
|
1109
1124
|
# and tests in a subfolder like "workspace-1"
|
|
1110
1125
|
runs-on: ubuntu-22.04
|
|
1111
1126
|
steps:
|
|
1112
|
-
- uses: actions/checkout@
|
|
1127
|
+
- uses: actions/checkout@v4
|
|
1113
1128
|
- uses: cypress-io/github-action@v6
|
|
1114
1129
|
with:
|
|
1115
1130
|
working-directory: examples/start-and-yarn-workspaces/workspace-1
|
|
@@ -1133,15 +1148,15 @@ jobs:
|
|
|
1133
1148
|
# let's make sure our "app" works on several versions of Node
|
|
1134
1149
|
strategy:
|
|
1135
1150
|
matrix:
|
|
1136
|
-
node: [
|
|
1151
|
+
node: [18, 20, 21]
|
|
1137
1152
|
name: E2E on Node v${{ matrix.node }}
|
|
1138
1153
|
steps:
|
|
1139
1154
|
- name: Setup Node
|
|
1140
|
-
uses: actions/setup-node@
|
|
1155
|
+
uses: actions/setup-node@v4
|
|
1141
1156
|
with:
|
|
1142
1157
|
node-version: ${{ matrix.node }}
|
|
1143
1158
|
- name: Checkout
|
|
1144
|
-
uses: actions/checkout@
|
|
1159
|
+
uses: actions/checkout@v4
|
|
1145
1160
|
# run Cypress tests and record them under the same run
|
|
1146
1161
|
# associated with commit SHA and just give a different group name
|
|
1147
1162
|
- name: Cypress run
|
|
@@ -1167,13 +1182,13 @@ jobs:
|
|
|
1167
1182
|
runs-on: ubuntu-22.04
|
|
1168
1183
|
strategy:
|
|
1169
1184
|
matrix:
|
|
1170
|
-
node: [
|
|
1185
|
+
node: [18, 20, 21]
|
|
1171
1186
|
name: E2E on Node v${{ matrix.node }}
|
|
1172
1187
|
steps:
|
|
1173
|
-
- uses: actions/setup-node@
|
|
1188
|
+
- uses: actions/setup-node@v4
|
|
1174
1189
|
with:
|
|
1175
1190
|
node-version: ${{ matrix.node }}
|
|
1176
|
-
- uses: actions/checkout@
|
|
1191
|
+
- uses: actions/checkout@v4
|
|
1177
1192
|
- uses: cypress-io/github-action@v6
|
|
1178
1193
|
```
|
|
1179
1194
|
|
|
@@ -1192,7 +1207,7 @@ jobs:
|
|
|
1192
1207
|
test:
|
|
1193
1208
|
runs-on: ubuntu-22.04
|
|
1194
1209
|
steps:
|
|
1195
|
-
- uses: actions/checkout@
|
|
1210
|
+
- uses: actions/checkout@v4
|
|
1196
1211
|
- name: Install dependencies
|
|
1197
1212
|
uses: cypress-io/github-action@v6
|
|
1198
1213
|
with:
|
|
@@ -1219,7 +1234,7 @@ Finally, you might not need this GH Action at all. For example, if you want to s
|
|
|
1219
1234
|
If the project has many dependencies, but you want to install just Cypress you can combine this action with `actions/cache` and `npm i cypress` commands yourself.
|
|
1220
1235
|
|
|
1221
1236
|
```yml
|
|
1222
|
-
- uses: actions/checkout@
|
|
1237
|
+
- uses: actions/checkout@v4
|
|
1223
1238
|
- uses: actions/cache@v2
|
|
1224
1239
|
with:
|
|
1225
1240
|
path: |
|
|
@@ -1246,7 +1261,7 @@ jobs:
|
|
|
1246
1261
|
# to prevent a hanging process from using all your CI minutes
|
|
1247
1262
|
timeout-minutes: 10
|
|
1248
1263
|
steps:
|
|
1249
|
-
- uses: actions/checkout@
|
|
1264
|
+
- uses: actions/checkout@v4
|
|
1250
1265
|
- uses: cypress-io/github-action@v6
|
|
1251
1266
|
# you can specify individual step timeout too
|
|
1252
1267
|
timeout-minutes: 5
|
|
@@ -1282,7 +1297,7 @@ See section [Yarn Modern](#yarn-modern) for information about using Yarn version
|
|
|
1282
1297
|
|
|
1283
1298
|
This action uses the [debug](https://github.com/visionmedia/debug#readme) module to output additional verbose logs. You can see these debug messages by setting the following environment variable:
|
|
1284
1299
|
|
|
1285
|
-
```
|
|
1300
|
+
```yml
|
|
1286
1301
|
DEBUG: @cypress/github-action
|
|
1287
1302
|
```
|
|
1288
1303
|
|
|
@@ -1297,9 +1312,11 @@ You can set the environment variable using GitHub UI interface, or in the workfl
|
|
|
1297
1312
|
|
|
1298
1313
|
See the [example-debug.yml](.github/workflows/example-debug.yml) workflow file.
|
|
1299
1314
|
|
|
1315
|
+
To collect more verbose GitHub Action logs you can set a GitHub secret or variable `ACTIONS_STEP_DEBUG` to `true`. This is useful to see detailed caching steps. See [Enabling debug logging](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging) from GitHub Actions documentation for more information.
|
|
1316
|
+
|
|
1300
1317
|
### Logs from the test runner
|
|
1301
1318
|
|
|
1302
|
-
|
|
1319
|
+
To see the [Cypress debug logs](http://on.cypress.io/troubleshooting#Print-DEBUG-logs) add an environment variable to the action:
|
|
1303
1320
|
|
|
1304
1321
|
```yml
|
|
1305
1322
|
- name: Cypress tests with debug logs
|
|
@@ -1386,7 +1403,7 @@ jobs:
|
|
|
1386
1403
|
runs-on: ubuntu-22.04
|
|
1387
1404
|
steps:
|
|
1388
1405
|
- name: Checkout
|
|
1389
|
-
uses: actions/checkout@
|
|
1406
|
+
uses: actions/checkout@v4
|
|
1390
1407
|
- name: Cypress run
|
|
1391
1408
|
uses: cypress-io/github-action@v6
|
|
1392
1409
|
with:
|
|
@@ -1403,7 +1420,7 @@ jobs:
|
|
|
1403
1420
|
runs-on: ubuntu-22.04
|
|
1404
1421
|
steps:
|
|
1405
1422
|
- name: Checkout
|
|
1406
|
-
uses: actions/checkout@
|
|
1423
|
+
uses: actions/checkout@v4
|
|
1407
1424
|
- name: Cypress install
|
|
1408
1425
|
uses: cypress-io/github-action@v6
|
|
1409
1426
|
with:
|
|
@@ -1434,18 +1451,46 @@ jobs:
|
|
|
1434
1451
|
runs-on: ubuntu-22.04
|
|
1435
1452
|
steps:
|
|
1436
1453
|
- name: Checkout
|
|
1437
|
-
uses: actions/checkout@
|
|
1454
|
+
uses: actions/checkout@v4
|
|
1438
1455
|
- name: Cypress nightly tests 🌃
|
|
1439
1456
|
uses: cypress-io/github-action@v6
|
|
1440
1457
|
```
|
|
1441
1458
|
|
|
1442
1459
|
[](.github/workflows/example-cron.yml)
|
|
1443
1460
|
|
|
1444
|
-
###
|
|
1461
|
+
### Job summary title
|
|
1462
|
+
|
|
1463
|
+
By default, the action produces a job summary in the GitHub Actions log for each workflow step where `github-action` is used. Each job summary shows a Passing / Failing status, the test counts for Passed, Failed, Pending & Skipped, followed by the Duration of the run. The job summaries are grouped by job.
|
|
1464
|
+
|
|
1465
|
+
To specify a title for a Job Summary, use the parameter `summary-title`. If no title is specified, then the default "Cypress Results" is used:
|
|
1466
|
+
|
|
1467
|
+
```yml
|
|
1468
|
+
name: Summary titles
|
|
1469
|
+
on: push
|
|
1470
|
+
jobs:
|
|
1471
|
+
tests:
|
|
1472
|
+
runs-on: ubuntu-22.04
|
|
1473
|
+
steps:
|
|
1474
|
+
- uses: actions/checkout@v4
|
|
1475
|
+
- name: Cypress headless tests
|
|
1476
|
+
uses: cypress-io/github-action@v6
|
|
1477
|
+
with:
|
|
1478
|
+
summary-title: 'Headless'
|
|
1479
|
+
- name: Cypress headed tests
|
|
1480
|
+
uses: cypress-io/github-action@v6
|
|
1481
|
+
with:
|
|
1482
|
+
install: false
|
|
1483
|
+
headed: true
|
|
1484
|
+
summary-title: 'Headed'
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1487
|
+
The name of the GitHub Actions job is shown at the top of one or more job summaries from the same job. If multiple summaries belong to the same job, then giving them separate titles allows them to be uniquely identified.
|
|
1488
|
+
|
|
1489
|
+
See the [example-chrome.yml](.github/workflows/example-chrome.yml) workflow, with multiple calls to `cypress-io/github-action` in one job, making use of the `summary-title` parameter. View the [example-chrome.yml - actions log](https://github.com/cypress-io/github-action/actions/workflows/example-chrome.yml) for an example of the resulting job summaries.
|
|
1490
|
+
|
|
1491
|
+
### Suppress job summary
|
|
1445
1492
|
|
|
1446
|
-
The default
|
|
1447
|
-
Sometimes users want to publish test summary using a specific action.
|
|
1448
|
-
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.
|
|
1493
|
+
The default job summary can be suppressed by using the parameter `publish-summary` and setting its value to `false`.
|
|
1449
1494
|
|
|
1450
1495
|
```yml
|
|
1451
1496
|
name: Example no summary
|
|
@@ -1455,7 +1500,7 @@ jobs:
|
|
|
1455
1500
|
runs-on: ubuntu-22.04
|
|
1456
1501
|
steps:
|
|
1457
1502
|
- name: Checkout
|
|
1458
|
-
uses: actions/checkout@
|
|
1503
|
+
uses: actions/checkout@v4
|
|
1459
1504
|
- name: Cypress run
|
|
1460
1505
|
uses: cypress-io/github-action@v6
|
|
1461
1506
|
with:
|
|
@@ -1464,7 +1509,7 @@ jobs:
|
|
|
1464
1509
|
|
|
1465
1510
|
### Automatic PR number & URL detection
|
|
1466
1511
|
|
|
1467
|
-
When recording runs to Cypress Cloud, the PR number and URL can be automatically detected if you pass `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`
|
|
1512
|
+
When recording runs to Cypress Cloud, the PR number and URL can be automatically detected if you pass `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`
|
|
1468
1513
|
via the workflow `env`. When set, this value enables the Action to perform additional logic that grabs the related PR number and URL (if they
|
|
1469
1514
|
exist) and sets them in the environment variables `CYPRESS_PULL_REQUEST_ID` and `CYPRESS_PULL_REQUEST_URL`, respectively.
|
|
1470
1515
|
* See Cypress' documentation on [CI Build Information](https://on.cypress.io/guides/continuous-integration/introduction#CI-Build-Information)
|
|
@@ -1478,7 +1523,7 @@ jobs:
|
|
|
1478
1523
|
runs-on: ubuntu-22.04
|
|
1479
1524
|
steps:
|
|
1480
1525
|
- name: Checkout
|
|
1481
|
-
uses: actions/checkout@
|
|
1526
|
+
uses: actions/checkout@v4
|
|
1482
1527
|
- name: Cypress run
|
|
1483
1528
|
uses: cypress-io/github-action@v6
|
|
1484
1529
|
with:
|
|
@@ -1497,7 +1542,7 @@ PR that triggered the workflow.
|
|
|
1497
1542
|
|
|
1498
1543
|
#### Triggering event: `push`
|
|
1499
1544
|
|
|
1500
|
-
When a commit on a branch without a PR is made, the Cypress GitHub Action checks to see if the commit that triggered the workflow has a
|
|
1545
|
+
When a commit on a branch without a PR is made, the Cypress GitHub Action checks to see if the commit that triggered the workflow has a
|
|
1501
1546
|
related PR. If the commit exists in any other PRs, it's considered a related PR. When there are related PRs, we grab the first related PR
|
|
1502
1547
|
and use that PR's number and URL for `CYPRESS_PULL_REQUEST_ID` and `CYPRESS_PULL_REQUEST_URL`, respectively.
|
|
1503
1548
|
|
|
@@ -1509,7 +1554,6 @@ If no related PR is detected, `CYPRESS_PULL_REQUEST_ID` and `CYPRESS_PULL_REQUES
|
|
|
1509
1554
|
|
|
1510
1555
|
Node.js is required to run this action. The recommended version `v6` supports:
|
|
1511
1556
|
|
|
1512
|
-
- **Node.js** 16.x
|
|
1513
1557
|
- **Node.js** 18.x
|
|
1514
1558
|
- **Node.js** 20.x and above
|
|
1515
1559
|
|
|
@@ -1521,7 +1565,7 @@ and is generally aligned with [Node.js's release schedule](https://github.com/no
|
|
|
1521
1565
|
|
|
1522
1566
|
[](.github/workflows/example-node-versions.yml)
|
|
1523
1567
|
|
|
1524
|
-
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@
|
|
1568
|
+
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@v6` uses `node20`.
|
|
1525
1569
|
|
|
1526
1570
|
## Changelog
|
|
1527
1571
|
|
|
@@ -1530,8 +1574,8 @@ View the [CHANGELOG](./CHANGELOG.md) document for an overview of version changes
|
|
|
1530
1574
|
## Compatibility
|
|
1531
1575
|
|
|
1532
1576
|
- `v6` is the current recommended version and uses `node20`
|
|
1533
|
-
- `v5` uses `node16`
|
|
1534
|
-
- `v4` is the minimum version required for Cypress `10.x` and later - also uses `node16`
|
|
1577
|
+
- `v5` uses the deprecated version `node16`
|
|
1578
|
+
- `v4` is the minimum version required for Cypress `10.x` and later - also uses the deprecated version `node16`
|
|
1535
1579
|
|
|
1536
1580
|
Pay attention to any GitHub Actions deprecation warnings shown in logs which may recommend updating.
|
|
1537
1581
|
|
package/action.yml
CHANGED
|
@@ -66,9 +66,12 @@ inputs:
|
|
|
66
66
|
description: 'Whether or not to use headed mode'
|
|
67
67
|
required: false
|
|
68
68
|
publish-summary:
|
|
69
|
-
description: 'Whether or not to publish job summary'
|
|
69
|
+
description: 'Whether or not to publish a job summary'
|
|
70
70
|
required: false
|
|
71
71
|
default: true
|
|
72
|
+
summary-title:
|
|
73
|
+
description: 'Title for job summary'
|
|
74
|
+
required: false
|
|
72
75
|
spec:
|
|
73
76
|
description: 'Provide a specific specs to run'
|
|
74
77
|
required: false
|
package/dist/index.js
CHANGED
|
@@ -75298,8 +75298,10 @@ const generateSummary = async (testResults) => {
|
|
|
75298
75298
|
`${testResults.totalDuration / 1000}s` || ''
|
|
75299
75299
|
]
|
|
75300
75300
|
|
|
75301
|
+
const summaryTitle = core.getInput('summary-title')
|
|
75302
|
+
|
|
75301
75303
|
await core.summary
|
|
75302
|
-
.addHeading('Cypress Results', 2)
|
|
75304
|
+
.addHeading(summaryTitle ? summaryTitle : 'Cypress Results', 2)
|
|
75303
75305
|
.addTable([headers, summaryRows])
|
|
75304
75306
|
.addLink(
|
|
75305
75307
|
testResults.runUrl ? 'View run in Cypress Cloud' : '',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/github-action",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.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": "20.
|
|
50
|
-
"@vercel/ncc": "0.
|
|
49
|
+
"@types/node": "20.8.4",
|
|
50
|
+
"@vercel/ncc": "0.38.1",
|
|
51
51
|
"husky": "8.0.3",
|
|
52
52
|
"markdown-link-check": "3.11.1",
|
|
53
|
-
"prettier": "3.0.
|
|
53
|
+
"prettier": "3.0.3"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|