chore: optimize CI pnpm setup#80
Conversation
📝 WalkthroughWalkthroughThis PR updates three GitHub Actions workflows (lint, main, and release) to standardize pnpm dependency installation. Each workflow's setup-node action is configured with 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
.github/workflows/main.yml (2)
37-37: 💤 Low valueConsider using
pnpm testfor consistency.The workflow now uses
pnpm/action-setupfor dependency management, but the test command still usesnpm test. While this works (npm can run package.json scripts), usingpnpm testwould be more consistent with the pnpm-first approach this PR establishes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/main.yml at line 37, Update the GitHub Actions step that runs tests to use pnpm instead of npm for consistency with the pnpm setup; specifically replace the run command that currently invokes "npm test -- --forceExit || npm test -- --forceExit || npm test -- --forceExit" with an equivalent "pnpm test" invocation (preserving the forced-exit / retry behavior if needed) so the workflow uses pnpm for running scripts in the same way it uses pnpm/action-setup to install dependencies.
31-34: 💤 Low valueConsider clarifying the step name for consistency.
Similar to the lint workflow, the step name "Install Pnpm" doesn't reflect that
run_install: truealso installs dependencies. Consider "Install Pnpm and Dependencies" for clarity across workflows.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/main.yml around lines 31 - 34, Rename the workflow step whose name string is "Install Pnpm" (the step that uses pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 and sets run_install: true) to "Install Pnpm and Dependencies" so the step name clearly reflects that it also installs project dependencies and matches naming used in the lint workflow..github/workflows/release.yml (1)
29-32: 💤 Low valueConsider clarifying the step name for consistency.
For consistency with the other workflows, consider renaming this step to "Install Pnpm and Dependencies" since
run_install: trueperforms both actions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml around lines 29 - 32, Rename the GitHub Actions step currently labeled "Install Pnpm" to "Install Pnpm and Dependencies" to reflect that run_install: true both installs pnpm and runs dependency installation; update the step's name (the YAML key "name" for the step that uses pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 and has with: run_install: true) accordingly so it matches naming conventions in the other workflows.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/lint.yml:
- Around line 27-30: Update the pinned pnpm/action-setup reference so the tag
and SHA match: either change the comment suffix to the actual SHA referenced
(keep uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 and
update the trailing comment) or replace the uses value with the correct SHA for
v6.0.8 (d15e628ca66d93ee5f352c71671a7bc6a97af5c9) to make the pin consistent;
also optionally rename the step label "Install Pnpm" to "Install Pnpm and
Dependencies" to reflect that run_install: true installs deps.
---
Nitpick comments:
In @.github/workflows/main.yml:
- Line 37: Update the GitHub Actions step that runs tests to use pnpm instead of
npm for consistency with the pnpm setup; specifically replace the run command
that currently invokes "npm test -- --forceExit || npm test -- --forceExit ||
npm test -- --forceExit" with an equivalent "pnpm test" invocation (preserving
the forced-exit / retry behavior if needed) so the workflow uses pnpm for
running scripts in the same way it uses pnpm/action-setup to install
dependencies.
- Around line 31-34: Rename the workflow step whose name string is "Install
Pnpm" (the step that uses
pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 and sets run_install:
true) to "Install Pnpm and Dependencies" so the step name clearly reflects that
it also installs project dependencies and matches naming used in the lint
workflow.
In @.github/workflows/release.yml:
- Around line 29-32: Rename the GitHub Actions step currently labeled "Install
Pnpm" to "Install Pnpm and Dependencies" to reflect that run_install: true both
installs pnpm and runs dependency installation; update the step's name (the YAML
key "name" for the step that uses
pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 and has with:
run_install: true) accordingly so it matches naming conventions in the other
workflows.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 28cd359b-c05d-4ddb-a95e-4da90abc8428
📒 Files selected for processing (3)
.github/workflows/lint.yml.github/workflows/main.yml.github/workflows/release.yml
Summary
This PR aligns the GitHub Actions pnpm setup with the current Rsbuild workflow pattern from web-infra-dev/rsbuild#7856.
pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093andrun_install: true.actions/setup-nodepackage manager caching withpackage-manager-cache: false.