Skip to content

Commit f38fe34

Browse files
committed
feat(github-actions): configure actions/setup-node to cache pnpm store
Configure `setup-node` action to cache PNPM store files. NB: This does not cache `node_modules`. Info: https://github.com/actions/setup-node?tab=readme-ov-file#caching-global-packages-data and https://github.com/pnpm/action-setup?tab=readme-ov-file#use-cache-to-reduce-installation-time
1 parent ae5a9cb commit f38fe34

File tree

1 file changed

+1
-20
lines changed
  • github-actions/npm/checkout-and-setup-node

1 file changed

+1
-20
lines changed

github-actions/npm/checkout-and-setup-node/action.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ inputs:
1717
Relative path to the nvm version file to set node version, exclusive with
1818
node-version-file-path input. Defaults to .nvmrc
1919
20-
cache-node-modules:
21-
default: false
22-
type: boolean
23-
description: |
24-
Whether to cache the node_modules directory, this is helpful when postinstalls are performed
25-
and modify the resulting node_modules directory. Defaults to False.
26-
27-
node-module-directories:
28-
default: ./node_modules
29-
description: |
30-
Space delimited list of node_modules directories to cache. Defaults to `./node_modules`
31-
3220
runs:
3321
using: composite
3422
steps:
@@ -50,6 +38,7 @@ runs:
5038
with:
5139
node-version-file: ${{ inputs.node-version-file-path }}
5240
node-version: ${{ inputs.node-version }}
41+
cache: 'pnpm'
5342

5443
- id: packageManager
5544
shell: bash
@@ -58,11 +47,3 @@ runs:
5847
5948
- if: steps.packageManager.outputs.PACKAGE_MANAGER == 'pnpm'
6049
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
61-
62-
63-
# TODO(josephperrott): Determine if its safe to use this caching step.
64-
# - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
65-
# if: ${{ inputs.cache-node-modules == 'true' }}
66-
# with:
67-
# path: ${{ inputs.node-module-directories }}
68-
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/*.patch') }}

0 commit comments

Comments
 (0)