@cypress/github-action 3.1.0 → 4.0.1

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