@cypress/github-action 5.0.9 → 5.1.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.
package/README.md CHANGED
@@ -8,16 +8,17 @@
8
8
  - [Explicit version](#explicit-version)
9
9
  - Run tests in a given [browser](#browser)
10
10
  - using [Firefox](#firefox)
11
- - using [Edge](#edge)
11
+ - using [Edge](#edge)
12
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)
16
16
  - Test [project in subfolder](#project)
17
17
  - [Record results](#record-test-results-on-cypress-cloud) on Cypress Cloud
18
+ - Specify [auto cancel](#specify-auto-cancel-after-failures) after failures
18
19
  - Tag [recordings](#tag-recordings)
19
- - [Quiet output](#quiet-flag)
20
20
  - Store [test artifacts](#artifacts) on GitHub
21
+ - [Quiet output](#quiet-flag)
21
22
  - Set Cypress [config values](#config)
22
23
  - Use specific [config file](#config-file)
23
24
  - Run tests in [parallel](#parallel)
@@ -404,6 +405,39 @@ The recording will have tags as labels on the run.
404
405
 
405
406
  You can pass multiple tags using commas like `tag: node-10,nightly,staging`.
406
407
 
408
+ ### Specify auto cancel after failures
409
+
410
+ Specify the number of failed tests that will cancel a run when using the [Cypress Cloud Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration#Auto-Cancellation) feature.
411
+
412
+ This feature requires Cypress 12.6.0 or later and a [Cypress Cloud Business or Enterprise](https://www.cypress.io/cloud/) account.
413
+
414
+ ```yml
415
+ name: Cypress E2E Tests
416
+ on: [push]
417
+ jobs:
418
+ cypress-run:
419
+ runs-on: ubuntu-22.04
420
+ name: E2E
421
+ steps:
422
+ - name: Setup Node
423
+ uses: actions/setup-node@v3
424
+
425
+ - name: Checkout
426
+ uses: actions/checkout@v3
427
+
428
+ - name: Cypress run
429
+ uses: cypress-io/github-action@v5
430
+ with:
431
+ record: true
432
+ # Cancel the run after 2 failed tests
433
+ auto-cancel-after-failures: 2
434
+ env:
435
+ CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
436
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
437
+ ```
438
+
439
+ See [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration#Auto-Cancellation) for more information.
440
+
407
441
  ### Artifacts
408
442
 
409
443
  If you don't record the test run on Cypress Cloud, you can still store generated videos and screenshots as CI artifacts. See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-example) and the workflow example below
package/action.yml CHANGED
@@ -7,6 +7,9 @@ inputs:
7
7
  description: 'Sends test results to Cypress Dashboard'
8
8
  required: false
9
9
  default: false
10
+ auto-cancel-after-failures:
11
+ description: 'Overrides the global Cloud configuration to set the failed test threshold for auto cancellation or to disable auto cancellation when recording to the Cloud (requires Cypress 12.x or later)'
12
+ required: false
10
13
  config:
11
14
  description: 'Set configuration values. Separate multiple values with a comma. The values set here override any values set in your configuration file.'
12
15
  required: false
package/dist/index.js CHANGED
@@ -79017,6 +79017,13 @@ const runTestsUsingCommandLine = async () => {
79017
79017
  cmd.push('--config-file')
79018
79018
  cmd.push(quoteArgument(configFileInput))
79019
79019
  }
79020
+ const autoCancelAfterFailures = core.getInput(
79021
+ 'auto-cancel-after-failures'
79022
+ )
79023
+ if (autoCancelAfterFailures) {
79024
+ cmd.push('--auto-cancel-after-failures')
79025
+ cmd.push(quoteArgument(autoCancelAfterFailures))
79026
+ }
79020
79027
 
79021
79028
  if (parallel || group) {
79022
79029
  let buildIdVar = null
@@ -79145,6 +79152,12 @@ const runTests = async () => {
79145
79152
  cypressOptions.browser = core.getInput('browser')
79146
79153
  }
79147
79154
 
79155
+ if (core.getInput('auto-cancel-after-failures')) {
79156
+ cypressOptions.autoCancelAfterFailures = core.getInput(
79157
+ 'auto-cancel-after-failures'
79158
+ )
79159
+ }
79160
+
79148
79161
  if (core.getInput('env')) {
79149
79162
  cypressOptions.env = core.getInput('env')
79150
79163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "5.0.9",
3
+ "version": "5.1.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",