-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PNPM Cache does not work properly #1040
Comments
Which GitHub runner have you selected in your workflow in the |
For Running the example from .github/workflows/example-basic-pnpm.yml with The two clues in the logs from the original posting are:
The Cache Size should not be So caching for pnpm seems to be missing functionality which has not been implemented.
|
As a workaround for the missing pnpm caching functionality in - uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store- |
It's a self-hosted runner based on
That's exactly what I ended up doing yesterday :) thanks I imagine the best solution is to do exactly what you said rather than hardcoding, but in case it is useful somehow, my store path is I don't understand why the pnpm/action-setup doesn't have a built-in cache option. I guess I'll go file a ticket on them 😄 |
It's good to hear that you have a solution now! Hard-coding the path would be fine for an individual situation. Getting it dynamically just protects against any change and is cross-compatible to other operating systems. You may like to close this issue now since I picked up the missing functionality in the issue / PR listed in #1040 (comment) ^^. |
I have a workflow file that contains these steps:
The resulting log when I run this action:
While it does indicate there is a 320MB cache, the cache actually isn't working. You can see at the end of the log that it is still downloading packages.
Compare this to the result of running
rm -rf node_modules && pnpm install --frozen-lockfile
on my local machine:The text was updated successfully, but these errors were encountered: