Skip to content

Commit 9b11881

Browse files
Merge branch 'master' into allow-enterprise-users-automatic-build-configuration
2 parents 5deb1f0 + ba3a41c commit 9b11881

File tree

89 files changed

+2437
-1244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2437
-1244
lines changed

.github/workflows/check-markdown.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
check-markdown-links:
10+
check-markdown:
1111
runs-on: ubuntu-24.04
12-
name: Check links in Markdown files
12+
name: Check Markdown files
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16-
- run: npm ci
17-
- run: npm run check:markdown
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Check Markdown links
19+
run: npm run check:markdown-links
20+
- name: Check Markdown formatting
21+
run: npm run format:markdown:check

.github/workflows/example-install-only.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
3131

3232
- name: Install Cypress 📥
33-
run: npm install cypress@14.0.3 --save-dev
33+
run: npm install cypress@14.1.0 --save-dev
3434

3535
- name: Cypress tests 🧪
3636
uses: ./

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- run: npm ci
2323
- run: npm run format
2424
- run: npm run build
25-
- run: npm test
25+
- run: npm run lint
2626

2727
release:
2828
runs-on: ubuntu-24.04

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
55
echo
66
echo changes to action source code were detected
77
echo action source code changes are added to this commit
8-
git add index.js src/ping.js dist
8+
git add index.js src/ping.js dist action.yml
99
fi

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/LICENSE.md

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ See [Releases](https://github.com/cypress-io/github-action/releases) for full de
3030
| v4.0.0 | Support for Cypress 10 and later versions added. |
3131
| v3 | Action runs under Node.js 16 instead of Node.js 12. |
3232
| v2 | Cypress runs using the [Module API](https://docs.cypress.io/guides/guides/module-api) instead of being started via the command line. |
33-
| v1 | *This version is no longer runnable in GitHub due to security changes.* |
33+
| v1 | _This version is no longer runnable in GitHub due to security changes._ |

CONTRIBUTING.md

+22-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Thanks for taking the time to contribute! :smile:
44

5-
*To contribute to the main Cypress product, please read the related [CONTRIBUTING](https://github.com/cypress-io/cypress/blob/develop/CONTRIBUTING.md) document, which also contains useful general tips.*
5+
_To contribute to the main Cypress product, please read the related [CONTRIBUTING](https://github.com/cypress-io/cypress/blob/develop/CONTRIBUTING.md) document, which also contains useful general tips._
66

77
To contribute to the [cypress-io/github-action](https://github.com/cypress-io/github-action) repository, please continue reading here.
88

@@ -17,7 +17,6 @@ This document describes topics useful to contributors to this repository. The re
1717
1. GitHub's Marketplace as [cypress-io/github-action](https://github.com/marketplace/actions/cypress-io#cypress-iogithub-action--)
1818
2. npm's JavaScript Package Registry as [@cypress/github-action](https://www.npmjs.com/package/@cypress/github-action)
1919

20-
2120
You can read the GitHub document [Creating a JavaScript action](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action) for background information on how JavaScript actions for GitHub are created and how they work.
2221

2322
### Requirements
@@ -31,6 +30,7 @@ You must have the following installed on your system to contribute locally:
3130
If you are submitting a Pull Request (PR) to provide a fix or feature for the action, the following is relevant to you:
3231

3332
The main source code elements for the action are:
33+
3434
- [action.yml](action.yml)
3535
- [index.js](index.js)
3636
- [src/ping.js](src/ping.js)
@@ -45,11 +45,17 @@ To contribute changes, follow these instructions in the order given below:
4545
1. Make the necessary source code changes, including additions or changes to the [README.md](./README.md) documentation if parameters are added or affected.
4646
1. Execute the following in the root directory of the cloned repository
4747

48-
```bash
49-
npm install
50-
npm run format
51-
npm run build
52-
```
48+
```bash
49+
npm install
50+
npm run format
51+
npm run build
52+
```
53+
54+
1. If you have modified any Markdown documents (`*.md`) then execute
55+
56+
```bash
57+
npm run format:markdown
58+
```
5359

5460
1. Commit the change. (If you are working on Microsoft Windows, see [Windows users](#windows-users) below.)
5561
1. Push to the repository.
@@ -97,18 +103,18 @@ This information is for Cypress.io Members or Collaborators who merge pull reque
97103
1. When merging a pull request, use the [Squash and merge](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github#squashing-your-merge-commits) option to squash all commits into one.
98104
1. Make sure the commit subject and body follow [semantic commit convention](https://semantic-release.gitbook.io/semantic-release/#commit-message-format), for instance:
99105

100-
```text
101-
feat: added new parameter
102-
fix: fixed a bug
103-
```
106+
```text
107+
feat: added new parameter
108+
fix: fixed a bug
109+
```
104110

105-
If you need to bump the major version, mark it as breaking change in the body of the commit's message like:
111+
If you need to bump the major version, mark it as breaking change in the body of the commit's message like:
106112

107-
```text
108-
fix: upgrade dependency X
113+
```text
114+
fix: upgrade dependency X
109115
110-
BREAKING CHANGE: requires minimum Node.js 18 to run
111-
```
116+
BREAKING CHANGE: requires minimum Node.js 18 to run
117+
```
112118

113119
1. New versions of this action will be released automatically by the CI when merged to the `master` branch, see [.github/workflows/main.yml](.github/workflows/main.yml). This will create a new [GitHub release](https://github.com/cypress-io/github-action/releases) and will update the current highest branch from the series `v5`, `v6`, ... etc. Thus specifying `uses: cypress-io/github-action@v6` (or higher version if available) selects the new version automatically. This **will not** push the latest release to GitHub Marketplace.
114120
1. The action's CI is configured to use the [default Angular release rules](https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js). This means that only `feat:`, `fix:` and `perf:` trigger a new release which is then logged to the [releases](https://github.com/cypress-io/github-action/releases) page. Other Angular commit types listed on [Contributing to Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format) can be used for documentation purposes, however they are ignored by the currently configured release process.

README.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# cypress-io/github-action [![Action status][ci-badge]][ci-workflow] [![cypress][cloud-badge]][cloud-project] [![renovate-app badge][renovate-badge]][renovate-bot]
22

3-
> [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm, pnpm and Yarn installation, custom caching and lots of configuration options.
3+
> [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm, pnpm and Yarn installation, custom caching and lots of configuration options.
44
5-
Placing `use: cypress-io/github-action@v6` into a GitHub Action workflow gives you a simple way to run Cypress. The action takes the project's npm, pnpm or Yarn package manager lock file, installs dependencies and caches these dependencies for future use. It then proceeds to run Cypress end-to-end tests with the built-in Electron browser and provides a test summary after completion.
5+
Placing `use: cypress-io/github-action@v6` into a GitHub Action workflow gives you a simple way to run Cypress. The action takes the project's npm, pnpm or Yarn package manager lock file, installs dependencies and caches these dependencies for future use. It then proceeds to run Cypress end-to-end tests with the built-in Electron browser and provides a test summary after completion.
66

7-
If you are testing against a running server like the [Cypress Kitchen Sink showcase example](https://example.cypress.io/) on https://example.cypress.io/ no other parameters are necessary. In other cases where you need to fire up a development server, you can add the [start](#start-server) parameter to the workflow. Browse through the examples to find other useful parameters.
7+
If you are testing against a running server like the [Cypress Kitchen Sink showcase example](https://example.cypress.io/) on https://example.cypress.io/ no other parameters are necessary. In other cases where you need to fire up a development server, you can add the [start](#start-server) parameter to the workflow. Browse through the examples to find other useful parameters.
88

99
## Examples
1010

@@ -452,9 +452,11 @@ Please refer to the [default GitHub environment variables](https://docs.github.c
452452
When recording runs to Cypress Cloud, the PR number and URL can be automatically detected if you pass `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`
453453
via the workflow `env`. When set, this value enables the Action to perform additional logic that grabs the related PR number and URL (if they
454454
exist) and sets them in the environment variables `CYPRESS_PULL_REQUEST_ID` and `CYPRESS_PULL_REQUEST_URL`, respectively.
455-
* See Cypress' documentation on [CI Build Information](https://on.cypress.io/guides/continuous-integration/introduction#CI-Build-Information)
455+
456+
- See Cypress' documentation on [CI Build Information](https://on.cypress.io/guides/continuous-integration/introduction#CI-Build-Information)
456457

457458
Example workflow using the variables:
459+
458460
```yml
459461
name: Example echo PR number and URL
460462
on: push
@@ -571,7 +573,6 @@ jobs:
571573
runs-on: ubuntu-24.04
572574
name: E2E
573575
steps:
574-
575576
- name: Checkout
576577
uses: actions/checkout@v4
577578
@@ -736,6 +737,7 @@ The Cypress GH Action does not spawn or create any additional containers - it on
736737
If you use the GitHub Actions facility for [Re-running workflows and jobs](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs), note that [Re-running failed jobs in a workflow](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs?tool=webui#re-running-failed-jobs-in-a-workflow) is not suited for use with parallel recording into Cypress Cloud. Re-running failed jobs in this situation does not simply re-run failed Cypress tests. Instead it re-runs **all** Cypress tests, load-balanced over the containers with failed jobs.
737738

738739
To optimize runs when there are failing tests present, refer to optional [Cypress Cloud Smart Orchestration](https://docs.cypress.io/cloud/features/smart-orchestration/overview/) Premium features:
740+
739741
- [Spec Prioritization](https://docs.cypress.io/cloud/features/smart-orchestration/spec-prioritization)
740742
- [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration/run-cancellation). See also [Specify auto cancel after failures](#specify-auto-cancel-after-failures) for details of how to set this option in a Cypress GH Action workflow.
741743

@@ -796,6 +798,7 @@ jobs:
796798
with:
797799
start: npm start
798800
```
801+
799802
**Caution:** use the `start` parameter only to start a server, not to run Cypress, otherwise tests may be run twice. The action runs Cypress tests by default, unless the parameter `runTests` is set to `false`.
800803

801804
**Note:** sometimes on Windows you need to run a different start command. You can use the `start-windows` parameter for this.
@@ -888,8 +891,6 @@ By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout i
888891
wait-on-timeout: 120
889892
```
890893

891-
892-
893894
You can wait for multiple URLs to respond by separating urls with a comma
894895

895896
```yml
@@ -1064,7 +1065,7 @@ repo/
10641065
package-lock.json
10651066
```
10661067

1067-
We use `working-directory: app-test` to match the above example directory structure:
1068+
We use `working-directory: app-test` to match the above example directory structure:
10681069

10691070
```yml
10701071
on: push
@@ -1429,11 +1430,11 @@ jobs:
14291430

14301431
This action installs local dependencies using lock files. Ensure that exactly one type of lock file is used for each project or working-directory from the following supported package managers:
14311432

1432-
| Lock file | Package Manager | Installation command |
1433-
| ------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------- |
1434-
| `package-lock.json` | [npm](https://docs.npmjs.com/cli/v9/commands/npm-ci) | `npm ci` |
1435-
| `pnpm-lock.yaml` | [pnpm](https://pnpm.io/cli/install#--frozen-lockfile) | `pnpm install --frozen-lockfile` |
1436-
| `yarn.lock` | [Yarn Classic](https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile) | `yarn --frozen-lockfile` |
1433+
| Lock file | Package Manager | Installation command |
1434+
| ------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------- |
1435+
| `package-lock.json` | [npm](https://docs.npmjs.com/cli/v9/commands/npm-ci) | `npm ci` |
1436+
| `pnpm-lock.yaml` | [pnpm](https://pnpm.io/cli/install#--frozen-lockfile) | `pnpm install --frozen-lockfile` |
1437+
| `yarn.lock` | [Yarn Classic](https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile) | `yarn --frozen-lockfile` |
14371438

14381439
See section [Yarn Modern](#yarn-modern) for information about using Yarn version 2 and later.
14391440

@@ -1514,7 +1515,7 @@ If you configure a `workflow_dispatch` event in your own workflows, you will be
15141515

15151516
### Outputs
15161517

1517-
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 using a [Custom test command](#custom-test-command) with the `command` parameter overrides the `record` parameter and in this case no `resultsUrl` step output is saved.
1518+
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.
15181519

15191520
This is an example of using the step output `resultsUrl`:
15201521

@@ -1697,6 +1698,7 @@ Please see our [Contributing Guideline](./CONTRIBUTING.md) which explains how to
16971698
This project is licensed under the terms of the [MIT license][license-file].
16981699

16991700
<!-- badge links follow -->
1701+
17001702
[ci-badge]: https://github.com/cypress-io/github-action/actions/workflows/main.yml/badge.svg
17011703
[ci-workflow]: https://github.com/cypress-io/github-action/actions/workflows/main.yml
17021704
[cloud-badge]: https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/3tb7jn/master&style=flat&logo=cypress

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ inputs:
9191
description: 'Whether or not to silence any Cypress specific output from stdout'
9292
required: false
9393
component:
94-
description: "Lets the action know that Cypress is running component tests and not e2e tests"
94+
description: 'Lets the action know that Cypress is running component tests and not e2e tests'
9595
required: false
9696
default: false
9797
outputs:

dist/index.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,20 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
412412
key,
413413
version
414414
};
415-
const response = yield twirpClient.CreateCacheEntry(request);
416-
if (!response.ok) {
415+
let signedUploadUrl;
416+
try {
417+
const response = yield twirpClient.CreateCacheEntry(request);
418+
if (!response.ok) {
419+
throw new Error('Response was not ok');
420+
}
421+
signedUploadUrl = response.signedUploadUrl;
422+
}
423+
catch (error) {
424+
core.debug(`Failed to reserve cache: ${error}`);
417425
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
418426
}
419427
core.debug(`Attempting to upload cache located at: ${archivePath}`);
420-
yield cacheHttpClient.saveCache(cacheId, archivePath, response.signedUploadUrl, options);
428+
yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options);
421429
const finalizeRequest = {
422430
key,
423431
version,
@@ -93180,7 +93188,7 @@ const supportsColor = {
9318093188
/***/ ((module) => {
9318193189

9318293190
"use strict";
93183-
module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.1","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
93191+
module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
9318493192

9318593193
/***/ })
9318693194

0 commit comments

Comments
 (0)