@cypress/github-action 5.1.0 → 5.2.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.
Files changed (2) hide show
  1. package/README.md +58 -47
  2. 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)
@@ -47,7 +48,7 @@
47
48
 
48
49
  ```yml
49
50
  name: End-to-end tests
50
- on: [push]
51
+ on: push
51
52
  jobs:
52
53
  cypress-run:
53
54
  runs-on: ubuntu-22.04
@@ -88,15 +89,16 @@ By using the full version tag, you will avoid accidentally using a newer version
88
89
 
89
90
  ### Browser
90
91
 
91
- Specify the browser name or path with `browser` parameter
92
+ 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).
93
+
94
+ ### Chrome
92
95
 
93
96
  ```yml
94
- name: E2E on Chrome
95
- on: [push]
97
+ name: Chrome
98
+ on: push
96
99
  jobs:
97
- cypress-run:
100
+ chrome:
98
101
  runs-on: ubuntu-22.04
99
- # let's make sure our tests pass on Chrome browser
100
102
  name: E2E on Chrome
101
103
  steps:
102
104
  - uses: actions/checkout@v3
@@ -109,17 +111,13 @@ jobs:
109
111
 
110
112
  ### Firefox
111
113
 
112
- In order to run Firefox, you need to use non-root user (Firefox security restriction).
113
-
114
114
  ```yml
115
115
  name: Firefox
116
116
  on: push
117
117
  jobs:
118
118
  firefox:
119
119
  runs-on: ubuntu-22.04
120
- container:
121
- image: cypress/browsers:node18.12.0-chrome106-ff106
122
- options: --user 1001
120
+ name: E2E on Firefox
123
121
  steps:
124
122
  - uses: actions/checkout@v3
125
123
  - uses: cypress-io/github-action@v5
@@ -129,16 +127,15 @@ jobs:
129
127
 
130
128
  [![Firefox example](https://github.com/cypress-io/github-action/workflows/example-firefox/badge.svg?branch=master)](.github/workflows/example-firefox.yml)
131
129
 
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
130
  ### Edge
135
131
 
136
132
  ```yml
137
133
  name: Edge
138
134
  on: push
139
135
  jobs:
140
- tests:
136
+ edge:
141
137
  runs-on: windows-latest
138
+ name: E2E on Edge
142
139
  steps:
143
140
  - uses: actions/checkout@v3
144
141
  - uses: cypress-io/github-action@v5
@@ -154,7 +151,7 @@ Run the browser in headed mode - as of Cypress v8.0 the `cypress run` command ex
154
151
 
155
152
  ```yml
156
153
  name: Chrome headed
157
- on: [push]
154
+ on: push
158
155
  jobs:
159
156
  cypress-run:
160
157
  runs-on: ubuntu-22.04
@@ -172,7 +169,7 @@ You can run tests in a GH Action in your Docker container.
172
169
 
173
170
  ```yml
174
171
  name: E2E in custom container
175
- on: [push]
172
+ on: push
176
173
  jobs:
177
174
  cypress-run:
178
175
  runs-on: ubuntu-22.04
@@ -192,7 +189,7 @@ Specify the env argument with `env` parameter
192
189
 
193
190
  ```yml
194
191
  name: Cypress tests
195
- on: [push]
192
+ on: push
196
193
  jobs:
197
194
  cypress-run:
198
195
  runs-on: ubuntu-22.04
@@ -210,7 +207,7 @@ When passing the environment variables this way, unfortunately due to GitHub Act
210
207
 
211
208
  ```yml
212
209
  name: Cypress tests
213
- on: [push]
210
+ on: push
214
211
  jobs:
215
212
  cypress-run:
216
213
  runs-on: ubuntu-22.04
@@ -235,7 +232,7 @@ Specify the [spec files to run](https://docs.cypress.io/guides/guides/command-li
235
232
 
236
233
  ```yml
237
234
  name: Cypress tests
238
- on: [push]
235
+ on: push
239
236
  jobs:
240
237
  cypress-run:
241
238
  name: Cypress run
@@ -266,7 +263,7 @@ Specify the [project to run](https://docs.cypress.io/guides/guides/command-line.
266
263
 
267
264
  ```yml
268
265
  name: Cypress tests
269
- on: [push]
266
+ on: push
270
267
  jobs:
271
268
  cypress-run:
272
269
  name: Cypress run
@@ -286,7 +283,7 @@ For more information, visit [the Cypress command-line docs](https://on.cypress.i
286
283
 
287
284
  ```yml
288
285
  name: Cypress tests
289
- on: [push]
286
+ on: push
290
287
  jobs:
291
288
  cypress-run:
292
289
  name: Cypress run
@@ -318,7 +315,7 @@ jobs:
318
315
 
319
316
  ```yml
320
317
  name: Cypress tests
321
- on: [push]
318
+ on: push
322
319
  jobs:
323
320
  cypress-run:
324
321
  name: Cypress run
@@ -346,7 +343,7 @@ You can provide `quiet` flag for cypress run to silence any Cypress specific out
346
343
 
347
344
  ```yml
348
345
  name: example-quiet
349
- on: [push]
346
+ on: push
350
347
  jobs:
351
348
  cypress-run:
352
349
  runs-on: ubuntu-22.04
@@ -370,7 +367,7 @@ You can pass a single or multiple tags when recording a run. For example
370
367
 
371
368
  ```yml
372
369
  name: tags
373
- on: [push]
370
+ on: push
374
371
  jobs:
375
372
  cypress-run:
376
373
  runs-on: ubuntu-22.04
@@ -413,7 +410,7 @@ This feature requires Cypress 12.6.0 or later and a [Cypress Cloud Business or E
413
410
 
414
411
  ```yml
415
412
  name: Cypress E2E Tests
416
- on: [push]
413
+ on: push
417
414
  jobs:
418
415
  cypress-run:
419
416
  runs-on: ubuntu-22.04
@@ -444,7 +441,7 @@ If you don't record the test run on Cypress Cloud, you can still store generated
444
441
 
445
442
  ```yml
446
443
  name: Artifacts
447
- on: [push]
444
+ on: push
448
445
  jobs:
449
446
  cypress-run:
450
447
  runs-on: ubuntu-22.04
@@ -477,7 +474,7 @@ Specify [configuration](https://docs.cypress.io/guides/references/configuration.
477
474
 
478
475
  ```yml
479
476
  name: Cypress tests
480
- on: [push]
477
+ on: push
481
478
  jobs:
482
479
  cypress-run:
483
480
  name: Cypress run
@@ -500,7 +497,7 @@ Specify the path to your config file with `config-file` parameter
500
497
 
501
498
  ```yml
502
499
  name: Cypress tests
503
- on: [push]
500
+ on: push
504
501
  jobs:
505
502
  cypress-run:
506
503
  name: Cypress run
@@ -523,9 +520,7 @@ You can spin multiple containers running in parallel using `strategy: matrix` ar
523
520
 
524
521
  ```yml
525
522
  name: Parallel Cypress Tests
526
-
527
- on: [push]
528
-
523
+ on: push
529
524
  jobs:
530
525
  test:
531
526
  name: Cypress run
@@ -590,7 +585,7 @@ You can run a build step before starting tests
590
585
 
591
586
  ```yml
592
587
  name: Build
593
- on: [push]
588
+ on: push
594
589
  jobs:
595
590
  cypress-run:
596
591
  runs-on: ubuntu-22.04
@@ -609,7 +604,7 @@ If your tests run against a local server, use `start` parameter, the server will
609
604
 
610
605
  ```yml
611
606
  name: With server
612
- on: [push]
607
+ on: push
613
608
  jobs:
614
609
  cypress-run:
615
610
  runs-on: ubuntu-22.04
@@ -626,7 +621,7 @@ jobs:
626
621
 
627
622
  ```yml
628
623
  name: With server
629
- on: [push]
624
+ on: push
630
625
  jobs:
631
626
  cypress-run:
632
627
  runs-on: ubuntu-22.04
@@ -652,7 +647,7 @@ You can start multiple server processes. For example, if you have an API to star
652
647
 
653
648
  ```yml
654
649
  name: With servers
655
- on: [push]
650
+ on: push
656
651
  jobs:
657
652
  cypress-run:
658
653
  runs-on: ubuntu-22.04
@@ -682,7 +677,7 @@ If you are starting a local server and it takes a while to start, you can add a
682
677
 
683
678
  ```yml
684
679
  name: After server responds
685
- on: [push]
680
+ on: push
686
681
  jobs:
687
682
  cypress-run:
688
683
  runs-on: ubuntu-22.04
@@ -739,6 +734,14 @@ See [example-wait-on.yml](.github/workflows/example-wait-on.yml) workflow file.
739
734
 
740
735
  If this action times out waiting for the server to respond, please see [Debugging](#debugging) section in this README file.
741
736
 
737
+ #### `wait-on` with Node.js 18+
738
+
739
+ 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.
740
+
741
+ - 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:
742
+ - 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)
743
+ - 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)
744
+
742
745
  ### Custom install command
743
746
 
744
747
  If you want to overwrite the install command
@@ -757,7 +760,7 @@ You can prefix the default test command using the `command-prefix` option. This
757
760
 
758
761
  ```yml
759
762
  name: Visual
760
- on: [push]
763
+ on: push
761
764
  jobs:
762
765
  e2e:
763
766
  runs-on: ubuntu-22.04
@@ -798,7 +801,7 @@ You can overwrite [`ci-build-id`](https://on.cypress.io/parallelization#Linking-
798
801
 
799
802
  ```yml
800
803
  name: Parallel
801
- on: [push]
804
+ on: push
802
805
  jobs:
803
806
  test:
804
807
  runs-on: ubuntu-22.04
@@ -838,7 +841,7 @@ jobs:
838
841
  # take the current commit + timestamp together
839
842
  # the typical value would be something like
840
843
  # "sha-5d3fe...35d3-time-1620841214"
841
- run: echo "::set-output name=value::sha-$GITHUB_SHA-time-$(date +"%s")"
844
+ run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT
842
845
  smoke-tests:
843
846
  needs: ['prepare']
844
847
  steps:
@@ -905,7 +908,7 @@ repo/
905
908
  You can specify the `app-test` working directory when running Cypress tests using the `working-directory` parameter
906
909
 
907
910
  ```yml
908
- on: [push]
911
+ on: push
909
912
  jobs:
910
913
  cypress-run:
911
914
  runs-on: ubuntu-22.04
@@ -968,7 +971,7 @@ This action should discover the Yarn workspaces correctly. For example, see fold
968
971
 
969
972
  ```yaml
970
973
  name: example-start-and-yarn-workspaces
971
- on: [push]
974
+ on: push
972
975
  jobs:
973
976
  single:
974
977
  # the example has Yarn workspace in its "root" folder
@@ -993,7 +996,7 @@ Sometimes the default cache key does not work. For example, if you cannot share
993
996
 
994
997
  ```yml
995
998
  name: End-to-end tests
996
- on: [push]
999
+ on: push
997
1000
  jobs:
998
1001
  cypress-run:
999
1002
  runs-on: ubuntu-22.04
@@ -1028,7 +1031,7 @@ You can run your tests across multiple Node versions.
1028
1031
 
1029
1032
  ```yml
1030
1033
  name: Node versions
1031
- on: [push]
1034
+ on: push
1032
1035
  jobs:
1033
1036
  cypress-run:
1034
1037
  runs-on: ubuntu-22.04
@@ -1146,6 +1149,14 @@ Name | Description
1146
1149
 
1147
1150
  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
1151
 
1152
+ 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:
1153
+
1154
+ ```yml
1155
+ - uses: cypress-io/github-action@v5
1156
+ with:
1157
+ install-command: yarn install
1158
+ ```
1159
+
1149
1160
  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
1161
 
1151
1162
  ## Debugging
@@ -1249,7 +1260,7 @@ If your repository does not have `package.json` or `yarn.json` (maybe it contain
1249
1260
 
1250
1261
  ```yml
1251
1262
  name: included
1252
- on: [push]
1263
+ on: push
1253
1264
  jobs:
1254
1265
  cypress-run:
1255
1266
  runs-on: ubuntu-22.04
@@ -1269,7 +1280,7 @@ If you are NOT using the `build` command in your project, you can run the `cypre
1269
1280
 
1270
1281
  ```yml
1271
1282
  name: info
1272
- on: [push]
1283
+ on: push
1273
1284
  jobs:
1274
1285
  cypress-run:
1275
1286
  runs-on: ubuntu-22.04
@@ -1286,7 +1297,7 @@ If you are already using the `build` parameter, you can split the [installation
1286
1297
 
1287
1298
  ```yml
1288
1299
  name: info
1289
- on: [push]
1300
+ on: push
1290
1301
  jobs:
1291
1302
  cypress-run:
1292
1303
  runs-on: ubuntu-22.04
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "5.1.0",
3
+ "version": "5.2.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
- "install-deps": "./scripts/npm-install-examples.sh"
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.13.0",
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",