@cypress/github-action 2.11.4 → 2.11.8
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 +31 -3
- package/dist/index.js +20130 -23850
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -315,6 +315,32 @@ jobs:
|
|
|
315
315
|
|
|
316
316
|
**Tip 3:** if running on `pull_request` event, the commit message is "merge SHA into SHA", which is not what you want probably. You can overwrite the commit message sent to the Dashboard by setting an environment variable. See [issue 124](https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260) for details.
|
|
317
317
|
|
|
318
|
+
**Tip 4:** to record the project needs `projectId`. Typically this value is saved in the `cypress.json` file. If you want to avoid this, pass the project id using an environment variable:
|
|
319
|
+
|
|
320
|
+
```yml
|
|
321
|
+
name: Cypress tests
|
|
322
|
+
on: [push]
|
|
323
|
+
jobs:
|
|
324
|
+
cypress-run:
|
|
325
|
+
name: Cypress run
|
|
326
|
+
runs-on: ubuntu-20.04
|
|
327
|
+
steps:
|
|
328
|
+
- name: Checkout
|
|
329
|
+
uses: actions/checkout@v2
|
|
330
|
+
|
|
331
|
+
- name: Cypress run
|
|
332
|
+
uses: cypress-io/github-action@v2
|
|
333
|
+
with:
|
|
334
|
+
record: true
|
|
335
|
+
env:
|
|
336
|
+
# pass the Dashboard record key as an environment variable
|
|
337
|
+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
338
|
+
# pass GitHub token to allow accurately detecting a build vs a re-run build
|
|
339
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
340
|
+
# pass the project ID from the secrets through environment variable
|
|
341
|
+
CYPRESS_PROJECT_ID: ${{ secrets.PROJECT_ID }}
|
|
342
|
+
```
|
|
343
|
+
|
|
318
344
|
### Quiet flag
|
|
319
345
|
|
|
320
346
|
You can provide `quiet` flag for cypress run to silence any Cypress specific output from stdout
|
|
@@ -400,13 +426,13 @@ jobs:
|
|
|
400
426
|
# thus we store screenshots only on failures
|
|
401
427
|
# Alternative: create and commit an empty cypress/screenshots folder
|
|
402
428
|
# to always have something to upload
|
|
403
|
-
- uses: actions/upload-artifact@
|
|
429
|
+
- uses: actions/upload-artifact@v2
|
|
404
430
|
if: failure()
|
|
405
431
|
with:
|
|
406
432
|
name: cypress-screenshots
|
|
407
433
|
path: cypress/screenshots
|
|
408
434
|
# Test run video was always captured, so this action uses "always()" condition
|
|
409
|
-
- uses: actions/upload-artifact@
|
|
435
|
+
- uses: actions/upload-artifact@v2
|
|
410
436
|
if: always()
|
|
411
437
|
with:
|
|
412
438
|
name: cypress-videos
|
|
@@ -729,7 +755,7 @@ steps:
|
|
|
729
755
|
uses: actions/checkout@v2
|
|
730
756
|
|
|
731
757
|
- name: Custom tests 🧪
|
|
732
|
-
uses: cypress-io/github-action@
|
|
758
|
+
uses: cypress-io/github-action@v2
|
|
733
759
|
with:
|
|
734
760
|
command: npm run e2e:ci
|
|
735
761
|
```
|
|
@@ -1154,6 +1180,8 @@ This GH Action sets an output `dashboardUrl` if the run was recorded on [Cypress
|
|
|
1154
1180
|
|
|
1155
1181
|
[](.github/workflows/example-recording.yml)
|
|
1156
1182
|
|
|
1183
|
+
**Note:** every GH workflow step can have `outcome` and `conclusion` properties. See the documentation at [steps context](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#steps-context) page. In particular, the `output` value can be `success`, `failure`, `cancelled`, or `skipped` which you can use the next steps that follow.
|
|
1184
|
+
|
|
1157
1185
|
### Docker image
|
|
1158
1186
|
|
|
1159
1187
|
If your repository does not have `package.json` or `yarn.json` (maybe it contains a static site and does not need any dependencies), you can run Cypress tests using `cypress/included:...` [Cypress Docker images](https://github.com/cypress-io/cypress-docker-images/tree/master/included). In that case you don't even need this GH Action, instead use the Docker container and write `cypress run` command like this example from [cypress-gh-action-included](https://github.com/bahmutov/cypress-gh-action-included)
|