@cypress/github-action 6.9.0 โ†’ 6.9.2

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 (3) hide show
  1. package/README.md +74 -21
  2. package/dist/index.js +31 -31
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cypress-io/github-action [![Action status][ci-badge]][ci-workflow] [![cypress][cloud-badge]][cloud-project] [![renovate-app badge][renovate-badge]][renovate-bot]
2
2
 
3
- > [Cypress](https://www.cypress.io) based `cypress-io/github-action` runs [End-to-End](#end-to-end-testing) or [Component](#component-testing) tests in [GitHub Actions](https://docs.github.com/en/actions/) Continuous Integration (CI) workflows, optionally [recording](#record-test-results-on-cypress-cloud) to [Cypress Cloud](https://on.cypress.io/guides/cloud/introduction)
3
+ > [Cypress](https://www.cypress.io) based `cypress-io/github-action` runs [End-to-End](#end-to-end-testing) or [Component](#component-testing) tests in [GitHub Actions](https://docs.github.com/en/actions/) Continuous Integration (CI) workflows, optionally [recording](#record-test-results-on-cypress-cloud) to [Cypress Cloud](https://on.cypress.io/cloud-introduction)
4
4
 
5
5
  ## Introduction
6
6
 
@@ -15,7 +15,7 @@ In addition to running Cypress tests, the action includes [dependency installati
15
15
  | [Caching](#caching) of Cypress binary and dependencies for [npm](https://docs.npmjs.com/cli/commands/npm-cache) and [Yarn Classic](https://classic.yarnpkg.com/lang/en/docs/cli/cache/) installations | Reduced download bandwidth requirements |
16
16
  | [Job summary](#job-summary-title) | Fast access to results overview |
17
17
  | [Docker](#docker-image) compatibility | Improved independence from [GitHub-hosted runner image](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) version changes. Fixed Docker environments can be used. |
18
- | [Recording](#record-test-results-on-cypress-cloud) to Cypress Cloud compatibility including [parallel](#parallel) execution | Improved interpretation of test results through [Cypress Cloud](https://on.cypress.io/cloud) |
18
+ | [Recording](#record-test-results-on-cypress-cloud) to Cypress Cloud compatibility including [parallel](#parallel) execution | Improved interpretation of test results through [Cypress Cloud](https://on.cypress.io/cloud-introduction) |
19
19
  | [Live examples](#examples) | Speeds up introduction and troubleshooting |
20
20
  | [Yarn Modern](#yarn-modern) usage and cache examples | Extends usage beyond [Yarn Classic](https://classic.yarnpkg.com/) |
21
21
  | [pnpm cache examples](#pnpm) | Reduced download bandwidth requirements for [pnpm](https://pnpm.io/) |
@@ -56,7 +56,7 @@ The following examples demonstrate the actions' functions.
56
56
  - [Wait for server](#wait-on) to respond before running the tests
57
57
  - Use [custom install command](#custom-install-command)
58
58
  - Use [command prefix](#command-prefix)
59
- - Use [own custom test command](#custom-test-command)
59
+ - Use [custom test command](#custom-test-command)
60
60
  - Pass [custom build id](#custom-build-id) when recording to Cypress Cloud
61
61
  - Generate a [robust custom build id](#robust-custom-build-id) to allow re-running the workflow
62
62
  - Use different [working-directory](#working-directory)
@@ -70,6 +70,7 @@ The following examples demonstrate the actions' functions.
70
70
  - Use [custom cache key](#custom-cache-key)
71
71
  - Run tests on multiple [Node versions](#node-versions)
72
72
  - Split [install and tests](#split-install-and-tests) into separate jobs
73
+ - Split [install and tests](#split-install-and-test-with-artifacts) with artifacts
73
74
  - Use [custom install commands](#custom-install)
74
75
  - Install [only Cypress](#install-cypress-only) to avoid installing all dependencies
75
76
  - Use [timeouts](#timeouts) to avoid hanging CI jobs
@@ -381,7 +382,7 @@ For more information, visit [the Cypress command-line docs](https://on.cypress.i
381
382
 
382
383
  ### Record test results on Cypress Cloud
383
384
 
384
- By setting the parameter `record` to `true`, you can record your test results into [Cypress Cloud](https://on.cypress.io/cloud). Read the [Cypress Cloud setup](https://on.cypress.io/cloud/get-started/setup) documentation to learn how to sign up to Cypress Cloud, to create and set up a [Cloud project](https://on.cypress.io/cloud/account-management/projects) to get the required `projectId` and record key for recording.
385
+ By setting the parameter `record` to `true`, you can record your test results into [Cypress Cloud](https://on.cypress.io/cloud-introduction). Read the [Cypress Cloud setup](https://on.cypress.io/cloud/get-started/setup) documentation to learn how to sign up to Cypress Cloud, to create and set up a [Cloud project](https://on.cypress.io/cloud/account-management/projects) to get the required `projectId` and record key for recording.
385
386
 
386
387
  - The `projectId` can either be stored in the [Cypress Configuration File](https://on.cypress.io/app/references/configuration#Configuration-File) or passed to the action as an environment variable `CYPRESS_PROJECT_ID`. In the example below, it is retrieved from a [GitHub secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) variable.
387
388
 
@@ -528,7 +529,7 @@ jobs:
528
529
  # let's make sure our "app" works on several versions of Node
529
530
  strategy:
530
531
  matrix:
531
- node: [20, 22, 23]
532
+ node: [20, 22, 23, 24]
532
533
  name: E2E on Node v${{ matrix.node }}
533
534
  steps:
534
535
  - name: Setup Node
@@ -965,22 +966,28 @@ If `command-prefix` is used, then no [job summary](#job-summary-title) is produc
965
966
 
966
967
  ### Custom test command
967
968
 
968
- You can overwrite the Cypress run command with your own command.
969
+ The `command` parameter executes a CLI command using the GitHub [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) action.
970
+
971
+ This parameter is useful for special test cases, for example:
972
+
973
+ - in the project [examples/custom-command](./examples/custom-command/), a JavaScript [examples/custom-command/index.js](./examples/custom-command/index.js) is run with `node .` through `command: npm run custom-test`
974
+ - in the workflow [example-yarn-modern-pnp.yml](.github/workflows/example-yarn-modern-pnp.yml) Yarn Modern with Plug'n'Play is run with `command: yarn run --binaries-only cypress run` since [Yarn Plug'n'Play](#yarn-plugnplay) is not natively supported by the action.
975
+
976
+ If you don't have a special case and you just need to convert a `cypress run` CLI command to use the Cypress GitHub Action, refer to the section [Migrating from CLI command](#migrating-from-cli-command) which explains how to map CLI options to equivalent action parameters, avoiding the need for the `command` parameter in most cases.
977
+
978
+ There are some parameters that cannot be used together with the `command` parameter, and these are ignored. The parameters include action input parameters listed in the table [CLI Run Option / Action Parameter](#cli-run-option--action-parameter), the [publish-summary](#suppress-job-summary), [summary-title](#job-summary-title) and [command-prefix](#command-prefix). If any such parameters are passed to the action, a warning message appears in the logs that the parameters have been ignored.
979
+
980
+ Correct example snippet:
969
981
 
970
982
  ```yml
971
983
  steps:
972
- - name: Checkout ๐Ÿ›Ž
973
- uses: actions/checkout@v4
974
-
975
- - name: Custom tests ๐Ÿงช
976
- uses: cypress-io/github-action@v6
984
+ - uses: actions/checkout@v4
985
+ - uses: cypress-io/github-action@v6
977
986
  with:
978
- command: npm run e2e:ci
987
+ command: npm run custom-test
979
988
  ```
980
989
 
981
- **Caution**: using the action parameter `command` causes multiple other parameters to be ignored including: `auto-cancel-after-failures`, `browser`, `ci-build-id`, `command-prefix`, `component`, `config`, `config-file`, `env`, `group`, `headed`, `parallel`, `project`, `publish-summary`, `quiet`, `record`, `spec` and `tag`.
982
-
983
- See [example-custom-command.yml](.github/workflows/example-custom-command.yml) file.
990
+ [![command example](https://github.com/cypress-io/github-action/actions/workflows/example-custom-command.yml/badge.svg)](.github/workflows/example-custom-command.yml)
984
991
 
985
992
  ### Custom build id
986
993
 
@@ -1303,7 +1310,7 @@ jobs:
1303
1310
  # let's make sure our "app" works on several versions of Node
1304
1311
  strategy:
1305
1312
  matrix:
1306
- node: [20, 22, 23]
1313
+ node: [20, 22, 23, 24]
1307
1314
  name: E2E on Node v${{ matrix.node }}
1308
1315
  steps:
1309
1316
  - name: Setup Node
@@ -1337,7 +1344,7 @@ jobs:
1337
1344
  runs-on: ubuntu-24.04
1338
1345
  strategy:
1339
1346
  matrix:
1340
- node: [20, 22, 23]
1347
+ node: [20, 22, 23, 24]
1341
1348
  name: E2E on Node v${{ matrix.node }}
1342
1349
  steps:
1343
1350
  - uses: actions/setup-node@v4
@@ -1380,6 +1387,54 @@ jobs:
1380
1387
 
1381
1388
  See [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) for a working example.
1382
1389
 
1390
+ ### Split install and test with artifacts
1391
+
1392
+ If your test job(s) first need a build step, you can split the jobs into a separate build job followed by test jobs. You pass the build results to any subsequent jobs using [GitHub Actions artifacts](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow).
1393
+
1394
+ In the build job, use [upload-artifact](https://github.com/actions/upload-artifact) to store the build results, then in subsequent jobs use [download-artifact](https://github.com/actions/download-artifact) to restore them.
1395
+
1396
+ Your tests jobs may use a [GitHub Actions matrix strategy](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow), such as when recording to [Cypress Cloud](https://on.cypress.io/cloud-introduction) with [parallel jobs](#parallel).
1397
+
1398
+ ```yml
1399
+ name: Split build and test
1400
+ on: push
1401
+ jobs:
1402
+ build:
1403
+ runs-on: ubuntu-24.04
1404
+ steps:
1405
+ - uses: actions/checkout@v4
1406
+ - name: Build app
1407
+ uses: cypress-io/github-action@v6
1408
+ with:
1409
+ runTests: false # only build app, don't test yet
1410
+ build: npm run build
1411
+ - name: Store build artifacts
1412
+ uses: actions/upload-artifact@v4
1413
+ with:
1414
+ name: app
1415
+ path: build
1416
+ if-no-files-found: error
1417
+ retention-days: 1
1418
+
1419
+ test:
1420
+ needs: build
1421
+ runs-on: ubuntu-24.04
1422
+ steps:
1423
+ - uses: actions/checkout@v4
1424
+ - name: Restore build artifacts
1425
+ uses: actions/download-artifact@v4
1426
+ with:
1427
+ name: app
1428
+ path: build
1429
+
1430
+ - name: Cypress tests
1431
+ uses: cypress-io/github-action@v6
1432
+ with:
1433
+ start: npm start # start server using the build artifacts
1434
+ ```
1435
+
1436
+ [![Split with build artifacts](https://github.com/cypress-io/github-action/actions/workflows/example-build-artifacts.yml/badge.svg)](.github/workflows/example-build-artifacts.yml)
1437
+
1383
1438
  ### Custom install
1384
1439
 
1385
1440
  Finally, you might not need this GH Action at all. For example, if you want to split the npm dependencies installation from the Cypress binary installation, then it makes no sense to use this action. Instead you can install and cache Cypress yourself.
@@ -1429,8 +1484,6 @@ jobs:
1429
1484
  | [cypress-io/cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) | Runs every API command in Cypress using various CI platforms including GitHub Actions |
1430
1485
  | [cypress-io/cypress-realworld-app](https://github.com/cypress-io/cypress-realworld-app) | A real-world example payment application. Uses GitHub Actions and CircleCI. |
1431
1486
  | [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) | Splits install and running tests commands, runs Cypress from sub-folder |
1432
- | [cypress-examples](https://github.com/bahmutov/cypress-examples) | Shows separate install job from parallel test jobs |
1433
- | [cypress-gh-action-split-jobs](https://github.com/bahmutov/cypress-gh-action-split-jobs) | Shows a separate install job with the build step, and another job that runs the tests |
1434
1487
 
1435
1488
  ## Migration
1436
1489
 
@@ -1608,7 +1661,7 @@ If you configure a `workflow_dispatch` event in your own workflows, you will be
1608
1661
 
1609
1662
  ### Outputs
1610
1663
 
1611
- This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command) option or the [command-prefix](#command-prefix) option are used then no `resultsUrl` step output is saved.
1664
+ This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command) parameter or the [command-prefix](#command-prefix) parameter are used then no `resultsUrl` step output is saved.
1612
1665
 
1613
1666
  This is an example of using the step output `resultsUrl`:
1614
1667
 
@@ -1759,7 +1812,7 @@ jobs:
1759
1812
 
1760
1813
  Node.js is required to run this action. The recommended version `v6` supports:
1761
1814
 
1762
- - **Node.js** 20.x, 22.x and 23.x
1815
+ - **Node.js** 20.x, 22.x, 23.x and 24.x
1763
1816
 
1764
1817
  and is generally aligned with [Node.js's release schedule](https://github.com/nodejs/Release).
1765
1818
 
package/dist/index.js CHANGED
@@ -63543,7 +63543,7 @@ module.exports = {
63543
63543
 
63544
63544
 
63545
63545
  const { parseSetCookie } = __nccwpck_require__(4408)
63546
- const { stringify, getHeadersList } = __nccwpck_require__(3121)
63546
+ const { stringify } = __nccwpck_require__(3121)
63547
63547
  const { webidl } = __nccwpck_require__(1744)
63548
63548
  const { Headers } = __nccwpck_require__(554)
63549
63549
 
@@ -63619,14 +63619,13 @@ function getSetCookies (headers) {
63619
63619
 
63620
63620
  webidl.brandCheck(headers, Headers, { strict: false })
63621
63621
 
63622
- const cookies = getHeadersList(headers).cookies
63622
+ const cookies = headers.getSetCookie()
63623
63623
 
63624
63624
  if (!cookies) {
63625
63625
  return []
63626
63626
  }
63627
63627
 
63628
- // In older versions of undici, cookies is a list of name:value.
63629
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
63628
+ return cookies.map((pair) => parseSetCookie(pair))
63630
63629
  }
63631
63630
 
63632
63631
  /**
@@ -64054,14 +64053,15 @@ module.exports = {
64054
64053
  /***/ }),
64055
64054
 
64056
64055
  /***/ 3121:
64057
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
64056
+ /***/ ((module) => {
64058
64057
 
64059
64058
  "use strict";
64060
64059
 
64061
64060
 
64062
- const assert = __nccwpck_require__(9491)
64063
- const { kHeadersList } = __nccwpck_require__(2785)
64064
-
64061
+ /**
64062
+ * @param {string} value
64063
+ * @returns {boolean}
64064
+ */
64065
64065
  function isCTLExcludingHtab (value) {
64066
64066
  if (value.length === 0) {
64067
64067
  return false
@@ -64322,31 +64322,13 @@ function stringify (cookie) {
64322
64322
  return out.join('; ')
64323
64323
  }
64324
64324
 
64325
- let kHeadersListNode
64326
-
64327
- function getHeadersList (headers) {
64328
- if (headers[kHeadersList]) {
64329
- return headers[kHeadersList]
64330
- }
64331
-
64332
- if (!kHeadersListNode) {
64333
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
64334
- (symbol) => symbol.description === 'headers list'
64335
- )
64336
-
64337
- assert(kHeadersListNode, 'Headers cannot be parsed')
64338
- }
64339
-
64340
- const headersList = headers[kHeadersListNode]
64341
- assert(headersList)
64342
-
64343
- return headersList
64344
- }
64345
-
64346
64325
  module.exports = {
64347
64326
  isCTLExcludingHtab,
64348
- stringify,
64349
- getHeadersList
64327
+ validateCookieName,
64328
+ validateCookiePath,
64329
+ validateCookieValue,
64330
+ toIMFDate,
64331
+ stringify
64350
64332
  }
64351
64333
 
64352
64334
 
@@ -68350,6 +68332,7 @@ const {
68350
68332
  isValidHeaderName,
68351
68333
  isValidHeaderValue
68352
68334
  } = __nccwpck_require__(2538)
68335
+ const util = __nccwpck_require__(3837)
68353
68336
  const { webidl } = __nccwpck_require__(1744)
68354
68337
  const assert = __nccwpck_require__(9491)
68355
68338
 
@@ -68903,6 +68886,9 @@ Object.defineProperties(Headers.prototype, {
68903
68886
  [Symbol.toStringTag]: {
68904
68887
  value: 'Headers',
68905
68888
  configurable: true
68889
+ },
68890
+ [util.inspect.custom]: {
68891
+ enumerable: false
68906
68892
  }
68907
68893
  })
68908
68894
 
@@ -78079,6 +78065,20 @@ class Pool extends PoolBase {
78079
78065
  ? { ...options.interceptors }
78080
78066
  : undefined
78081
78067
  this[kFactory] = factory
78068
+
78069
+ this.on('connectionError', (origin, targets, error) => {
78070
+ // If a connection error occurs, we remove the client from the pool,
78071
+ // and emit a connectionError event. They will not be re-used.
78072
+ // Fixes https://github.com/nodejs/undici/issues/3895
78073
+ for (const target of targets) {
78074
+ // Do not use kRemoveClient here, as it will close the client,
78075
+ // but the client cannot be closed in this state.
78076
+ const idx = this[kClients].indexOf(target)
78077
+ if (idx !== -1) {
78078
+ this[kClients].splice(idx, 1)
78079
+ }
78080
+ }
78081
+ })
78082
78082
  }
78083
78083
 
78084
78084
  [kGetDispatcher] () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "6.9.0",
3
+ "version": "6.9.2",
4
4
  "description": "GitHub Action for running Cypress end-to-end and component tests",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -52,12 +52,12 @@
52
52
  "supports-color": "9.3.1"
53
53
  },
54
54
  "devDependencies": {
55
- "@eslint/js": "9.21.0",
55
+ "@eslint/js": "9.26.0",
56
56
  "@stylistic/eslint-plugin": "4.2.0",
57
57
  "@types/node": "22.13.10",
58
58
  "@vercel/ncc": "0.38.1",
59
- "eslint": "9.21.0",
60
- "eslint-plugin-cypress": "4.2.1",
59
+ "eslint": "9.26.0",
60
+ "eslint-plugin-cypress": "4.3.0",
61
61
  "globals": "16.0.0",
62
62
  "husky": "9.1.7",
63
63
  "markdown-link-check": "3.13.7",