@cypress/github-action 3.0.6 → 4.0.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 (4) hide show
  1. package/README.md +60 -59
  2. package/action.yml +6 -2
  3. package/dist/index.js +55620 -52668
  4. package/package.json +4 -3
package/README.md CHANGED
@@ -4,12 +4,13 @@
4
4
 
5
5
  ## Examples
6
6
 
7
+ - [Cypress 10](#cypress-10)
7
8
  - [Basic](#basic)
8
9
  - [Explicit version](#explicit-version)
9
10
  - Run tests in a given [browser](#browser)
10
- * using [Firefox](#firefox)
11
- * using [Edge](#edge)
12
- * using [headless mode](#headless)
11
+ - using [Firefox](#firefox)
12
+ - using [Edge](#edge)
13
+ - using [headless mode](#headless)
13
14
  - Using [Docker image](#docker-image)
14
15
  - Specify [environment variables](#env)
15
16
  - Run only some [spec files](#specs)
@@ -56,7 +57,7 @@ jobs:
56
57
  # Install NPM dependencies, cache them correctly
57
58
  # and run all Cypress tests
58
59
  - name: Cypress run
59
- uses: cypress-io/github-action@v2
60
+ uses: cypress-io/github-action@v4
60
61
  ```
61
62
 
62
63
  [![Basic example](https://github.com/cypress-io/github-action/workflows/example-basic/badge.svg?branch=master)](.github/workflows/example-basic.yml)
@@ -69,18 +70,18 @@ The workflow file [.github/workflows/example-basic.yml](.github/workflows/exampl
69
70
 
70
71
  **Best practice:**
71
72
 
72
- Our examples specify the tag of the action to use listing only the major version `@v2`
73
+ Our examples specify the tag of the action to use listing only the major version `@v4`
73
74
 
74
75
  ```yml
75
76
  - name: Cypress run
76
- uses: cypress-io/github-action@v2
77
+ uses: cypress-io/github-action@v4
77
78
  ```
78
79
 
79
- When using `cypress-io/github-action@v2` from your workflow file, you automatically will be using the latest [tagged version from this repository](https://github.com/cypress-io/github-action/tags). If you want to precisely control the version of this module, use the full tag version, for example:
80
+ When using `cypress-io/github-action@v4` from your workflow file, you automatically will be using the latest [tagged version from this repository](https://github.com/cypress-io/github-action/tags). If you want to precisely control the version of this module, use the full tag version, for example:
80
81
 
81
82
  ```yml
82
83
  - name: Cypress run
83
- uses: cypress-io/github-action@v2.2.7
84
+ uses: cypress-io/github-action@v4.x.x
84
85
  ```
85
86
 
86
87
  By using the full version tag, you will avoid accidentally using a newer version of the action.
@@ -99,7 +100,7 @@ jobs:
99
100
  name: E2E on Chrome
100
101
  steps:
101
102
  - uses: actions/checkout@v2
102
- - uses: cypress-io/github-action@v2
103
+ - uses: cypress-io/github-action@v4
103
104
  with:
104
105
  browser: chrome
105
106
  ```
@@ -121,7 +122,7 @@ jobs:
121
122
  options: --user 1001
122
123
  steps:
123
124
  - uses: actions/checkout@v2
124
- - uses: cypress-io/github-action@v2
125
+ - uses: cypress-io/github-action@v4
125
126
  with:
126
127
  browser: firefox
127
128
  ```
@@ -140,7 +141,7 @@ jobs:
140
141
  runs-on: windows-latest
141
142
  steps:
142
143
  - uses: actions/checkout@v2
143
- - uses: cypress-io/github-action@v2
144
+ - uses: cypress-io/github-action@v4
144
145
  with:
145
146
  browser: edge
146
147
  ```
@@ -161,7 +162,7 @@ jobs:
161
162
  runs-on: ubuntu-20.04
162
163
  steps:
163
164
  - uses: actions/checkout@v2
164
- - uses: cypress-io/github-action@v2
165
+ - uses: cypress-io/github-action@v4
165
166
  with:
166
167
  browser: chrome
167
168
  headless: true
@@ -182,7 +183,7 @@ jobs:
182
183
  container: cypress/browsers:node12.13.0-chrome78-ff70
183
184
  steps:
184
185
  - uses: actions/checkout@v2
185
- - uses: cypress-io/github-action@v2
186
+ - uses: cypress-io/github-action@v4
186
187
  with:
187
188
  browser: chrome
188
189
  ```
@@ -202,7 +203,7 @@ jobs:
202
203
  uses: actions/checkout@v2
203
204
 
204
205
  - name: Cypress run with env
205
- uses: cypress-io/github-action@v2
206
+ uses: cypress-io/github-action@v4
206
207
  with:
207
208
  env: host=api.dev.local,port=4222
208
209
  ```
@@ -220,7 +221,7 @@ jobs:
220
221
  uses: actions/checkout@v2
221
222
 
222
223
  - name: Cypress run with env
223
- uses: cypress-io/github-action@v2
224
+ uses: cypress-io/github-action@v4
224
225
  env:
225
226
  CYPRESS_host: api.dev.local
226
227
  CYPRESS_port: 4222
@@ -246,7 +247,7 @@ jobs:
246
247
  uses: actions/checkout@v2
247
248
 
248
249
  - name: Cypress run
249
- uses: cypress-io/github-action@v2
250
+ uses: cypress-io/github-action@v4
250
251
  with:
251
252
  spec: cypress/integration/spec1.js
252
253
  ```
@@ -276,7 +277,7 @@ jobs:
276
277
  - name: Checkout
277
278
  uses: actions/checkout@v2
278
279
  - name: Cypress run
279
- uses: cypress-io/github-action@v2
280
+ uses: cypress-io/github-action@v4
280
281
  with:
281
282
  project: ./some/nested/folder
282
283
  ```
@@ -297,7 +298,7 @@ jobs:
297
298
  uses: actions/checkout@v2
298
299
 
299
300
  - name: Cypress run
300
- uses: cypress-io/github-action@v2
301
+ uses: cypress-io/github-action@v4
301
302
  with:
302
303
  record: true
303
304
  env:
@@ -329,7 +330,7 @@ jobs:
329
330
  uses: actions/checkout@v2
330
331
 
331
332
  - name: Cypress run
332
- uses: cypress-io/github-action@v2
333
+ uses: cypress-io/github-action@v4
333
334
  with:
334
335
  record: true
335
336
  env:
@@ -391,7 +392,7 @@ jobs:
391
392
  uses: actions/checkout@v2
392
393
 
393
394
  - name: Cypress run
394
- uses: cypress-io/github-action@v2
395
+ uses: cypress-io/github-action@v4
395
396
  with:
396
397
  record: true
397
398
  tag: node-${{ matrix.node }}
@@ -419,7 +420,7 @@ jobs:
419
420
  name: Artifacts
420
421
  steps:
421
422
  - uses: actions/checkout@v2
422
- - uses: cypress-io/github-action@v2
423
+ - uses: cypress-io/github-action@v4
423
424
  # after the test run completes
424
425
  # store videos and any screenshots
425
426
  # NOTE: screenshots will be generated only if E2E test failed
@@ -455,7 +456,7 @@ jobs:
455
456
  uses: actions/checkout@v2
456
457
 
457
458
  - name: Cypress run
458
- uses: cypress-io/github-action@v2
459
+ uses: cypress-io/github-action@v4
459
460
  with:
460
461
  config: pageLoadTimeout=100000,baseUrl=http://localhost:3000
461
462
  ```
@@ -478,7 +479,7 @@ jobs:
478
479
  uses: actions/checkout@v2
479
480
 
480
481
  - name: Cypress run
481
- uses: cypress-io/github-action@v2
482
+ uses: cypress-io/github-action@v4
482
483
  with:
483
484
  config-file: tests/cypress-config.json
484
485
  ```
@@ -514,7 +515,7 @@ jobs:
514
515
  # because of "record" and "parallel" parameters
515
516
  # these containers will load balance all found tests among themselves
516
517
  - name: Cypress run
517
- uses: cypress-io/github-action@v2
518
+ uses: cypress-io/github-action@v4
518
519
  with:
519
520
  record: true
520
521
  parallel: true
@@ -535,22 +536,22 @@ The Cypress GH Action does not spawn or create any additional containers - it on
535
536
 
536
537
  ### Component tests
537
538
 
538
- You can run the [Cypress component tests](https://on.cypress.io/component-testing) after running E2E tests by calling the action again with a custom command:
539
+ You can run [Cypress component tests](https://on.cypress.io/component-testing) in a job separate from E2E tests by adding `component: true`:
539
540
 
540
541
  ```yml
541
542
  - name: Run E2E tests 🧪
542
- uses: cypress-io/github-action@v2
543
+ uses: cypress-io/github-action@v4
543
544
 
544
545
  - name: Run Component tests 🧪
545
- uses: cypress-io/github-action@v2
546
+ uses: cypress-io/github-action@v4
546
547
  with:
547
548
  # we have already installed everything
548
549
  install: false
549
- # to run component tests we need to use "cypress run-ct"
550
- command: yarn cypress run-ct
550
+ # to run component tests we need to use "component: true"
551
+ component: true
551
552
  ```
552
553
 
553
- See the example project [cypress-react-component-example](https://github.com/bahmutov/cypress-react-component-example)
554
+ See the example project [component-test](/examples/v10/component-tests/) and the [example-component-test-workflow](.github/workflows/example-component-test.yml) for more details.
554
555
 
555
556
  ### Build app
556
557
 
@@ -566,7 +567,7 @@ jobs:
566
567
  - name: Checkout
567
568
  uses: actions/checkout@v2
568
569
  - name: Cypress run
569
- uses: cypress-io/github-action@v2
570
+ uses: cypress-io/github-action@v4
570
571
  with:
571
572
  build: npm run build
572
573
  ```
@@ -585,7 +586,7 @@ jobs:
585
586
  - name: Checkout
586
587
  uses: actions/checkout@v2
587
588
  - name: Cypress run
588
- uses: cypress-io/github-action@v2
589
+ uses: cypress-io/github-action@v4
589
590
  with:
590
591
  start: npm start
591
592
  ```
@@ -602,7 +603,7 @@ jobs:
602
603
  - name: Checkout
603
604
  uses: actions/checkout@v2
604
605
  - name: Cypress run
605
- uses: cypress-io/github-action@v2
606
+ uses: cypress-io/github-action@v4
606
607
  with:
607
608
  # Linux and MacOS
608
609
  start: npm start
@@ -628,7 +629,7 @@ jobs:
628
629
  - name: Checkout
629
630
  uses: actions/checkout@v2
630
631
  - name: Cypress run
631
- uses: cypress-io/github-action@v2
632
+ uses: cypress-io/github-action@v4
632
633
  with:
633
634
  start: npm run api, npm run web
634
635
  ```
@@ -658,7 +659,7 @@ jobs:
658
659
  - name: Checkout
659
660
  uses: actions/checkout@v2
660
661
  - name: Cypress run
661
- uses: cypress-io/github-action@v2
662
+ uses: cypress-io/github-action@v4
662
663
  with:
663
664
  start: npm start
664
665
  # quote the url to be safe against YML parsing surprises
@@ -670,7 +671,7 @@ jobs:
670
671
  By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout in seconds using `wait-on-timeout`.
671
672
 
672
673
  ```yml
673
- - uses: cypress-io/github-action@v2
674
+ - uses: cypress-io/github-action@v4
674
675
  with:
675
676
  start: npm start
676
677
  wait-on: 'http://localhost:8080/status'
@@ -683,7 +684,7 @@ See also [![Webpack Dev Server example](https://github.com/cypress-io/github-act
683
684
  You can wait for multiple URLs to respond by separating urls with a comma
684
685
 
685
686
  ```yml
686
- - uses: cypress-io/github-action@v2
687
+ - uses: cypress-io/github-action@v4
687
688
  with:
688
689
  # API runs on port 3050
689
690
  # Web server runs on port 8080
@@ -697,7 +698,7 @@ The action will wait for the first url to respond, then will check the second ur
697
698
  You can even use your own command (usually by using `npm`, `yarn`, `npx`) to wait for the server to respond. For example, if you want to use [wait-on](https://github.com/jeffbski/wait-on) utility to ping the server and run the Cypress tests after the server responds:
698
699
 
699
700
  ```yml
700
- - uses: cypress-io/github-action@v2
701
+ - uses: cypress-io/github-action@v4
701
702
  with:
702
703
  start: npm start
703
704
  wait-on: 'npx wait-on --timeout 5000 http://localhost:3000'
@@ -712,7 +713,7 @@ If this action times out waiting for the server to respond, please see [Debuggin
712
713
  If you want to overwrite the install command
713
714
 
714
715
  ```yml
715
- - uses: cypress-io/github-action@v2
716
+ - uses: cypress-io/github-action@v4
716
717
  with:
717
718
  install-command: yarn --frozen-lockfile --silent
718
719
  ```
@@ -733,7 +734,7 @@ jobs:
733
734
  - name: Checkout
734
735
  uses: actions/checkout@v2
735
736
  - name: Cypress run
736
- uses: cypress-io/github-action@v2
737
+ uses: cypress-io/github-action@v4
737
738
  with:
738
739
  start: npm start
739
740
  # quote the url to be safe against YML parsing surprises
@@ -755,7 +756,7 @@ steps:
755
756
  uses: actions/checkout@v2
756
757
 
757
758
  - name: Custom tests 🧪
758
- uses: cypress-io/github-action@v2
759
+ uses: cypress-io/github-action@v4
759
760
  with:
760
761
  command: npm run e2e:ci
761
762
  ```
@@ -778,7 +779,7 @@ jobs:
778
779
  containers: [1, 2, 3]
779
780
  steps:
780
781
  - uses: actions/checkout@v2
781
- - uses: cypress-io/github-action@v2
782
+ - uses: cypress-io/github-action@v4
782
783
  with:
783
784
  record: true
784
785
  parallel: true
@@ -813,7 +814,7 @@ jobs:
813
814
  needs: ['prepare']
814
815
  steps:
815
816
  - uses: actions/checkout@v2
816
- - uses: cypress-io/github-action@v2
817
+ - uses: cypress-io/github-action@v4
817
818
  with:
818
819
  record: true
819
820
  parallel: true
@@ -847,7 +848,7 @@ jobs:
847
848
  runs-on: ubuntu-20.04
848
849
  steps:
849
850
  - uses: actions/checkout@v2
850
- - uses: cypress-io/github-action@v2
851
+ - uses: cypress-io/github-action@v4
851
852
  with:
852
853
  start: npm start
853
854
  working-directory: e2e
@@ -891,7 +892,7 @@ jobs:
891
892
 
892
893
  # Cypress has its own package.json in folder "e2e"
893
894
  - name: Install Cypress and run tests
894
- uses: cypress-io/github-action@v2
895
+ uses: cypress-io/github-action@v4
895
896
  with:
896
897
  working-directory: e2e
897
898
  ```
@@ -913,7 +914,7 @@ jobs:
913
914
  runs-on: ubuntu-latest
914
915
  steps:
915
916
  - uses: actions/checkout@v2
916
- - uses: cypress-io/github-action@v2
917
+ - uses: cypress-io/github-action@v4
917
918
  with:
918
919
  working-directory: examples/start-and-yarn-workspaces/workspace-1
919
920
  build: yarn run build
@@ -948,7 +949,7 @@ jobs:
948
949
  # run Cypress tests and record them under the same run
949
950
  # associated with commit SHA and just give a different group name
950
951
  - name: Cypress run
951
- uses: cypress-io/github-action@v2
952
+ uses: cypress-io/github-action@v4
952
953
  with:
953
954
  record: true
954
955
  group: Tests on Node v${{ matrix.node }}
@@ -977,7 +978,7 @@ jobs:
977
978
  with:
978
979
  node-version: ${{ matrix.node }}
979
980
  - uses: actions/checkout@v2
980
- - uses: cypress-io/github-action@v2
981
+ - uses: cypress-io/github-action@v4
981
982
  ```
982
983
 
983
984
  [![Node versions example](https://github.com/cypress-io/github-action/workflows/example-node-versions/badge.svg?branch=master)](.github/workflows/example-node-versions.yml)
@@ -997,13 +998,13 @@ jobs:
997
998
  steps:
998
999
  - uses: actions/checkout@master
999
1000
  - name: Install dependencies
1000
- uses: cypress-io/github-action@v2
1001
+ uses: cypress-io/github-action@v4
1001
1002
  with:
1002
1003
  # just perform install
1003
1004
  runTests: false
1004
1005
  - run: yarn lint
1005
1006
  - name: Run e2e tests
1006
- uses: cypress-io/github-action@v2
1007
+ uses: cypress-io/github-action@v4
1007
1008
  with:
1008
1009
  # we have already installed all dependencies above
1009
1010
  install: false
@@ -1030,7 +1031,7 @@ If the project has many dependencies, but you want to install just Cypress you c
1030
1031
  node_modules
1031
1032
  key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
1032
1033
  - run: npm i cypress
1033
- - uses: cypress-io/github-action@v2
1034
+ - uses: cypress-io/github-action@v4
1034
1035
  with:
1035
1036
  install: false
1036
1037
  ```
@@ -1052,7 +1053,7 @@ jobs:
1052
1053
  timeout-minutes: 10
1053
1054
  steps:
1054
1055
  - uses: actions/checkout@v2
1055
- - uses: cypress-io/github-action@v2
1056
+ - uses: cypress-io/github-action@v4
1056
1057
  # you can specify individual step timeout too
1057
1058
  timeout-minutes: 5
1058
1059
  ```
@@ -1099,7 +1100,7 @@ You can set the environment variable using GitHub UI interface, or in the workfl
1099
1100
 
1100
1101
  ```yml
1101
1102
  - name: Cypress tests with debug logs
1102
- uses: cypress-io/github-action@v2
1103
+ uses: cypress-io/github-action@v4
1103
1104
  env:
1104
1105
  DEBUG: '@cypress/github-action'
1105
1106
  ```
@@ -1112,7 +1113,7 @@ The above `ACTIONS_STEP_DEBUG` setting enables the debug logs from the action it
1112
1113
 
1113
1114
  ```yml
1114
1115
  - name: Cypress tests with debug logs
1115
- uses: cypress-io/github-action@v2
1116
+ uses: cypress-io/github-action@v4
1116
1117
  env:
1117
1118
  DEBUG: 'cypress:*'
1118
1119
  ```
@@ -1161,7 +1162,7 @@ This GH Action sets an output `dashboardUrl` if the run was recorded on [Cypress
1161
1162
 
1162
1163
  ```yml
1163
1164
  - name: Cypress tests
1164
- uses: cypress-io/github-action@v2
1165
+ uses: cypress-io/github-action@v4
1165
1166
  # let's give this action an ID so we can refer
1166
1167
  # to its output values later
1167
1168
  id: cypress
@@ -1216,7 +1217,7 @@ jobs:
1216
1217
  - name: Checkout
1217
1218
  uses: actions/checkout@v2
1218
1219
  - name: Cypress run
1219
- uses: cypress-io/github-action@v2
1220
+ uses: cypress-io/github-action@v4
1220
1221
  with:
1221
1222
  build: npx cypress info
1222
1223
  ```
@@ -1233,14 +1234,14 @@ jobs:
1233
1234
  - name: Checkout
1234
1235
  uses: actions/checkout@v2
1235
1236
  - name: Cypress install
1236
- uses: cypress-io/github-action@v2
1237
+ uses: cypress-io/github-action@v4
1237
1238
  with:
1238
1239
  # just perform install
1239
1240
  runTests: false
1240
1241
  - name: Cypress info
1241
1242
  run: npx cypress info
1242
1243
  - name: Cypress run
1243
- uses: cypress-io/github-action@v2
1244
+ uses: cypress-io/github-action@v4
1244
1245
  with:
1245
1246
  # we have already installed all dependencies above
1246
1247
  install: false
@@ -1264,7 +1265,7 @@ jobs:
1264
1265
  - name: Checkout
1265
1266
  uses: actions/checkout@v2
1266
1267
  - name: Cypress nightly tests 🌃
1267
- uses: cypress-io/github-action@v2
1268
+ uses: cypress-io/github-action@v4
1268
1269
  ```
1269
1270
 
1270
1271
  See the [example-cron.yml](./.github/workflows/example-cron.yml) workflow.
package/action.yml CHANGED
@@ -11,9 +11,9 @@ inputs:
11
11
  description: 'Set configuration values. Separate multiple values with a comma. The values set here override any values set in your configuration file.'
12
12
  required: false
13
13
  config-file:
14
- description: 'Path to a JSON file where configuration values are set.'
14
+ description: 'Path to the cypress config file where configuration values are set.'
15
15
  required: false
16
- default: cypress.json
16
+ default: ''
17
17
  env:
18
18
  description: 'Sets Cypress environment variables'
19
19
  required: false
@@ -80,6 +80,10 @@ inputs:
80
80
  quiet:
81
81
  description: 'Whether or not to silence any Cypress specific output from stdout'
82
82
  required: false
83
+ component:
84
+ description: "Lets the action know that Cypress is running component tests and not e2e tests"
85
+ required: false
86
+ default: false
83
87
  outputs:
84
88
  dashboardUrl:
85
89
  description: 'Cypress Dashboard URL if the run was recorded'