@cypress/github-action 6.10.9 → 7.1.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 +135 -88
- package/action.yml +5 -1
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,6 +68,7 @@ The following examples demonstrate the actions' functions.
|
|
|
68
68
|
- Use [Yarn Modern](#yarn-modern)
|
|
69
69
|
- Use [Yarn Plug'n'Play](#yarn-plugnplay)
|
|
70
70
|
- Use [Yarn workspaces](#yarn-workspaces)
|
|
71
|
+
- Disable [package manager cache](#package-manager-cache-disable)
|
|
71
72
|
- Use [custom cache key](#custom-cache-key)
|
|
72
73
|
- Run tests on multiple [Node versions](#node-versions)
|
|
73
74
|
- Split [install and tests](#split-install-and-tests) into separate jobs
|
|
@@ -100,10 +101,10 @@ jobs:
|
|
|
100
101
|
steps:
|
|
101
102
|
- name: Checkout
|
|
102
103
|
uses: actions/checkout@v6
|
|
103
|
-
# Install
|
|
104
|
+
# Install dependencies with caching
|
|
104
105
|
# and run all Cypress tests
|
|
105
106
|
- name: Cypress run
|
|
106
|
-
uses: cypress-io/github-action@
|
|
107
|
+
uses: cypress-io/github-action@v7
|
|
107
108
|
```
|
|
108
109
|
|
|
109
110
|
[](.github/workflows/example-basic.yml)
|
|
@@ -126,7 +127,7 @@ jobs:
|
|
|
126
127
|
- name: Checkout
|
|
127
128
|
uses: actions/checkout@v6
|
|
128
129
|
- name: Cypress run
|
|
129
|
-
uses: cypress-io/github-action@
|
|
130
|
+
uses: cypress-io/github-action@v7
|
|
130
131
|
with:
|
|
131
132
|
component: true
|
|
132
133
|
```
|
|
@@ -139,20 +140,20 @@ See the example project [component-tests](examples/component-tests/) and the [ex
|
|
|
139
140
|
|
|
140
141
|
**Best practice:**
|
|
141
142
|
|
|
142
|
-
Our examples specify using branch
|
|
143
|
+
Our examples specify using branch `v7` which is the action's recommended major version:
|
|
143
144
|
|
|
144
145
|
```yml
|
|
145
146
|
- name: Cypress run
|
|
146
|
-
uses: cypress-io/github-action@
|
|
147
|
+
uses: cypress-io/github-action@v7
|
|
147
148
|
```
|
|
148
149
|
|
|
149
|
-
When using `cypress-io/github-action@
|
|
150
|
+
When using `cypress-io/github-action@v7` from your workflow file, you will automatically use the latest [tag](https://github.com/cypress-io/github-action/tags) from branch `v7`.
|
|
150
151
|
|
|
151
152
|
Alternatively, to mitigate unforeseen breaks, bind to a specific [tag](https://github.com/cypress-io/github-action/tags), for example:
|
|
152
153
|
|
|
153
154
|
```yml
|
|
154
155
|
- name: Cypress run
|
|
155
|
-
uses: cypress-io/github-action@
|
|
156
|
+
uses: cypress-io/github-action@v7.0.0
|
|
156
157
|
```
|
|
157
158
|
|
|
158
159
|
The changes associated with each tag are shown under GitHub's [releases](https://github.com/cypress-io/github-action/releases) list. Refer also to the [CHANGELOG](./CHANGELOG.md) for an overview of major changes.
|
|
@@ -160,7 +161,7 @@ The changes associated with each tag are shown under GitHub's [releases](https:/
|
|
|
160
161
|
The workflows in the [examples](./examples/) directory use the latest commit from the repo's current branch. This allows all tests to run in CI before release. If you copy any of the examples to your own repo, you should replace `./` and specify instead the action and version as described above.
|
|
161
162
|
|
|
162
163
|
```yml
|
|
163
|
-
- uses: ./ # replace with cypress-io/github-action@
|
|
164
|
+
- uses: ./ # replace with cypress-io/github-action@v7
|
|
164
165
|
```
|
|
165
166
|
|
|
166
167
|
### Browser
|
|
@@ -178,7 +179,7 @@ jobs:
|
|
|
178
179
|
name: E2E on Chrome
|
|
179
180
|
steps:
|
|
180
181
|
- uses: actions/checkout@v6
|
|
181
|
-
- uses: cypress-io/github-action@
|
|
182
|
+
- uses: cypress-io/github-action@v7
|
|
182
183
|
with:
|
|
183
184
|
browser: chrome
|
|
184
185
|
```
|
|
@@ -201,7 +202,7 @@ jobs:
|
|
|
201
202
|
- uses: browser-actions/setup-chrome@v2
|
|
202
203
|
with:
|
|
203
204
|
chrome-version: 140
|
|
204
|
-
- uses: cypress-io/github-action@
|
|
205
|
+
- uses: cypress-io/github-action@v7
|
|
205
206
|
with:
|
|
206
207
|
browser: chrome-for-testing
|
|
207
208
|
```
|
|
@@ -219,7 +220,7 @@ jobs:
|
|
|
219
220
|
name: E2E on Firefox
|
|
220
221
|
steps:
|
|
221
222
|
- uses: actions/checkout@v6
|
|
222
|
-
- uses: cypress-io/github-action@
|
|
223
|
+
- uses: cypress-io/github-action@v7
|
|
223
224
|
with:
|
|
224
225
|
browser: firefox
|
|
225
226
|
```
|
|
@@ -237,7 +238,7 @@ jobs:
|
|
|
237
238
|
name: E2E on Edge
|
|
238
239
|
steps:
|
|
239
240
|
- uses: actions/checkout@v6
|
|
240
|
-
- uses: cypress-io/github-action@
|
|
241
|
+
- uses: cypress-io/github-action@v7
|
|
241
242
|
with:
|
|
242
243
|
browser: edge
|
|
243
244
|
```
|
|
@@ -256,7 +257,7 @@ jobs:
|
|
|
256
257
|
runs-on: ubuntu-24.04
|
|
257
258
|
steps:
|
|
258
259
|
- uses: actions/checkout@v6
|
|
259
|
-
- uses: cypress-io/github-action@
|
|
260
|
+
- uses: cypress-io/github-action@v7
|
|
260
261
|
with:
|
|
261
262
|
browser: chrome
|
|
262
263
|
headed: true
|
|
@@ -279,7 +280,7 @@ jobs:
|
|
|
279
280
|
options: --user 1001
|
|
280
281
|
steps:
|
|
281
282
|
- uses: actions/checkout@v6
|
|
282
|
-
- uses: cypress-io/github-action@
|
|
283
|
+
- uses: cypress-io/github-action@v7
|
|
283
284
|
with:
|
|
284
285
|
browser: chrome
|
|
285
286
|
```
|
|
@@ -303,7 +304,7 @@ jobs:
|
|
|
303
304
|
options: --user 1001
|
|
304
305
|
steps:
|
|
305
306
|
- uses: actions/checkout@v6
|
|
306
|
-
- uses: cypress-io/github-action@
|
|
307
|
+
- uses: cypress-io/github-action@v7
|
|
307
308
|
with:
|
|
308
309
|
browser: chrome
|
|
309
310
|
env:
|
|
@@ -329,7 +330,7 @@ jobs:
|
|
|
329
330
|
uses: actions/checkout@v6
|
|
330
331
|
|
|
331
332
|
- name: Cypress run with env
|
|
332
|
-
uses: cypress-io/github-action@
|
|
333
|
+
uses: cypress-io/github-action@v7
|
|
333
334
|
with:
|
|
334
335
|
env: host=api.dev.local,port=4222
|
|
335
336
|
```
|
|
@@ -347,7 +348,7 @@ jobs:
|
|
|
347
348
|
uses: actions/checkout@v6
|
|
348
349
|
|
|
349
350
|
- name: Cypress run with env
|
|
350
|
-
uses: cypress-io/github-action@
|
|
351
|
+
uses: cypress-io/github-action@v7
|
|
351
352
|
env:
|
|
352
353
|
CYPRESS_host: api.dev.local
|
|
353
354
|
CYPRESS_port: 4222
|
|
@@ -373,7 +374,7 @@ jobs:
|
|
|
373
374
|
uses: actions/checkout@v6
|
|
374
375
|
|
|
375
376
|
- name: Cypress run
|
|
376
|
-
uses: cypress-io/github-action@
|
|
377
|
+
uses: cypress-io/github-action@v7
|
|
377
378
|
with:
|
|
378
379
|
spec: cypress/e2e/spec1.cy.js
|
|
379
380
|
```
|
|
@@ -403,7 +404,7 @@ jobs:
|
|
|
403
404
|
- name: Checkout
|
|
404
405
|
uses: actions/checkout@v6
|
|
405
406
|
- name: Cypress run
|
|
406
|
-
uses: cypress-io/github-action@
|
|
407
|
+
uses: cypress-io/github-action@v7
|
|
407
408
|
with:
|
|
408
409
|
project: ./test-subdirectory
|
|
409
410
|
```
|
|
@@ -436,7 +437,7 @@ jobs:
|
|
|
436
437
|
uses: actions/checkout@v6
|
|
437
438
|
|
|
438
439
|
- name: Cypress run
|
|
439
|
-
uses: cypress-io/github-action@
|
|
440
|
+
uses: cypress-io/github-action@v7
|
|
440
441
|
with:
|
|
441
442
|
record: true
|
|
442
443
|
env:
|
|
@@ -465,7 +466,7 @@ jobs:
|
|
|
465
466
|
- name: Checkout
|
|
466
467
|
uses: actions/checkout@v6
|
|
467
468
|
- name: Cypress run
|
|
468
|
-
uses: cypress-io/github-action@
|
|
469
|
+
uses: cypress-io/github-action@v7
|
|
469
470
|
with:
|
|
470
471
|
record: true
|
|
471
472
|
env:
|
|
@@ -498,7 +499,7 @@ jobs:
|
|
|
498
499
|
- name: Checkout
|
|
499
500
|
uses: actions/checkout@v6
|
|
500
501
|
- name: Cypress run
|
|
501
|
-
uses: cypress-io/github-action@
|
|
502
|
+
uses: cypress-io/github-action@v7
|
|
502
503
|
with:
|
|
503
504
|
record: true
|
|
504
505
|
- run: echo "PR number is $CYPRESS_PULL_REQUEST_ID"
|
|
@@ -537,7 +538,7 @@ jobs:
|
|
|
537
538
|
uses: actions/checkout@v6
|
|
538
539
|
|
|
539
540
|
- name: Cypress run
|
|
540
|
-
uses: cypress-io/github-action@
|
|
541
|
+
uses: cypress-io/github-action@v7
|
|
541
542
|
with:
|
|
542
543
|
record: true
|
|
543
544
|
env:
|
|
@@ -566,17 +567,16 @@ jobs:
|
|
|
566
567
|
node: [20, 22, 24, 25]
|
|
567
568
|
name: E2E on Node v${{ matrix.node }}
|
|
568
569
|
steps:
|
|
570
|
+
- name: Checkout
|
|
571
|
+
uses: actions/checkout@v6
|
|
569
572
|
- name: Install Node.js
|
|
570
573
|
uses: actions/setup-node@v6
|
|
571
574
|
with:
|
|
572
575
|
node-version: ${{ matrix.node }}
|
|
573
576
|
- run: node -v
|
|
574
577
|
|
|
575
|
-
- name: Checkout
|
|
576
|
-
uses: actions/checkout@v6
|
|
577
|
-
|
|
578
578
|
- name: Cypress run
|
|
579
|
-
uses: cypress-io/github-action@
|
|
579
|
+
uses: cypress-io/github-action@v7
|
|
580
580
|
with:
|
|
581
581
|
record: true
|
|
582
582
|
tag: node-${{ matrix.node }}
|
|
@@ -609,7 +609,7 @@ jobs:
|
|
|
609
609
|
uses: actions/checkout@v6
|
|
610
610
|
|
|
611
611
|
- name: Cypress run
|
|
612
|
-
uses: cypress-io/github-action@
|
|
612
|
+
uses: cypress-io/github-action@v7
|
|
613
613
|
with:
|
|
614
614
|
record: true
|
|
615
615
|
# Cancel the run after 2 failed tests
|
|
@@ -634,7 +634,7 @@ jobs:
|
|
|
634
634
|
name: Artifacts
|
|
635
635
|
steps:
|
|
636
636
|
- uses: actions/checkout@v6
|
|
637
|
-
- uses: cypress-io/github-action@
|
|
637
|
+
- uses: cypress-io/github-action@v7
|
|
638
638
|
# after the test run completes store videos and any screenshots
|
|
639
639
|
- uses: actions/upload-artifact@v6
|
|
640
640
|
# add the line below to store screenshots only on failures
|
|
@@ -663,10 +663,10 @@ jobs:
|
|
|
663
663
|
steps:
|
|
664
664
|
- name: Checkout
|
|
665
665
|
uses: actions/checkout@v6
|
|
666
|
-
# Install
|
|
666
|
+
# Install dependencies with caching
|
|
667
667
|
# and run all Cypress tests with `quiet` parameter
|
|
668
668
|
- name: Cypress run
|
|
669
|
-
uses: cypress-io/github-action@
|
|
669
|
+
uses: cypress-io/github-action@v7
|
|
670
670
|
with:
|
|
671
671
|
working-directory: examples/quiet
|
|
672
672
|
quiet: true
|
|
@@ -690,7 +690,7 @@ jobs:
|
|
|
690
690
|
uses: actions/checkout@v6
|
|
691
691
|
|
|
692
692
|
- name: Cypress run
|
|
693
|
-
uses: cypress-io/github-action@
|
|
693
|
+
uses: cypress-io/github-action@v7
|
|
694
694
|
with:
|
|
695
695
|
config: pageLoadTimeout=100000,baseUrl=http://localhost:3000
|
|
696
696
|
```
|
|
@@ -713,7 +713,7 @@ jobs:
|
|
|
713
713
|
uses: actions/checkout@v6
|
|
714
714
|
|
|
715
715
|
- name: Cypress run
|
|
716
|
-
uses: cypress-io/github-action@
|
|
716
|
+
uses: cypress-io/github-action@v7
|
|
717
717
|
with:
|
|
718
718
|
config-file: cypress.config-alternate.js
|
|
719
719
|
```
|
|
@@ -749,7 +749,7 @@ jobs:
|
|
|
749
749
|
# because of "record" and "parallel" parameters
|
|
750
750
|
# these containers will load balance all found tests among themselves
|
|
751
751
|
- name: Cypress run
|
|
752
|
-
uses: cypress-io/github-action@
|
|
752
|
+
uses: cypress-io/github-action@v7
|
|
753
753
|
with:
|
|
754
754
|
record: true
|
|
755
755
|
parallel: true
|
|
@@ -781,10 +781,10 @@ During staged rollout of a new GitHub-hosted runner version, GitHub may provide
|
|
|
781
781
|
|
|
782
782
|
```yml
|
|
783
783
|
- name: Run E2E tests
|
|
784
|
-
uses: cypress-io/github-action@
|
|
784
|
+
uses: cypress-io/github-action@v7
|
|
785
785
|
|
|
786
786
|
- name: Run Component Testing
|
|
787
|
-
uses: cypress-io/github-action@
|
|
787
|
+
uses: cypress-io/github-action@v7
|
|
788
788
|
with:
|
|
789
789
|
# we have already installed everything
|
|
790
790
|
install: false
|
|
@@ -807,7 +807,7 @@ jobs:
|
|
|
807
807
|
- name: Checkout
|
|
808
808
|
uses: actions/checkout@v6
|
|
809
809
|
- name: Cypress run
|
|
810
|
-
uses: cypress-io/github-action@
|
|
810
|
+
uses: cypress-io/github-action@v7
|
|
811
811
|
with:
|
|
812
812
|
build: npm run build
|
|
813
813
|
```
|
|
@@ -826,7 +826,7 @@ jobs:
|
|
|
826
826
|
- name: Checkout
|
|
827
827
|
uses: actions/checkout@v6
|
|
828
828
|
- name: Cypress run
|
|
829
|
-
uses: cypress-io/github-action@
|
|
829
|
+
uses: cypress-io/github-action@v7
|
|
830
830
|
with:
|
|
831
831
|
start: npm start
|
|
832
832
|
```
|
|
@@ -845,7 +845,7 @@ jobs:
|
|
|
845
845
|
- name: Checkout
|
|
846
846
|
uses: actions/checkout@v6
|
|
847
847
|
- name: Cypress run
|
|
848
|
-
uses: cypress-io/github-action@
|
|
848
|
+
uses: cypress-io/github-action@v7
|
|
849
849
|
with:
|
|
850
850
|
# Linux and macOS
|
|
851
851
|
start: npm start
|
|
@@ -871,7 +871,7 @@ jobs:
|
|
|
871
871
|
- name: Checkout
|
|
872
872
|
uses: actions/checkout@v6
|
|
873
873
|
- name: Cypress run
|
|
874
|
-
uses: cypress-io/github-action@
|
|
874
|
+
uses: cypress-io/github-action@v7
|
|
875
875
|
with:
|
|
876
876
|
start: npm run api, npm run web
|
|
877
877
|
```
|
|
@@ -901,7 +901,7 @@ jobs:
|
|
|
901
901
|
- name: Checkout
|
|
902
902
|
uses: actions/checkout@v6
|
|
903
903
|
- name: Cypress run
|
|
904
|
-
uses: cypress-io/github-action@
|
|
904
|
+
uses: cypress-io/github-action@v7
|
|
905
905
|
with:
|
|
906
906
|
start: npm start
|
|
907
907
|
# quote the url to be safe against YML parsing surprises
|
|
@@ -915,7 +915,7 @@ jobs:
|
|
|
915
915
|
By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout in seconds using `wait-on-timeout`.
|
|
916
916
|
|
|
917
917
|
```yml
|
|
918
|
-
- uses: cypress-io/github-action@
|
|
918
|
+
- uses: cypress-io/github-action@v7
|
|
919
919
|
with:
|
|
920
920
|
start: npm start
|
|
921
921
|
wait-on: 'http://localhost:8080/status'
|
|
@@ -926,7 +926,7 @@ By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout i
|
|
|
926
926
|
You can wait for multiple URLs to respond by separating urls with a comma
|
|
927
927
|
|
|
928
928
|
```yml
|
|
929
|
-
- uses: cypress-io/github-action@
|
|
929
|
+
- uses: cypress-io/github-action@v7
|
|
930
930
|
with:
|
|
931
931
|
# API runs on port 3050
|
|
932
932
|
# Web server runs on port 8080
|
|
@@ -940,7 +940,7 @@ The action will wait for the first url to respond, then will check the second ur
|
|
|
940
940
|
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:
|
|
941
941
|
|
|
942
942
|
```yml
|
|
943
|
-
- uses: cypress-io/github-action@
|
|
943
|
+
- uses: cypress-io/github-action@v7
|
|
944
944
|
with:
|
|
945
945
|
start: npm start
|
|
946
946
|
wait-on: 'npx wait-on --timeout 60000 http://localhost:3000'
|
|
@@ -955,7 +955,7 @@ If this action times out waiting for the server to respond, please see [Debuggin
|
|
|
955
955
|
The action installs dependencies based on a package manager lock file using default commands described in the [Installation](#installation) section below. If you want to overwrite the default install command you can use the `install-command` option:
|
|
956
956
|
|
|
957
957
|
```yml
|
|
958
|
-
- uses: cypress-io/github-action@
|
|
958
|
+
- uses: cypress-io/github-action@v7
|
|
959
959
|
with:
|
|
960
960
|
install-command: yarn --frozen-lockfile --silent
|
|
961
961
|
```
|
|
@@ -990,7 +990,7 @@ jobs:
|
|
|
990
990
|
- name: Checkout
|
|
991
991
|
uses: actions/checkout@v6
|
|
992
992
|
- name: Cypress run
|
|
993
|
-
uses: cypress-io/github-action@
|
|
993
|
+
uses: cypress-io/github-action@v7
|
|
994
994
|
with:
|
|
995
995
|
command-prefix: 'percy exec -- npx'
|
|
996
996
|
browser: chrome
|
|
@@ -1016,7 +1016,7 @@ Correct example snippet:
|
|
|
1016
1016
|
```yml
|
|
1017
1017
|
steps:
|
|
1018
1018
|
- uses: actions/checkout@v6
|
|
1019
|
-
- uses: cypress-io/github-action@
|
|
1019
|
+
- uses: cypress-io/github-action@v7
|
|
1020
1020
|
with:
|
|
1021
1021
|
command: npm run custom-test
|
|
1022
1022
|
```
|
|
@@ -1039,7 +1039,7 @@ jobs:
|
|
|
1039
1039
|
containers: [1, 2, 3]
|
|
1040
1040
|
steps:
|
|
1041
1041
|
- uses: actions/checkout@v6
|
|
1042
|
-
- uses: cypress-io/github-action@
|
|
1042
|
+
- uses: cypress-io/github-action@v7
|
|
1043
1043
|
with:
|
|
1044
1044
|
record: true
|
|
1045
1045
|
parallel: true
|
|
@@ -1074,7 +1074,7 @@ jobs:
|
|
|
1074
1074
|
needs: ['prepare']
|
|
1075
1075
|
steps:
|
|
1076
1076
|
- uses: actions/checkout@v6
|
|
1077
|
-
- uses: cypress-io/github-action@
|
|
1077
|
+
- uses: cypress-io/github-action@v7
|
|
1078
1078
|
with:
|
|
1079
1079
|
record: true
|
|
1080
1080
|
parallel: true
|
|
@@ -1114,7 +1114,7 @@ jobs:
|
|
|
1114
1114
|
runs-on: ubuntu-24.04
|
|
1115
1115
|
steps:
|
|
1116
1116
|
- uses: actions/checkout@v6
|
|
1117
|
-
- uses: cypress-io/github-action@
|
|
1117
|
+
- uses: cypress-io/github-action@v7
|
|
1118
1118
|
with:
|
|
1119
1119
|
start: npm start
|
|
1120
1120
|
working-directory: app-test
|
|
@@ -1160,16 +1160,21 @@ jobs:
|
|
|
1160
1160
|
|
|
1161
1161
|
# Cypress has its own package.json in folder "e2e"
|
|
1162
1162
|
- name: Install Cypress and run tests
|
|
1163
|
-
uses: cypress-io/github-action@
|
|
1163
|
+
uses: cypress-io/github-action@v7
|
|
1164
1164
|
with:
|
|
1165
1165
|
working-directory: e2e
|
|
1166
1166
|
```
|
|
1167
1167
|
|
|
1168
1168
|
### pnpm
|
|
1169
1169
|
|
|
1170
|
-
The package manager `pnpm` is not pre-installed in [GitHub Actions runner images](https://github.com/actions/runner-images)
|
|
1170
|
+
The package manager `pnpm` is not pre-installed in [GitHub Actions runner images](https://github.com/actions/runner-images)
|
|
1171
|
+
(unlike npm and Yarn Classic) and so it must be installed in a separate workflow step (see below).
|
|
1172
|
+
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.
|
|
1171
1173
|
|
|
1172
|
-
The example below follows [pnpm recommendations](https://pnpm.io/continuous-integration#github-actions) for installing pnpm and caching the
|
|
1174
|
+
The example below follows [pnpm recommendations](https://pnpm.io/continuous-integration#github-actions) for installing pnpm and caching the
|
|
1175
|
+
[pnpm store](https://pnpm.io/cli/store).
|
|
1176
|
+
Follow the [Cypress pnpm configuration instructions](https://docs.cypress.io/app/get-started/install-cypress#pnpm-configuration)
|
|
1177
|
+
and apply them to your project, to enable pnpm to install the Cypress binary.
|
|
1173
1178
|
|
|
1174
1179
|
```yaml
|
|
1175
1180
|
name: example-basic-pnpm
|
|
@@ -1191,8 +1196,9 @@ jobs:
|
|
|
1191
1196
|
cache: 'pnpm'
|
|
1192
1197
|
cache-dependency-path: examples/basic-pnpm/pnpm-lock.yaml
|
|
1193
1198
|
- name: Cypress run
|
|
1194
|
-
uses: cypress-io/github-action@
|
|
1199
|
+
uses: cypress-io/github-action@v7
|
|
1195
1200
|
with:
|
|
1201
|
+
package-manager-cache: false
|
|
1196
1202
|
working-directory: examples/basic-pnpm
|
|
1197
1203
|
```
|
|
1198
1204
|
|
|
@@ -1200,16 +1206,22 @@ jobs:
|
|
|
1200
1206
|
|
|
1201
1207
|
### pnpm workspaces
|
|
1202
1208
|
|
|
1203
|
-
The action does not directly support using [pnpm workspaces](https://pnpm.io/workspaces)
|
|
1209
|
+
The action does not directly support using [pnpm workspaces](https://pnpm.io/workspaces)
|
|
1210
|
+
(see feature request [#1144](https://github.com/cypress-io/github-action/issues/1144)).
|
|
1211
|
+
As a workaround, you can install dependencies and run Cypress tests in a workspace in separate steps.
|
|
1212
|
+
The snippet below shows this principle.
|
|
1204
1213
|
|
|
1205
1214
|
```yml
|
|
1206
1215
|
...
|
|
1207
1216
|
- name: Install dependencies
|
|
1208
|
-
|
|
1209
|
-
|
|
1217
|
+
uses: cypress-io/github-action@v7
|
|
1218
|
+
with:
|
|
1219
|
+
package-manager-cache: false
|
|
1220
|
+
runTests: false
|
|
1221
|
+
working-directory: examples/start-and-pnpm-workspaces
|
|
1210
1222
|
|
|
1211
1223
|
- name: Cypress test
|
|
1212
|
-
uses: cypress-io/github-action@
|
|
1224
|
+
uses: cypress-io/github-action@v7
|
|
1213
1225
|
with:
|
|
1214
1226
|
install: false
|
|
1215
1227
|
working-directory: examples/start-and-pnpm-workspaces/packages/workspace-1
|
|
@@ -1234,7 +1246,7 @@ jobs:
|
|
|
1234
1246
|
- name: Checkout
|
|
1235
1247
|
uses: actions/checkout@v6
|
|
1236
1248
|
- name: Cypress run
|
|
1237
|
-
uses: cypress-io/github-action@
|
|
1249
|
+
uses: cypress-io/github-action@v7
|
|
1238
1250
|
with:
|
|
1239
1251
|
working-directory: examples/yarn-classic
|
|
1240
1252
|
```
|
|
@@ -1264,7 +1276,7 @@ jobs:
|
|
|
1264
1276
|
cache: yarn
|
|
1265
1277
|
cache-dependency-path: examples/yarn-modern/yarn.lock
|
|
1266
1278
|
- name: Cypress run
|
|
1267
|
-
uses: cypress-io/github-action@
|
|
1279
|
+
uses: cypress-io/github-action@v7
|
|
1268
1280
|
with:
|
|
1269
1281
|
working-directory: examples/yarn-modern
|
|
1270
1282
|
install-command: yarn install
|
|
@@ -1291,7 +1303,7 @@ jobs:
|
|
|
1291
1303
|
- name: Checkout
|
|
1292
1304
|
uses: actions/checkout@v6
|
|
1293
1305
|
- name: Cypress run
|
|
1294
|
-
uses: cypress-io/github-action@
|
|
1306
|
+
uses: cypress-io/github-action@v7
|
|
1295
1307
|
with:
|
|
1296
1308
|
working-directory: examples/yarn-modern-pnp
|
|
1297
1309
|
install-command: yarn install
|
|
@@ -1319,7 +1331,7 @@ jobs:
|
|
|
1319
1331
|
runs-on: ubuntu-24.04
|
|
1320
1332
|
steps:
|
|
1321
1333
|
- uses: actions/checkout@v6
|
|
1322
|
-
- uses: cypress-io/github-action@
|
|
1334
|
+
- uses: cypress-io/github-action@v7
|
|
1323
1335
|
with:
|
|
1324
1336
|
working-directory: examples/start-and-yarn-workspaces/workspace-1
|
|
1325
1337
|
build: yarn run build
|
|
@@ -1329,6 +1341,38 @@ jobs:
|
|
|
1329
1341
|
|
|
1330
1342
|
[](.github/workflows/example-start-and-yarn-workspaces.yml)
|
|
1331
1343
|
|
|
1344
|
+
### Package manager cache disable
|
|
1345
|
+
|
|
1346
|
+
When the action installs dependencies,
|
|
1347
|
+
it caches the package manager cache from npm or from Yarn 1 (Classic) by default,
|
|
1348
|
+
based on the [lockfile](#package-manager-cache) it discovers.
|
|
1349
|
+
If package manager caching is implemented separately from the action,
|
|
1350
|
+
for example to work with Yarn Modern or pnpm,
|
|
1351
|
+
then disable the actions' package manager caching by setting the parameter
|
|
1352
|
+
`package-manager-cache` to `false`.
|
|
1353
|
+
|
|
1354
|
+
GitHub's [actions/setup-node](https://github.com/actions/setup-node/blob/main/README.md) offers a convenient way to install a chosen version of Node.js
|
|
1355
|
+
and to set up caching of package manager caches in one step.
|
|
1356
|
+
|
|
1357
|
+
```yml
|
|
1358
|
+
name: Package manager caching
|
|
1359
|
+
on: push
|
|
1360
|
+
jobs:
|
|
1361
|
+
cypress-run:
|
|
1362
|
+
runs-on: ubuntu-24.04
|
|
1363
|
+
name:
|
|
1364
|
+
steps:
|
|
1365
|
+
- uses: actions/checkout@v6
|
|
1366
|
+
- uses: actions/setup-node@v6
|
|
1367
|
+
with:
|
|
1368
|
+
node-version: lts
|
|
1369
|
+
cache: 'pnpm'
|
|
1370
|
+
cache-dependency-path: pnpm-lock.yaml
|
|
1371
|
+
- uses: cypress-io/github-action@v7
|
|
1372
|
+
with:
|
|
1373
|
+
package-manager-cache: false
|
|
1374
|
+
```
|
|
1375
|
+
|
|
1332
1376
|
### Custom cache key
|
|
1333
1377
|
|
|
1334
1378
|
Sometimes the default cache key does not work. For example, if you cannot share the Node modules across Node versions due to native extensions. In that case pass your own `cache-key` parameter.
|
|
@@ -1345,16 +1389,16 @@ jobs:
|
|
|
1345
1389
|
node: [20, 22, 24, 25]
|
|
1346
1390
|
name: E2E on Node v${{ matrix.node }}
|
|
1347
1391
|
steps:
|
|
1392
|
+
- name: Checkout
|
|
1393
|
+
uses: actions/checkout@v6
|
|
1348
1394
|
- name: Install Node.js
|
|
1349
1395
|
uses: actions/setup-node@v6
|
|
1350
1396
|
with:
|
|
1351
1397
|
node-version: ${{ matrix.node }}
|
|
1352
|
-
- name: Checkout
|
|
1353
|
-
uses: actions/checkout@v6
|
|
1354
1398
|
# run Cypress tests and record them under the same run
|
|
1355
1399
|
# associated with commit SHA and just give a different group name
|
|
1356
1400
|
- name: Cypress run
|
|
1357
|
-
uses: cypress-io/github-action@
|
|
1401
|
+
uses: cypress-io/github-action@v7
|
|
1358
1402
|
with:
|
|
1359
1403
|
record: true
|
|
1360
1404
|
group: Tests on Node v${{ matrix.node }}
|
|
@@ -1379,11 +1423,11 @@ jobs:
|
|
|
1379
1423
|
node: [20, 22, 24, 25]
|
|
1380
1424
|
name: E2E on Node v${{ matrix.node }}
|
|
1381
1425
|
steps:
|
|
1426
|
+
- uses: actions/checkout@v6
|
|
1382
1427
|
- uses: actions/setup-node@v6
|
|
1383
1428
|
with:
|
|
1384
1429
|
node-version: ${{ matrix.node }}
|
|
1385
|
-
- uses:
|
|
1386
|
-
- uses: cypress-io/github-action@v6
|
|
1430
|
+
- uses: cypress-io/github-action@v7
|
|
1387
1431
|
```
|
|
1388
1432
|
|
|
1389
1433
|
See the [Node.js](#nodejs) section for information about supported versions and usage of Node.js.
|
|
@@ -1403,13 +1447,13 @@ jobs:
|
|
|
1403
1447
|
steps:
|
|
1404
1448
|
- uses: actions/checkout@v6
|
|
1405
1449
|
- name: Install dependencies
|
|
1406
|
-
uses: cypress-io/github-action@
|
|
1450
|
+
uses: cypress-io/github-action@v7
|
|
1407
1451
|
with:
|
|
1408
1452
|
# just perform install
|
|
1409
1453
|
runTests: false
|
|
1410
1454
|
- run: yarn lint
|
|
1411
1455
|
- name: Run e2e tests
|
|
1412
|
-
uses: cypress-io/github-action@
|
|
1456
|
+
uses: cypress-io/github-action@v7
|
|
1413
1457
|
with:
|
|
1414
1458
|
# we have already installed all dependencies above
|
|
1415
1459
|
install: false
|
|
@@ -1436,7 +1480,7 @@ jobs:
|
|
|
1436
1480
|
steps:
|
|
1437
1481
|
- uses: actions/checkout@v6
|
|
1438
1482
|
- name: Build app
|
|
1439
|
-
uses: cypress-io/github-action@
|
|
1483
|
+
uses: cypress-io/github-action@v7
|
|
1440
1484
|
with:
|
|
1441
1485
|
runTests: false # only build app, don't test yet
|
|
1442
1486
|
build: npm run build
|
|
@@ -1460,7 +1504,7 @@ jobs:
|
|
|
1460
1504
|
path: build
|
|
1461
1505
|
|
|
1462
1506
|
- name: Cypress tests
|
|
1463
|
-
uses: cypress-io/github-action@
|
|
1507
|
+
uses: cypress-io/github-action@v7
|
|
1464
1508
|
with:
|
|
1465
1509
|
start: npm start # start server using the build artifacts
|
|
1466
1510
|
```
|
|
@@ -1484,7 +1528,7 @@ If the project has many dependencies, but you want to install just Cypress you c
|
|
|
1484
1528
|
node_modules
|
|
1485
1529
|
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
|
|
1486
1530
|
- run: npm i cypress
|
|
1487
|
-
- uses: cypress-io/github-action@
|
|
1531
|
+
- uses: cypress-io/github-action@v7
|
|
1488
1532
|
with:
|
|
1489
1533
|
install: false
|
|
1490
1534
|
```
|
|
@@ -1504,7 +1548,7 @@ jobs:
|
|
|
1504
1548
|
timeout-minutes: 10
|
|
1505
1549
|
steps:
|
|
1506
1550
|
- uses: actions/checkout@v6
|
|
1507
|
-
- uses: cypress-io/github-action@
|
|
1551
|
+
- uses: cypress-io/github-action@v7
|
|
1508
1552
|
# you can specify individual step timeout too
|
|
1509
1553
|
timeout-minutes: 5
|
|
1510
1554
|
```
|
|
@@ -1522,7 +1566,7 @@ jobs:
|
|
|
1522
1566
|
|
|
1523
1567
|
To migrate from Cypress [CLI run command options](https://on.cypress.io/command-line#Options) to Cypress GitHub Action parameters, check the [CLI Run Option / Action Parameter](#cli-run-option--action-parameter) table below. In most cases, the name of the action parameter is the same as the long form of the `cypress run` CLI option.
|
|
1524
1568
|
|
|
1525
|
-
Create a [GitHub Actions workflow](https://docs.github.com/en/actions/writing-workflows/quickstart) referring to [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions). The action `cypress-io/github-action@
|
|
1569
|
+
Create a [GitHub Actions workflow](https://docs.github.com/en/actions/writing-workflows/quickstart) referring to [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions). The action `cypress-io/github-action@v7` is invoked with the `uses` keyword. Cypress GitHub Action input parameters are specified under the [with](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith) keyword.
|
|
1526
1570
|
|
|
1527
1571
|
If you have previously been using a [CLI command](https://on.cypress.io/command-line#cypress-run) to run Cypress locally or in a CI environment, you will be familiar with testing commands like this:
|
|
1528
1572
|
|
|
@@ -1548,7 +1592,7 @@ jobs:
|
|
|
1548
1592
|
- name: Check out repo
|
|
1549
1593
|
uses: actions/checkout@v6
|
|
1550
1594
|
- name: Cypress run # install dependencies and run Cypress E2E tests
|
|
1551
|
-
uses: cypress-io/github-action@
|
|
1595
|
+
uses: cypress-io/github-action@v7 # replaces CLI cypress run
|
|
1552
1596
|
with:
|
|
1553
1597
|
browser: chrome # replaces CLI option --browser chrome
|
|
1554
1598
|
spec: cypress/e2e/spec.cy.js # replaces CLI option --spec cypress/e2e/spec.cy.js
|
|
@@ -1627,7 +1671,7 @@ You can set the environment variable using GitHub UI interface, or in the workfl
|
|
|
1627
1671
|
|
|
1628
1672
|
```yml
|
|
1629
1673
|
- name: Cypress tests with debug logs
|
|
1630
|
-
uses: cypress-io/github-action@
|
|
1674
|
+
uses: cypress-io/github-action@v7
|
|
1631
1675
|
env:
|
|
1632
1676
|
DEBUG: '@cypress/github-action'
|
|
1633
1677
|
```
|
|
@@ -1642,7 +1686,7 @@ To see all [Cypress debug logs](https://on.cypress.io/troubleshooting#Print-DEBU
|
|
|
1642
1686
|
|
|
1643
1687
|
```yml
|
|
1644
1688
|
- name: Cypress tests with debug logs
|
|
1645
|
-
uses: cypress-io/github-action@
|
|
1689
|
+
uses: cypress-io/github-action@v7
|
|
1646
1690
|
env:
|
|
1647
1691
|
DEBUG: 'cypress:*'
|
|
1648
1692
|
```
|
|
@@ -1698,7 +1742,7 @@ This is an example of using the step output `resultsUrl`:
|
|
|
1698
1742
|
|
|
1699
1743
|
```yml
|
|
1700
1744
|
- name: Cypress tests
|
|
1701
|
-
uses: cypress-io/github-action@
|
|
1745
|
+
uses: cypress-io/github-action@v7
|
|
1702
1746
|
# let's give this action an ID so we can refer
|
|
1703
1747
|
# to its output values later
|
|
1704
1748
|
id: cypress
|
|
@@ -1735,7 +1779,7 @@ jobs:
|
|
|
1735
1779
|
- name: Checkout
|
|
1736
1780
|
uses: actions/checkout@v6
|
|
1737
1781
|
- name: Cypress run
|
|
1738
|
-
uses: cypress-io/github-action@
|
|
1782
|
+
uses: cypress-io/github-action@v7
|
|
1739
1783
|
with:
|
|
1740
1784
|
build: npx cypress info
|
|
1741
1785
|
```
|
|
@@ -1752,14 +1796,14 @@ jobs:
|
|
|
1752
1796
|
- name: Checkout
|
|
1753
1797
|
uses: actions/checkout@v6
|
|
1754
1798
|
- name: Cypress install
|
|
1755
|
-
uses: cypress-io/github-action@
|
|
1799
|
+
uses: cypress-io/github-action@v7
|
|
1756
1800
|
with:
|
|
1757
1801
|
# just perform install
|
|
1758
1802
|
runTests: false
|
|
1759
1803
|
- name: Cypress info
|
|
1760
1804
|
run: npx cypress info
|
|
1761
1805
|
- name: Cypress run
|
|
1762
|
-
uses: cypress-io/github-action@
|
|
1806
|
+
uses: cypress-io/github-action@v7
|
|
1763
1807
|
with:
|
|
1764
1808
|
# we have already installed all dependencies above
|
|
1765
1809
|
install: false
|
|
@@ -1783,7 +1827,7 @@ jobs:
|
|
|
1783
1827
|
- name: Checkout
|
|
1784
1828
|
uses: actions/checkout@v6
|
|
1785
1829
|
- name: Cypress nightly tests 🌃
|
|
1786
|
-
uses: cypress-io/github-action@
|
|
1830
|
+
uses: cypress-io/github-action@v7
|
|
1787
1831
|
```
|
|
1788
1832
|
|
|
1789
1833
|
[](.github/workflows/example-cron.yml)
|
|
@@ -1803,11 +1847,11 @@ jobs:
|
|
|
1803
1847
|
steps:
|
|
1804
1848
|
- uses: actions/checkout@v6
|
|
1805
1849
|
- name: Cypress headless tests
|
|
1806
|
-
uses: cypress-io/github-action@
|
|
1850
|
+
uses: cypress-io/github-action@v7
|
|
1807
1851
|
with:
|
|
1808
1852
|
summary-title: 'Headless'
|
|
1809
1853
|
- name: Cypress headed tests
|
|
1810
|
-
uses: cypress-io/github-action@
|
|
1854
|
+
uses: cypress-io/github-action@v7
|
|
1811
1855
|
with:
|
|
1812
1856
|
install: false
|
|
1813
1857
|
headed: true
|
|
@@ -1832,7 +1876,7 @@ jobs:
|
|
|
1832
1876
|
- name: Checkout
|
|
1833
1877
|
uses: actions/checkout@v6
|
|
1834
1878
|
- name: Cypress run
|
|
1835
|
-
uses: cypress-io/github-action@
|
|
1879
|
+
uses: cypress-io/github-action@v7
|
|
1836
1880
|
with:
|
|
1837
1881
|
publish-summary: false
|
|
1838
1882
|
```
|
|
@@ -1841,7 +1885,7 @@ jobs:
|
|
|
1841
1885
|
|
|
1842
1886
|
### Support
|
|
1843
1887
|
|
|
1844
|
-
Node.js is required to run this action. The recommended version `
|
|
1888
|
+
Node.js is required to run this action. The recommended version `v7` supports:
|
|
1845
1889
|
|
|
1846
1890
|
- **Node.js** 20.x, 22.x, 24.x and 25.x
|
|
1847
1891
|
|
|
@@ -1853,7 +1897,7 @@ and is generally aligned with [Node.js's release schedule](https://github.com/no
|
|
|
1853
1897
|
|
|
1854
1898
|
[](.github/workflows/example-node-versions.yml)
|
|
1855
1899
|
|
|
1856
|
-
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@
|
|
1900
|
+
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@v7` uses `node24`.
|
|
1857
1901
|
|
|
1858
1902
|
## Changelog
|
|
1859
1903
|
|
|
@@ -1861,10 +1905,13 @@ View the [CHANGELOG](./CHANGELOG.md) document for an overview of version changes
|
|
|
1861
1905
|
|
|
1862
1906
|
## Compatibility
|
|
1863
1907
|
|
|
1864
|
-
- `github-action@
|
|
1908
|
+
- `github-action@v7` is the current recommended version, uses `node24` and is compatible with Cypress `10` and above.
|
|
1909
|
+
- `github-action@v6` is deprecated. It uses `node20` which GitHub has deprecated. GitHub Actions will force runners to use `node24` beginning on Mar 4, 2026 - see [Deprecation of Node 20 on GitHub Actions runners](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/).
|
|
1865
1910
|
- `github-action@v6.7.9` is the minimum version required to use GitHub Actions caching services. The legacy caching service used by lower versions of the action is no longer available.
|
|
1866
1911
|
- `github-action` versions `v1` to `v5` are unsupported: they rely on Node.js `12` and `16` in End-of-life status.
|
|
1867
1912
|
|
|
1913
|
+
Cypress lists browser compatibility information under [System Requirements](https://docs.cypress.io/app/get-started/install-cypress#Browsers).
|
|
1914
|
+
|
|
1868
1915
|
## Contributing
|
|
1869
1916
|
|
|
1870
1917
|
Please see our [Contributing Guideline](./CONTRIBUTING.md) which explains how to contribute fixes or features to the repo and how to test.
|
package/action.yml
CHANGED
|
@@ -83,6 +83,10 @@ inputs:
|
|
|
83
83
|
install-command:
|
|
84
84
|
description: 'Custom install command to use'
|
|
85
85
|
required: false
|
|
86
|
+
package-manager-cache:
|
|
87
|
+
description: 'Set to false to disable automatic package manager caching. By default, package manager caching is enabled.'
|
|
88
|
+
required: false
|
|
89
|
+
default: true
|
|
86
90
|
publish-summary:
|
|
87
91
|
description: 'Whether or not to publish a job summary'
|
|
88
92
|
required: false
|
|
@@ -115,7 +119,7 @@ outputs:
|
|
|
115
119
|
resultsUrl:
|
|
116
120
|
description: 'Cypress Cloud URL if the run was recorded'
|
|
117
121
|
runs:
|
|
118
|
-
using: '
|
|
122
|
+
using: 'node24'
|
|
119
123
|
main: 'dist/index.js'
|
|
120
124
|
branding:
|
|
121
125
|
color: 'green'
|
package/dist/index.js
CHANGED
|
@@ -102775,8 +102775,16 @@ const installMaybe = () => {
|
|
|
102775
102775
|
return Promise.resolve()
|
|
102776
102776
|
}
|
|
102777
102777
|
|
|
102778
|
+
const packageManagerCacheEnabled = getInputBool(
|
|
102779
|
+
'package-manager-cache',
|
|
102780
|
+
true
|
|
102781
|
+
)
|
|
102782
|
+
const npmCachePromise = packageManagerCacheEnabled
|
|
102783
|
+
? restoreCachedNpm()
|
|
102784
|
+
: Promise.resolve(false)
|
|
102785
|
+
|
|
102778
102786
|
return Promise.all([
|
|
102779
|
-
|
|
102787
|
+
npmCachePromise,
|
|
102780
102788
|
restoreCachedCypressBinary()
|
|
102781
102789
|
]).then(([npmCacheHit, cypressCacheHit]) => {
|
|
102782
102790
|
debug(`npm cache hit ${npmCacheHit}`)
|
|
@@ -102791,8 +102799,11 @@ const installMaybe = () => {
|
|
|
102791
102799
|
}
|
|
102792
102800
|
|
|
102793
102801
|
debug('verifying Cypress binary')
|
|
102802
|
+
const saveNpmPromise = packageManagerCacheEnabled
|
|
102803
|
+
? saveCachedNpm()
|
|
102804
|
+
: Promise.resolve(undefined)
|
|
102794
102805
|
return verifyCypressBinary()
|
|
102795
|
-
.then(
|
|
102806
|
+
.then(() => saveNpmPromise)
|
|
102796
102807
|
.then(saveCachedCypressBinary)
|
|
102797
102808
|
})
|
|
102798
102809
|
})
|