You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Run tests on multiple [Node versions](#node-versions)
73
74
- Split [install and tests](#split-install-and-tests) into separate jobs
@@ -100,7 +101,7 @@ jobs:
100
101
steps:
101
102
- name: Checkout
102
103
uses: actions/checkout@v6
103
-
# Install npm dependencies, cache them correctly
104
+
# Install dependencies with caching
104
105
# and run all Cypress tests
105
106
- name: Cypress run
106
107
uses: cypress-io/github-action@v7
@@ -566,15 +567,14 @@ jobs:
566
567
node: [20, 22, 24, 25]
567
568
name: E2E on Node v${{ matrix.node }}
568
569
steps:
570
+
- name: Checkout
571
+
uses: actions/checkout@v6
569
572
- name: Install Node.js
570
573
uses: actions/setup-node@v6
571
574
with:
572
575
node-version: ${{ matrix.node }}
573
576
- run: node -v
574
577
575
-
- name: Checkout
576
-
uses: actions/checkout@v6
577
-
578
578
- name: Cypress run
579
579
uses: cypress-io/github-action@v7
580
580
with:
@@ -663,7 +663,7 @@ jobs:
663
663
steps:
664
664
- name: Checkout
665
665
uses: actions/checkout@v6
666
-
# Install npm dependencies, cache them correctly
666
+
# Install dependencies with caching
667
667
# and run all Cypress tests with `quiet` parameter
668
668
- name: Cypress run
669
669
uses: cypress-io/github-action@v7
@@ -1167,9 +1167,14 @@ jobs:
1167
1167
1168
1168
### pnpm
1169
1169
1170
-
The package manager `pnpm` is not pre-installed in [GitHub Actions runner images](https://github.com/actions/runner-images) (unlike `npm` and `yarn`) and so it must be installed in a separate workflow step (see below). If the action finds a `pnpm-lock.yaml` file, it uses the [pnpm](https://pnpm.io/cli/install) command `pnpm install --frozen-lockfile` by default to install dependencies.
1170
+
The package manager `pnpm` is not pre-installed in [GitHub Actions runner images](https://github.com/actions/runner-images)
1171
+
(unlike npm and Yarn Classic) and so it must be installed in a separate workflow step (see below).
1172
+
If the action finds a `pnpm-lock.yaml` file, it uses the [pnpm](https://pnpm.io/cli/install) command `pnpm install --frozen-lockfile` by default to install dependencies.
1171
1173
1172
-
The example below follows [pnpm recommendations](https://pnpm.io/continuous-integration#github-actions) for installing pnpm and caching the [pnpm store](https://pnpm.io/cli/store). Follow the [Cypress pnpm configuration instructions](https://docs.cypress.io/app/get-started/install-cypress#pnpm-configuration) and apply them to your project, to enable pnpm to install the Cypress binary.
1174
+
The example below follows [pnpm recommendations](https://pnpm.io/continuous-integration#github-actions) for installing pnpm and caching the
1175
+
[pnpm store](https://pnpm.io/cli/store).
1176
+
Follow the [Cypress pnpm configuration instructions](https://docs.cypress.io/app/get-started/install-cypress#pnpm-configuration)
1177
+
and apply them to your project, to enable pnpm to install the Cypress binary.
The action does not directly support using [pnpm workspaces](https://pnpm.io/workspaces) (see feature request [#1144](https://github.com/cypress-io/github-action/issues/1144)). As a workaround, you can install dependencies and run Cypress tests in a workspace in separate steps. The snippet below shows this principle.
1209
+
The action does not directly support using [pnpm workspaces](https://pnpm.io/workspaces)
1210
+
(see feature request [#1144](https://github.com/cypress-io/github-action/issues/1144)).
1211
+
As a workaround, you can install dependencies and run Cypress tests in a workspace in separate steps.
it caches the package manager cache from npm or from Yarn 1 (Classic) by default,
1348
+
based on the [lockfile](#package-manager-cache) it discovers.
1349
+
If package manager caching is implemented separately from the action,
1350
+
for example to work with Yarn Modern or pnpm,
1351
+
then disable the actions' package manager caching by setting the parameter
1352
+
`package-manager-cache`to `false`.
1353
+
1354
+
GitHub's [actions/setup-node](https://github.com/actions/setup-node/blob/main/README.md) offers a convenient way to install a chosen version of Node.js
1355
+
and to set up caching of package manager caches in one step.
1356
+
1357
+
```yml
1358
+
name: Package manager caching
1359
+
on: push
1360
+
jobs:
1361
+
cypress-run:
1362
+
runs-on: ubuntu-24.04
1363
+
name:
1364
+
steps:
1365
+
- uses: actions/checkout@v6
1366
+
- uses: actions/setup-node@v6
1367
+
with:
1368
+
node-version: lts
1369
+
cache: 'pnpm'
1370
+
cache-dependency-path: pnpm-lock.yaml
1371
+
- uses: cypress-io/github-action@v7
1372
+
with:
1373
+
package-manager-cache: false
1374
+
```
1375
+
1332
1376
### Custom cache key
1333
1377
1334
1378
Sometimes the default cache key does not work. For example, if you cannot share the Node modules across Node versions due to native extensions. In that case pass your own `cache-key` parameter.
@@ -1345,12 +1389,12 @@ jobs:
1345
1389
node: [20, 22, 24, 25]
1346
1390
name: E2E on Node v${{ matrix.node }}
1347
1391
steps:
1392
+
- name: Checkout
1393
+
uses: actions/checkout@v6
1348
1394
- name: Install Node.js
1349
1395
uses: actions/setup-node@v6
1350
1396
with:
1351
1397
node-version: ${{ matrix.node }}
1352
-
- name: Checkout
1353
-
uses: actions/checkout@v6
1354
1398
# run Cypress tests and record them under the same run
1355
1399
# associated with commit SHA and just give a different group name
0 commit comments