From 88c62da08b0c8f900ab6d5e5bf7b123a95969d87 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Sat, 29 Nov 2025 15:49:23 +0100 Subject: [PATCH] test: use native pnpm install for pnpm workspace example --- .../example-start-and-pnpm-workspaces.yml | 22 +++++-------------- README.md | 10 ++++----- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/example-start-and-pnpm-workspaces.yml b/.github/workflows/example-start-and-pnpm-workspaces.yml index 9d34a7e7c..7d19326f8 100644 --- a/.github/workflows/example-start-and-pnpm-workspaces.yml +++ b/.github/workflows/example-start-and-pnpm-workspaces.yml @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/README.md b/README.md index 49ef50793..87b7a9147 100644 --- a/README.md +++ b/README.md @@ -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)