Skip to content

ci: switch to pnpm#130

Merged
weilinfox merged 1 commit intoruyisdk:zhfrom
pzhlkj6612:ci/cache-type-from-npm-to-pnpm
Feb 10, 2026
Merged

ci: switch to pnpm#130
weilinfox merged 1 commit intoruyisdk:zhfrom
pzhlkj6612:ci/cache-type-from-npm-to-pnpm

Conversation

@pzhlkj6612
Copy link
Copy Markdown
Contributor

@pzhlkj6612 pzhlkj6612 commented Feb 8, 2026

refs:

Better approach: re-use actions in the "ruyisdk/ruyisdk-website" repo.

Summary by Sourcery

Switch GitHub workflows to use pnpm for installing dependencies and building the website.

Build:

  • Change website install and build steps in CI to run via pnpm rather than npm.

CI:

  • Update GitHub Actions workflows to set up pnpm and use pnpm cache for Node.js jobs instead of npm.

refs:

- ci: switch to pnpm - ruyisdk/ruyisdk-website@22f4137

Signed-off-by: Mozi <29089388+pzhlkj6612@users.noreply.github.com>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Feb 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

CI workflows for GitHub Pages deployment and PR builds are updated to use pnpm (with pnpm/action-setup and pnpm caching) instead of npm for installing dependencies and building the website.

Flow diagram for updated gh-page and PR workflows with pnpm

flowchart TD
  Start[workflow_start]

  subgraph CommonSteps[common_job_steps]
    Checkout[checkout_repository]
    PNPMSetup[pnpm_action_setup_v4_version_10]
    NodeSetup[setup_node_22_4_1_cache_pnpm]
    Install[run_pnpm_install]
    Build[run_pnpm_run_build]
  end

  Start --> Checkout --> PNPMSetup --> NodeSetup --> Install --> Build

  subgraph gh_page_workflow
    Deploy[peaceiris_actions_gh_pages_deploy]
  end

  subgraph pr_workflow
    PRChecks[pr_build_validation]
  end

  Build --> Deploy
  Build --> PRChecks
Loading

File-Level Changes

Change Details Files
Switch CI workflows from npm to pnpm for install and build steps, with pnpm-specific setup and caching.
  • Add pnpm/action-setup@v4 step configured to use pnpm version 10 before Node setup.
  • Update actions/setup-node configuration to use pnpm cache instead of npm cache.
  • Replace npm ci with pnpm install in CI dependency installation steps.
  • Replace npm run build with pnpm run build in CI website build steps.
.github/workflows/gh-page.yaml
.github/workflows/pr.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • In CI it’s generally safer to use pnpm install --frozen-lockfile (or equivalent) instead of plain pnpm install so that builds fail if the lockfile is out of sync with package.json.
  • Given the description mentions reusing actions from ruyisdk/ruyisdk-website, consider extracting a shared reusable workflow for the pnpm setup/build so that the configuration isn’t duplicated across repos.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In CI it’s generally safer to use `pnpm install --frozen-lockfile` (or equivalent) instead of plain `pnpm install` so that builds fail if the lockfile is out of sync with package.json.
- Given the description mentions reusing actions from `ruyisdk/ruyisdk-website`, consider extracting a shared reusable workflow for the pnpm setup/build so that the configuration isn’t duplicated across repos.

## Individual Comments

### Comment 1
<location> `.github/workflows/gh-page.yaml:33-36` </location>
<code_context>
         with:
           node-version: 22.4.1
-          cache: npm
+          cache: pnpm

       - name: Install dependencies
</code_context>

<issue_to_address>
**suggestion (performance):** Consider specifying `cache-dependency-path` for more reliable pnpm cache hits.

With `cache: pnpm`, `actions/setup-node` derives cache keys from lockfiles. If your lockfile isn’t at the repo root (or you want to be explicit), set `cache-dependency-path` (e.g. `docs/pnpm-lock.yaml`) so the cache uses the correct file and remains stable if the repo layout changes.

```suggestion
      - uses: actions/setup-node@v4
        with:
          node-version: 22.4.1
          cache: pnpm
          cache-dependency-path: docs/pnpm-lock.yaml
```
</issue_to_address>

### Comment 2
<location> `.github/workflows/gh-page.yaml:38-39` </location>
<code_context>

       - name: Install dependencies
-        run: npm ci
+        run: pnpm install
       - name: Build website
-        run: npm run build
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Lockfile integrity enforcement is looser with `pnpm install` than `npm ci`.

`npm ci` failed when the lockfile and `package.json` were out of sync. To preserve that safety with pnpm, consider `pnpm install --frozen-lockfile` (or `--lockfile-only` elsewhere) so CI fails on lockfile drift instead of updating it during the run.

```suggestion
      - name: Install dependencies
        run: pnpm install --frozen-lockfile
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/gh-page.yaml
Comment on lines 38 to +39
- name: Install dependencies
run: npm ci
run: pnpm install
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Lockfile integrity enforcement is looser with pnpm install than npm ci.

npm ci failed when the lockfile and package.json were out of sync. To preserve that safety with pnpm, consider pnpm install --frozen-lockfile (or --lockfile-only elsewhere) so CI fails on lockfile drift instead of updating it during the run.

Suggested change
- name: Install dependencies
run: npm ci
run: pnpm install
- name: Install dependencies
run: pnpm install --frozen-lockfile

@weilinfox weilinfox merged commit 1a057bd into ruyisdk:zh Feb 10, 2026
3 checks passed
@pzhlkj6612 pzhlkj6612 deleted the ci/cache-type-from-npm-to-pnpm branch February 10, 2026 03:32
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.

2 participants