Skip to content

Commit d1971e9

Browse files
authored
test: remove pnpm store caching (#1188)
1 parent 8c3db3a commit d1971e9

File tree

3 files changed

+1
-92
lines changed

3 files changed

+1
-92
lines changed

.github/workflows/example-basic-pnpm.yml

-55
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ jobs:
1717
- name: Install pnpm
1818
run: npm install -g pnpm@9
1919

20-
- name: Get pnpm store directory
21-
shell: bash
22-
run: |
23-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
24-
25-
- name: Setup pnpm cache
26-
uses: actions/cache@v4
27-
with:
28-
path: ${{ env.STORE_PATH }}
29-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
30-
3120
- name: Cypress tests
3221
# normally you would write
3322
# uses: cypress-io/github-action@v6
@@ -50,17 +39,6 @@ jobs:
5039
- name: Install pnpm
5140
run: npm install -g pnpm@9
5241

53-
- name: Get pnpm store directory
54-
shell: bash
55-
run: |
56-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
57-
58-
- name: Setup pnpm cache
59-
uses: actions/cache@v4
60-
with:
61-
path: ${{ env.STORE_PATH }}
62-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
63-
6442
- name: Cypress tests
6543
uses: ./
6644
with:
@@ -76,17 +54,6 @@ jobs:
7654
- name: Install pnpm
7755
run: npm install -g pnpm@9
7856

79-
- name: Get pnpm store directory
80-
shell: bash
81-
run: |
82-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
83-
84-
- name: Setup pnpm cache
85-
uses: actions/cache@v4
86-
with:
87-
path: ${{ env.STORE_PATH }}
88-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
89-
9057
- name: Cypress tests
9158
uses: ./
9259
with:
@@ -102,17 +69,6 @@ jobs:
10269
- name: Install pnpm
10370
run: npm install -g pnpm@9
10471

105-
- name: Get pnpm store directory
106-
shell: bash
107-
run: |
108-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
109-
110-
- name: Setup pnpm cache
111-
uses: actions/cache@v4
112-
with:
113-
path: ${{ env.STORE_PATH }}
114-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
115-
11672
- name: Cypress tests
11773
uses: ./
11874
with:
@@ -131,17 +87,6 @@ jobs:
13187
- name: Install pnpm
13288
run: npm install -g pnpm@9
13389

134-
- name: Get pnpm store directory
135-
shell: bash
136-
run: |
137-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
138-
139-
- name: Setup pnpm cache
140-
uses: actions/cache@v4
141-
with:
142-
path: ${{ env.STORE_PATH }}
143-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
144-
14590
- name: Cypress tests
14691
uses: ./
14792
with:

.github/workflows/example-start-and-pnpm-workspaces.yml

-27
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
single-ws:
1414
# This job installs pnpm,
1515
# installs all dependencies,
16-
# caches the pnpm store,
1716
# caches the Cypress binary cache,
1817
# then runs Cypress tests in the single workspace
1918
# of the subfolder "packages/workspace-1".
@@ -27,20 +26,6 @@ jobs:
2726
- name: Install pnpm
2827
run: npm install -g pnpm@9
2928

30-
# locate the pnpm store directory where pnpm dependencies are installed
31-
- name: Get pnpm store directory
32-
shell: bash
33-
run: |
34-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
35-
36-
# Cypress github-action does not cache pnpm dependencies by default.
37-
# Cache the dependencies.
38-
- name: Setup pnpm cache
39-
uses: actions/cache@v4
40-
with:
41-
path: ${{ env.STORE_PATH }}
42-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/start-and-pnpm-workspaces/pnpm-lock.yaml') }}
43-
4429
- name: Install dependencies
4530
# with Cypress GitHub Action.
4631
# Calling the Cypress GitHub Action causes all dependencies from
@@ -75,7 +60,6 @@ jobs:
7560
multiple-ws:
7661
# This job installs pnpm,
7762
# installs all dependencies,
78-
# caches the pnpm store,
7963
# caches the Cypress binary cache,
8064
# then runs Cypress tests in each of the workspaces.
8165
runs-on: ubuntu-22.04
@@ -93,17 +77,6 @@ jobs:
9377
- name: Install pnpm
9478
run: npm install -g pnpm@9
9579

96-
- name: Get pnpm store directory
97-
shell: bash
98-
run: |
99-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
100-
101-
- name: Setup pnpm cache
102-
uses: actions/cache@v4
103-
with:
104-
path: ${{ env.STORE_PATH }}
105-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/start-and-pnpm-workspaces/pnpm-lock.yaml') }}
106-
10780
- name: Install dependencies
10881
uses: ./ # approximately equivalent to using cypress-io/github-action@v6
10982
with:

README.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ jobs:
11051105
### pnpm
11061106

11071107
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.
1108-
At this time the action does not automatically cache dependencies installed by pnpm. The example below includes steps to locate the pnpm store directory and to cache its contents for later use.
1108+
At this time, the action does not automatically cache dependencies installed by pnpm. We advise against attempting to work around this restriction, by caching the pnpm store directory through additional workflow steps, as this can lead to the action skipping installation of the Cypress binary, causing workflow failure.
11091109

11101110
```yaml
11111111
name: example-basic-pnpm
@@ -1118,15 +1118,6 @@ jobs:
11181118
uses: actions/checkout@v4
11191119
- name: Install pnpm
11201120
run: npm install -g pnpm@9
1121-
- name: Get pnpm store directory
1122-
shell: bash
1123-
run: |
1124-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
1125-
- name: Setup pnpm cache
1126-
uses: actions/cache@v4
1127-
with:
1128-
path: ${{ env.STORE_PATH }}
1129-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
11301121
- name: Cypress run
11311122
uses: cypress-io/github-action@v6
11321123
with:

0 commit comments

Comments
 (0)