Open transitive-bullshit opened 2 years ago
The official actions/setup-node guide also recommends a completely different, simpler approach which doesn't seem to work.
Sounds like a bug on actions/setup-node
behalf? I am not a maintainer of actions/setup-node
so I can do nothing about it. I cannot just copy the guide on actions/setup-node
to pnpm/action-setup
because, if your words are to be believed, it doesn't work.
But I do agree that currently, the only way to do cache is a bit to complex, if pnpm/action-setup
has cache built-in, things would've been a lot simpler. I'm not going to implement it though, if someone else wants to tackle this, feel free.
The solution documented by actions/setup-node
worked for me, but I ran into a limitation: I use Cypress, which downloads binaries in a post-install
script and stores them in a ~/.cache/Cypress
folder that is meant to be cached along with the pnpm store directory.
The maintainers of actions/setup-node
are not willing to complexify the caching feature to solve this, and I understand their reasoning. The feature is really just for convenience and that's a good thing.
if pnpm/action-setup has cache built-in, things would've been a lot simpler.
I don't think pnpm/action-setup
should attempt to deal with caching dependencies, whichever the approach:
actions/setup-node
already provides one (if it doesn't work for you @transitive-bullshit, then that's something to look into for sure).actions/cache
's configuration API, which seems pointless.I do think, however, that the README should document the convenience caching method provided by actions/setup-node
... or at least link to it.
For advanced caching use cases, in my opinion, pnpm/action-setup
should just do its best to make caching the pnpm store directory in a separate action as easy as possible. Right now, I think the main complexity comes from having an extra step to get the pnpm store's path (i.e. echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
). Any chance pnpm/action-setup
could save the pnpm store path as an output so it can be used directly in actions/cache
with path: ${{ steps.pnpm-install.outputs.storePath }}
?
First off, love pnpm ❤️
I've been gradually replacing
yarn v1
withpnpm
in all of my OSS repos, and adding pnpm to GitHub actions is currently kind of ugly / verbose / error-prone.The official actions/setup-node guide also recommends a completely different, simpler approach which doesn't seem to work. See the
Caching pnpm (v6.10+) dependencies
in their guide, which uses the much simplercache: 'pnpm'
parameter. Since this is how caching works fornpm
andyarn
, I fully expectedpnpm
caching to "just work" using the officialactions/setup-node
guide, but it doesn't appear to.Here's an example of the boilerplate that I'm currently using which matches the caching setup recommended by this repo's readme. As far as I can tell, the caching is taking effect, BUT it seems brittle to have this logic spread across N repositories instead of in
pnpm/action-setup
and/or the official GitHubactions/setup-node
.For maintainers with lots of repos like myself, this is an annoyance that I know will cause a maintenance burden down the line.
So I'm opening this issue to get feedback and track a better solution going forwards.
Thanks!