Skip to content
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

Closed
wants to merge 10 commits into from
Closed

Add Node - pnpm example #585

wants to merge 10 commits into from

Conversation

ebeloded
Copy link

No description provided.

@ebeloded ebeloded requested a review from a team as a code owner May 12, 2021 04:53
ebeloded and others added 2 commits June 2, 2021 10:47
Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
@ebeloded ebeloded removed the request for review from a team June 7, 2021 01:05
@ebeloded
Copy link
Author

ebeloded commented Aug 9, 2021

@aminya @Limlay
Since last review I have added **/node_modules to the list of cached resources. This allows to cache artifacts that are generated during post install step. With this change the pnpm install script is instantaneous.

examples.md Outdated
Comment on lines 290 to 292
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}
Copy link

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-

Copy link
Author

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

Comment on lines +287 to +289
path: |
~/.pnpm-store
D:\.pnpm-store
Copy link

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

Copy link

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.

Co-authored-by: Orta Therox <git@orta.io>
@hckhanh
Copy link

hckhanh commented Oct 27, 2022

Hi @orta,
Is there any updates for this PR?

@orta
Copy link

orta commented Oct 27, 2022

I'm afraid I don't have write access, I believe it's on @tiwarishub to make the call - looks reasonable to me though

@karlhorky
Copy link

karlhorky commented Aug 13, 2024

@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...

Comment on lines +365 to +366
~/.pnpm-store
D:\.pnpm-store

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:

@karlhorky
Copy link

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-
```

@karlhorky
Copy link

Opened a followup PR here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants