pnpm/action-setup: Install pnpm in CI
action-setup installs pnpm so your workflow can use it for installs and scripts.
Install pnpm first, then run setup-node with cache: pnpm to cache the store. Or set run_install to install dependencies directly from this action.
Key inputs (with:)
- version: pnpm version to install (or read packageManager).
- run_install: run pnpm install as part of the step.
- dest: where to install the pnpm binary.
- standalone: install a standalone pnpm.
Example workflow
.github/workflows/ci.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm testOn any runner
pnpm setup runs on any runner. Latchkey managed runners run it unchanged.
Key takeaways
- Install pnpm before calling setup-node with cache: pnpm.
- Order matters: setup-node needs pnpm on PATH to cache it.
- Use --frozen-lockfile in CI for deterministic installs.
Related guides
actions/setup-node: Install Node.js in CIReference for actions/setup-node: pin a Node.js version, enable built-in npm/yarn/pnpm caching, and register…
actions/cache: Save & Restore Build CachesReference for actions/cache: cache dependencies and build outputs across runs using key and restore-keys, wit…
actions/checkout: Inputs & Workflow UsageReference for actions/checkout: clone your repository into the runner, control fetch-depth, submodules, refs,…