@@ -49,19 +49,14 @@ running Cypress tests. This action provides npm, pnpm or yarn installation,
49
49
custom caching, additional configuration options and simplifies setup of
50
50
advanced workflows with Cypress in the GitHub Actions platform.
51
51
52
- ### Explicit Version Number
52
+ ### Version Number Selection
53
53
54
54
:::info
55
55
56
56
<strong >GitHub Action Version Number</strong >
57
57
58
- We recommend using the explicit version number of the Cypress GitHub Action to
59
- prevent accidentally running tests with a new version of the action that may
60
- have breaking changes.
61
-
62
- Read the
63
- [ GitHub Action documentation] ( https://github.com/cypress-io/github-action#explicit-version )
64
- for more information
58
+ We recommend binding to the action's latest major version by specifying ` v5 `
59
+ when using the action.
65
60
66
61
:::
67
62
@@ -71,22 +66,29 @@ For Example:
71
66
jobs :
72
67
cypress-run :
73
68
steps :
74
- uses : cypress-io/github-action@v5.1.0
69
+ uses : cypress-io/github-action@v5
75
70
` ` `
76
71
72
+ Alternatively, as a mitigation strategy for unforeseen breaks, bind to a
73
+ specific
74
+ [release version tag](https://github.com/cypress-io/github-action/releases), for
75
+ example ` cypress-io/[email protected] `. Read the
76
+ [Cypress GitHub Action documentation](https://github.com/cypress-io/github-action#action-version)
77
+ for more information.
78
+
77
79
# # Basic Setup
78
80
79
81
<DocsVideo src="https://youtube.com/embed/vVr7DXDdUks" />
80
82
81
- The example below is basic CI setup and job using the
83
+ The example below is a basic CI setup and job using the
82
84
[Cypress GitHub Action](https://github.com/marketplace/actions/cypress-io) to
83
85
run Cypress tests within the Electron browser. This GitHub Action configuration
84
86
is placed within `.github/workflows/main.yml`.
85
87
86
88
` ` ` yaml
87
89
name: Cypress Tests
88
90
89
- on: [ push]
91
+ on: push
90
92
91
93
jobs:
92
94
cypress-run:
97
99
# Install NPM dependencies, cache them correctly
98
100
# and run all Cypress tests
99
101
- name: Cypress run
100
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
102
+ uses: cypress-io/github-action@v5
101
103
with:
102
104
build: npm run build
103
105
start: npm start
@@ -116,11 +118,11 @@ example project and place the above GitHub Action configuration in
116
118
117
119
**How this action works:**
118
120
119
- - On _push_ to this repository, this job will provision and start GitHub-hosted
120
- Ubuntu Linux instance for running the outlined `steps` for the declared
121
- ` cypress-run` job within the `jobs` section of the configuration.
121
+ - On _push_ to this repository, this job will provision and start a
122
+ GitHub-hosted Ubuntu Linux instance to run the outlined `steps` for the
123
+ declared `cypress-run` job within the `jobs` section of the configuration.
122
124
- The [GitHub checkout Action](https://github.com/marketplace/actions/checkout)
123
- is used to checkout our code from our GitHub repository.
125
+ is used to check out our code from our GitHub repository.
124
126
- Finally, our Cypress GitHub Action will :
125
127
- Install npm dependencies
126
128
- Build the project (`npm run build`)
@@ -143,7 +145,7 @@ tests in Firefox by passing the `browser: firefox` attribute to the
143
145
` ` ` yaml
144
146
name: Cypress Tests using Cypress Docker Image
145
147
146
- on: [ push]
148
+ on: push
147
149
148
150
jobs:
149
151
cypress-run:
@@ -156,9 +158,9 @@ jobs:
156
158
# Install NPM dependencies, cache them correctly
157
159
# and run all Cypress tests
158
160
- name: Cypress run
159
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
161
+ uses: cypress-io/github-action@v5
160
162
with:
161
- # Specify Browser since container image is compile with Firefox
163
+ # Specify Browser since container image is compiled with Firefox
162
164
browser: firefox
163
165
` ` `
164
166
@@ -185,7 +187,7 @@ action and will save the state of the `build` directory for the worker jobs.
185
187
` ` ` yaml
186
188
name: Cypress Tests with installation job
187
189
188
- on: [ push]
190
+ on: push
189
191
190
192
jobs:
191
193
install:
@@ -203,7 +205,7 @@ jobs:
203
205
path: build
204
206
205
207
- name: Cypress install
206
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
208
+ uses: cypress-io/github-action@v5
207
209
with:
208
210
# Disable running of tests within install job
209
211
runTests: false
@@ -218,7 +220,7 @@ below in a worker job.
218
220
` ` ` yaml
219
221
name: Cypress Tests with Dependency and Artifact Caching
220
222
221
- on: [ push]
223
+ on: push
222
224
223
225
jobs:
224
226
# install:
@@ -239,9 +241,9 @@ jobs:
239
241
# Install NPM dependencies, cache them correctly
240
242
# and run all Cypress tests
241
243
- name: Cypress run
242
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
244
+ uses: cypress-io/github-action@v5
243
245
with:
244
- # Specify Browser since container image is compile with Firefox
246
+ # Specify Browser since container image is compiled with Firefox
245
247
browser: firefox
246
248
build: yarn build
247
249
` ` `
@@ -288,7 +290,7 @@ action will save the state of the `build` directory for the worker jobs.
288
290
` ` ` yaml
289
291
name: Cypress Tests with installation job
290
292
291
- on: [ push]
293
+ on: push
292
294
293
295
jobs:
294
296
install:
@@ -299,7 +301,7 @@ jobs:
299
301
uses: actions/checkout@v3
300
302
301
303
- name: Cypress install
302
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
304
+ uses: cypress-io/github-action@v5
303
305
with:
304
306
# Disable running of tests within install job
305
307
runTests: false
@@ -336,7 +338,7 @@ action will retrieve the `build` directory saved in the install job.
336
338
` ` ` yaml
337
339
name: Cypress Tests with Install Job and UI Chrome Job x 5
338
340
339
- on: [ push]
341
+ on: push
340
342
341
343
jobs:
342
344
install:
@@ -362,7 +364,7 @@ jobs:
362
364
path: build
363
365
364
366
- name: 'UI Tests - Chrome'
365
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
367
+ uses: cypress-io/github-action@v5
366
368
with:
367
369
# we have already installed all dependencies above
368
370
install: false
@@ -486,7 +488,7 @@ identification of each build to avoid confusion when re-running a build.
486
488
487
489
```
488
490
name: Cypress tests
489
- on: [ push]
491
+ on: push
490
492
jobs:
491
493
cypress-run:
492
494
name: Cypress run
@@ -496,7 +498,7 @@ jobs:
496
498
uses: actions/checkout@v3
497
499
498
500
- name: Cypress run
499
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
501
+ uses: cypress-io/github-action@v5
500
502
with:
501
503
record: true
502
504
env:
@@ -513,7 +515,7 @@ details.
513
515
514
516
```
515
517
name: Cypress tests
516
- on: [ push]
518
+ on: push
517
519
jobs:
518
520
cypress-run:
519
521
name: Cypress run
@@ -523,7 +525,7 @@ jobs:
523
525
uses: actions/checkout@v3
524
526
525
527
- name: Cypress run
526
- uses: cypress-io/github-action@v5.x.x # use the explicit version number
528
+ uses: cypress-io/github-action@v5
527
529
with:
528
530
record: true
529
531
env:
0 commit comments