-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Node - pnpm example #585
Conversation
Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
Caching `node_modules` allows to make the `pnpm install` step instantaneous
examples.md
Outdated
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to add a pnpm
prefix here, like
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added -pnpm-
in cache key
path: | | ||
~/.pnpm-store | ||
D:\.pnpm-store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if his pnpm is installed on the E drive? Let's ignore the windows case for now
path: ~/.pnpm-store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official pnpm setup installs pnpm in the D drive. Also, it doesn't hurt if the path doesn't exist. The users can update this later.
Hi @orta, |
I'm afraid I don't have write access, I believe it's on @tiwarishub to make the call - looks reasonable to me though |
@joshmgross @bethanyj28 what do you think about adding the changes from this PR? I think it was closed because of lack of response from reviewers... |
~/.pnpm-store | ||
D:\.pnpm-store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these pnpm store paths could be resolved from running pnpm store path --silent
, as is done in actions/setup-node
:
Probably a better version of the PR would be this, taken from the last version in the pnpm readme ## Node - pnpm
```yaml
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
``` |
Opened a followup PR here: |
No description provided.