Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions .github/workflows/example-start-and-pnpm-workspaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
single-ws:
# This job installs pnpm,
# installs all dependencies,
# caches the Cypress binary cache,
# then runs Cypress tests in the single workspace
# of the subfolder "packages/workspace-1".
runs-on: ubuntu-24.04
Expand All @@ -32,15 +31,9 @@ jobs:
run: npm install -g pnpm@10

- name: Install dependencies
# with Cypress GitHub Action.
# Calling the Cypress GitHub Action causes all dependencies from
# the root of the pnpm workspace examples/start-and-pnpm-workspaces
# to be installed
# AND it automatically caches the Cypress binary.
uses: ./
with:
working-directory: examples/start-and-pnpm-workspaces
runTests: false
# All dependencies including workspaces are installed
run: pnpm install --frozen-lockfile
working-directory: examples/start-and-pnpm-workspaces

- name: Cypress test Single
# Run Cypress in examples/start-and-pnpm-workspaces/packages/workspace-1 only
Expand All @@ -49,7 +42,7 @@ jobs:
# Do not attempt to install dependencies in the workspace using the action.
# There is no pnpm-lock.yaml file in a workspace for
# Cypress GitHub Action to use.
# We already installed dependencies when we called the action previously.
# We already installed dependencies previously.
install: false
working-directory: examples/start-and-pnpm-workspaces/packages/workspace-1
build: pnpm run build
Expand All @@ -59,7 +52,6 @@ jobs:
multiple-ws:
# This job installs pnpm,
# installs all dependencies,
# caches the Cypress binary cache,
# then runs Cypress tests in each of the workspaces.
runs-on: ubuntu-24.04
strategy:
Expand All @@ -77,10 +69,8 @@ jobs:
run: npm install -g pnpm@10

- name: Install dependencies
uses: ./
with:
working-directory: examples/start-and-pnpm-workspaces
runTests: false
run: pnpm install --frozen-lockfile
working-directory: examples/start-and-pnpm-workspaces

- name: Cypress test Multiple
# Run Cypress in
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1200,22 +1200,20 @@ jobs:

### pnpm workspaces

If you are using [pnpm workspaces](https://pnpm.io/workspaces) you need to install dependencies and run Cypress tests in a workspace in separate steps. The snippet below shows this principle.
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.

```yml
...
- name: Install dependencies
uses: cypress-io/github-action@v6
with:
working-directory: examples/start-and-pnpm-workspaces
runTests: false
run: pnpm install --frozen-lockfile
working-directory: examples/start-and-pnpm-workspaces

- name: Cypress test
uses: cypress-io/github-action@v6
with:
install: false
working-directory: examples/start-and-pnpm-workspaces/packages/workspace-1
...
...
```

[![pnpm workspaces example](https://github.com/cypress-io/github-action/actions/workflows/example-start-and-pnpm-workspaces.yml/badge.svg)](.github/workflows/example-start-and-pnpm-workspaces.yml)
Expand Down