-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
[Q] Setup Node Cache #82
Comments
I'm also curious about this. When run manually, we can also cache See my comparison of the two runs (one caching |
https://pnpm.io/continuous-integration#github-actions uses the |
Is there any reason the action couldn't automatically set up node and caching for users? It would be great if we could do something like: on: [push]
jobs:
test:
steps:
- uses: pnpm/action-setup@vnext
with:
do-for-me: node,cache,install
- run: pnpm-test People who wanted fine-grained control could just opt out of I think the equivalent of the above right now is something like this according to this repo's docs: on: [push]
jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 7
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-
- name: Install dependencies
run: pnpm install
- run: pnpm test |
What's the difference in using the cache via
https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
Versus using
cache: 'pnpm'
with:https://github.com/actions/setup-node
Thank you!
The text was updated successfully, but these errors were encountered: