Skip to content

build: optimize the workflow - #331

Merged
16bit-ykiko merged 30 commits into
mainfrom
update-docs
Dec 29, 2025
Merged

16bit-ykiko merged 30 commits into
mainfrom
update-docs

Conversation

@16bit-ykiko

@16bit-ykiko 16bit-ykiko commented Dec 28, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Automated documentation deployment to GitHub Pages with custom domain.
  • Documentation

    • Standardized platform name to "macOS" across docs and code/tests.
  • Chores

    • Reworked CI/CD workflows for modular, conditional orchestration and streamlined task runner integration.
    • Updated VS Code extension packaging/publish scripts and package manager configuration.
    • Simplified build/test matrices and workflow triggers.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 28, 2025 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Centralizes CI into a main orchestrator that path-filters changes and conditionally invokes reusable workflows, migrates many workflows to Pixi-driven tasks (workflow_call), adds docs deployment to GitHub Pages, updates pixi.toml for Node tasks and PNPM, and standardizes macOS naming across docs, headers, and tests.

Changes

Cohort / File(s) Summary
Main orchestrator workflow
/.github/workflows/main.yml
New orchestrator using dorny/paths-filter to classify changes and conditionally dispatch reusable workflows and release flows via workflow_call.
Reusable workflows & deploy
/.github/workflows/deploy-docs.yml, /.github/workflows/publish-vscode.yml, /.github/workflows/publish-clice.yml, /.github/workflows/test-cmake.yml, /.github/workflows/test-xmake.yml, /.github/workflows/check-format.yml
Converted triggers to workflow_call, replaced remote Pixi setup with local action .github/actions/setup-pixi, moved many commands to pixi run tasks, and added docs deploy workflow invoking Pixi and actions-gh-pages.
Pixi local action
/.github/actions/setup-pixi/action.yml
New composite action wrapping prefix-dev/setup-pixi@v0.9.3 with default environments input and pinned pixi-version/options.
Pixi configuration
pixi.toml
Added feature.node (nodejs/pnpm deps), Node tasks (build-docs, preview-docs, build-vscode, publish-vscode, install-*), node environment, new hello develop task, and updated YAML formatting exclusion.
VS Code extension packaging
editors/vscode/package.json
Switched scripts to pnpm, added --no-dependencies to vsce package/publish, added @vscode/vsce devDependency, added pnpm config (onlyBuiltDependencies) and updated overrides.
CI matrix change
/.github/workflows/build-llvm.yml
Removed non-Windows OS entries (ubuntu-24.04, macos-15) from build matrix.
Docs text updates
docs/en/dev/build.md, docs/zh/dev/build.md
Standardized platform name from MacOS → macOS and minor formatting tweaks.
Platform constant rename
include/Test/Platform.h
Renamed constant MacOS → macOS in both #ifdef __APPLE__ and #else branches.
Tests updated
tests/unit/Compiler/CommandTests.cpp
Updated two skip_unless conditions to use macOS instead of MacOS.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Dev as Developer (push / PR / tag)
participant MainWF as main.yml (orchestrator)
participant Paths as dorny/paths-filter
participant Reusable as Reusable Workflows (workflow_call)
participant SetupPixi as .github/actions/setup-pixi
participant PixiTasks as Pixi (pixi run ...)
participant GHPages as actions-gh-pages

Dev->>MainWF: push / PR / tag
MainWF->>Paths: run path filters
Paths-->>MainWF: filter outputs (format, docs, clice, vscode, cmake, xmake)
MainWF->>Reusable: conditionally invoke workflows (workflow_call)
Reusable->>SetupPixi: call local setup-pixi action (environments)
SetupPixi->>PixiTasks: provide Pixi environment (pixi run ...)
PixiTasks->>GHPages: publish docs (when docs workflow invoked)
GHPages-->>Reusable: deployment result
Reusable-->>MainWF: aggregated job status

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through YAML, tidy and quick,

Pixi now dances, running each trick.
Docs sail to Pages beneath the night,
macOS spelled proper — snug and right.
The rabbit cheers this CI delight.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The PR title 'build: optimize the workflow' is vague and does not clearly summarize the main changes. The changeset involves comprehensive workflow restructuring (adding new workflows, migrating to Pixi, consolidating CI/CD pipelines), documentation updates, and codebase refactoring, none of which are clearly conveyed by 'optimize the workflow'. Consider a more specific title that reflects the primary objectives, such as 'build: restructure workflows with Pixi and add docs deployment' or 'refactor: consolidate CI/CD workflows and integrate Pixi'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7105e36 and f50c077.

⛔ Files ignored due to path filters (5)
  • docs/package-lock.json is excluded by !**/package-lock.json
  • docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • editors/vscode/package-lock.json is excluded by !**/package-lock.json
  • editors/vscode/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • pixi.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/deploy-docs.yml
  • pixi.toml
🔇 Additional comments (8)
pixi.toml (4)

62-62: LGTM!

The exclusion of pnpm-lock.yaml is appropriate since pnpm is being introduced as the package manager.


76-78: LGTM!

The Node.js and pnpm dependencies are correctly specified to support the documentation build workflow.


84-94: LGTM!

The install tasks correctly use pnpm and implement proper dependency tracking with inputs/outputs for caching optimization.


106-106: LGTM!

The node environment is correctly defined to include the node feature.

.github/workflows/deploy-docs.yml (4)

10-14: Good addition!

Adding the pull_request trigger enables validation of documentation changes before merging, which improves quality control.


27-34: LGTM!

The Pixi setup is correctly configured with the node environment, caching enabled, and locked mode for reproducible builds.


37-37: LGTM!

The build-docs command correctly invokes the Pixi task defined in pixi.toml.


40-40: LGTM!

The conditional deployment ensures that only changes merged to main are deployed to GitHub Pages, while PRs only validate the build.

Comment thread .github/workflows/deploy-docs.yml Outdated
Comment thread pixi.toml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
.github/workflows/deploy-docs.yml (1)

8-8: Fix workflow path references.

The workflow references .github/workflows/deploy.yml but the actual filename is deploy-docs.yml. This mismatch means the workflow won't trigger when the workflow file itself is modified.

🔎 Proposed fix
-      - ".github/workflows/deploy.yml"
+      - ".github/workflows/deploy-docs.yml"

Apply this fix at both lines 8 and 14.

Also applies to: 14-14

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f50c077 and 592a32f.

⛔ Files ignored due to path filters (1)
  • editors/vscode/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • .github/workflows/deploy-docs.yml
  • .github/workflows/publish-vscode.yml
  • editors/vscode/package.json
  • pixi.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • pixi.toml
🔇 Additional comments (8)
.github/workflows/publish-vscode.yml (2)

1-1: LGTM!

The workflow name and formatting improvements are appropriate and improve readability.

Also applies to: 8-8, 14-16


42-45: The build-vscode and publish-vscode tasks are properly defined in pixi.toml with the correct working directory (editors/vscode) and dependencies. No issues found.

.github/workflows/deploy-docs.yml (4)

10-15: LGTM!

Adding the pull_request trigger is a good practice to validate docs builds before merging.


40-40: LGTM!

The conditional deployment ensures that only builds from the main branch are deployed to GitHub Pages, which is a good practice to prevent PRs from publishing unreviewed documentation.


37-37: The build-docs task is correctly defined in pixi.toml.

The task is properly configured at line 81 with the working directory set to docs, command pnpm run docs:build, and a dependency on install-docs. No issues detected.


27-34: The versions are already current. setup-pixi v0.9.3 (released Nov 3, 2025) and pixi v0.61.0 (released Dec 9, 2025) are the latest stable versions. The build-docs task is properly defined in pixi.toml as a dependency of the node feature.

Likely an incorrect or invalid review comment.

editors/vscode/package.json (2)

144-146: LGTM!

The migration from npm to pnpm is consistent across all scripts. The updated baseImagesUrl correctly points to the main branch, and the --no-dependencies flag aligns with the new pnpm-based workflow.

Also applies to: 149-150


175-180: LGTM!

The pnpm configuration appropriately restricts built dependencies to @vscode/vsce-sign and keytar, which are known native dependencies requiring compilation. This helps optimize installation time and reduces potential build issues.

Comment thread .github/workflows/publish-vscode.yml Outdated
Comment thread editors/vscode/package.json
Comment thread editors/vscode/package.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f54c902 and 00e1ae9.

📒 Files selected for processing (12)
  • .github/workflows/build-llvm.yml
  • .github/workflows/check-format.yml
  • .github/workflows/deploy-docs.yml
  • .github/workflows/main.yml
  • .github/workflows/publish-clice.yml
  • .github/workflows/publish-vscode.yml
  • .github/workflows/test-cmake.yml
  • .github/workflows/test-xmake.yml
  • docs/en/dev/build.md
  • docs/zh/dev/build.md
  • include/Test/Platform.h
  • tests/unit/Compiler/CommandTests.cpp
💤 Files with no reviewable changes (1)
  • .github/workflows/build-llvm.yml
✅ Files skipped from review due to trivial changes (1)
  • docs/en/dev/build.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/publish-vscode.yml
🧰 Additional context used
🪛 actionlint (1.7.9)
.github/workflows/deploy-docs.yml

29-29: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

.github/workflows/main.yml

59-59: could not read reusable workflow file for "./.github/workflows/format.yml": open /home/jailuser/git/.github/workflows/format.yml: no such file or directory

(workflow-call)

🔇 Additional comments (14)
docs/zh/dev/build.md (1)

7-7: LGTM!

The documentation updates correctly standardize the platform name to "macOS" in both the platform list and the LLVM libs notes, aligning with Apple's official capitalization.

Also applies to: 69-69

tests/unit/Compiler/CommandTests.cpp (1)

237-237: LGTM!

The test gating conditions correctly updated to use macOS instead of MacOS, matching the constant rename in Platform.h. These changes maintain consistency even though the test cases are currently commented out.

Also applies to: 274-274

include/Test/Platform.h (1)

12-14: Renaming from MacOS to macOS is complete—no breaking changes remain unaddressed.

All references to the old constant name have been updated. The only remaining "MacOS" reference in the codebase is a comment about "MacOSX" in src/Compiler/Toolchain.cpp, which does not affect the constant definition. The standardized naming aligns with Apple's official capitalization and is correctly used in test code.

.github/workflows/check-format.yml (1)

3-4: LGTM! Workflow correctly converted to reusable pattern.

The conversion from direct triggers to workflow_call aligns with the new orchestration model introduced in main.yml, enabling conditional invocation based on path filters.

.github/workflows/test-cmake.yml (2)

3-4: LGTM! Workflow correctly converted to reusable pattern.

The conversion to workflow_call enables invocation from the central orchestrator workflow.


32-36: LGTM! Command simplification improves maintainability.

The consolidated single-line Pixi commands are cleaner and align with the project's standardization on Pixi-based task execution.

.github/workflows/publish-clice.yml (3)

1-1: LGTM! Workflow rename improves clarity.

The rename from "package" to "clice" better reflects the workflow's purpose.


6-10: LGTM! Workflow correctly converted to reusable pattern.

The conversion to workflow_call and job renaming align with the orchestration model in main.yml.


69-87: The upload behavior is correct. When publish-clice.yml is called via workflow_call from main.yml, the event context is inherited as expected:

  • Tag-based releases (release-clice): triggered by push events with tags matching v*, so github.event_name == 'push' evaluates to true and uploads execute
  • PR-based checks (call-clice-check): triggered by pull_request events, so github.event_name == 'push' evaluates to false and uploads are correctly skipped

The condition is working as intended.

.github/workflows/test-xmake.yml (2)

3-4: LGTM! Workflow correctly converted to reusable pattern.

Consistent with the conversion pattern applied across other test workflows.


41-45: LGTM! Command simplification improves consistency.

The single-line Pixi commands align with the standardization effort across all workflows.

.github/workflows/deploy-docs.yml (1)

1-26: LGTM! Docs deployment workflow is well-structured.

The workflow correctly uses workflow_call for orchestration, sets up the Node.js environment via Pixi, and builds docs using the project's standardized task system.

.github/workflows/main.yml (2)

1-55: LGTM! Well-designed orchestration workflow.

The central orchestrator with path-based filtering is an excellent approach to conditionally dispatch reusable workflows, reducing redundant CI runs while maintaining comprehensive coverage.


88-96: LGTM! Release workflow dispatch is correctly configured.

Tag-based releases properly invoke both clice and vscode publish workflows with inherited secrets.

Comment thread .github/workflows/deploy-docs.yml
Comment thread .github/workflows/format.yml Outdated
Comment thread .github/workflows/main.yml Outdated
@16bit-ykiko 16bit-ykiko changed the title docs: update build docs build: optimize the workflow Dec 29, 2025
@16bit-ykiko
16bit-ykiko merged commit 7a29560 into main Dec 29, 2025
19 checks passed
@16bit-ykiko
16bit-ykiko deleted the update-docs branch December 29, 2025 01:22
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.

1 participant