Skip to content

document incremental build cache in builder docs#522

Open
js-9 wants to merge 5 commits into
game-ci:mainfrom
js-9:patch-1
Open

document incremental build cache in builder docs#522
js-9 wants to merge 5 commits into
game-ci:mainfrom
js-9:patch-1

Conversation

@js-9
Copy link
Copy Markdown

@js-9 js-9 commented Oct 21, 2025

Changes

  • document how to save the incremental build cache for additional build time speedup

Checklist

  • Read the contribution guide and accept the
    code of conduct
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

Summary by CodeRabbit

  • Documentation
    • Added two caching subsections: "Library cache" and "Incremental build cache".
    • Included sample workflow snippets and practical guidance for caching the Library directory and the incremental build cache.
    • Noted Windows path differences and that the incremental cache is saved alongside the Library folder.

@github-actions
Copy link
Copy Markdown

Cat Gif

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 21, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds documentation describing caching of Unity's Library folder and the incremental build cache in GitHub Actions workflows, with example actions/cache YAML snippets, a note about Windows runner path differences, and clarification that incremental cache is saved alongside Library.

Changes

GitHub docs: Unity build caching

Layer / File(s) Summary
Content: Library cache
docs/03-github/04-builder.mdx
Introduces a "Library cache" subsection and explains caching Unity's Library directory with actions/cache.
Example: Library cache YAML
docs/03-github/04-builder.mdx
Adds an actions/cache example showing path, key, and restore-keys for the Library folder.
Content: Incremental build cache
docs/03-github/04-builder.mdx
Adds "Incremental build cache" subsection describing caching the incremental build cache directory and noting it is saved alongside Library.
Example: Incremental cache YAML
docs/03-github/04-builder.mdx
Adds an actions/cache example for the incremental cache with key/restore-keys.
Supplementary note: Test-runner doc
docs/03-github/03-test-runner.mdx
Adds an "Incremental build cache" subsection mirroring guidance and the Windows path note; clarifies incremental cache location relative to Library.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped into docs to hide a stash,
Library bits snug in a YAML cache,
Incremental crumbs beside the tree,
Windows paths whispered — look and see,
Builders wake, the builds run fast — hop with me! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding documentation about incremental build cache in builder docs, which aligns with the changeset.
Description check ✅ Passed The description follows the template structure with a Changes section and completed Checklist. All required sections are present and appropriately filled out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/03-github/04-builder.mdx (2)

113-113: Consider condensing "In order to" for better readability.

Replace "In order to make builds run faster, you can cache Library files from previous builds. To do so simply add Github Actions official" with "To make builds run faster, you can cache Library files from previous builds. Simply add Github Actions official" for more concise phrasing.

-In order to make builds run faster, you can cache Library files from previous builds. To do so
-simply add Github Actions official [cache action](https://github.com/marketplace/actions/cache)
-before any unity steps.
+To make builds run faster, you can cache Library files from previous builds. Simply add Github Actions official [cache action](https://github.com/marketplace/actions/cache)
+before any unity steps.

131-146: Documentation addition looks good, but consider expanding Windows guidance.

The new incremental build cache documentation is well-structured and includes helpful notes. However, line 146 mentions that "on Windows runners the path is different" but doesn't show an example or clarification of what that path would be. Consider adding a brief note or example for Windows users to avoid confusion.

For example, you might add a small note like:

+On Windows runners (e.g., il2cpp builds), the bee cache path differs but is still saved alongside the Library folder. Consider using a platform-agnostic pattern or absolute paths that work across runners.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e49e41 and c0ffa39.

📒 Files selected for processing (1)
  • docs/03-github/04-builder.mdx (2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/03-github/04-builder.mdx

[style] ~112-~112: Consider a more concise word here.
Context: ...ons tab. ## Caching ### Library cache In order to make builds run faster, you can cache L...

(IN_ORDER_TO_PREMIUM)

Comment thread docs/03-github/04-builder.mdx Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
docs/03-github/04-builder.mdx (1)

137-144: Verify the cache path syntax for GitHub Actions compatibility.

The cache path at line 139 uses ~/work/_temp/_github_home/.cache/unity3d/bee, which relies on shell tilde expansion. GitHub Actions cache@v3 may not reliably expand ~ in the path field since the cache action does not execute within a shell context. Previous review flagged this concern with $HOME syntax; tilde (~) has the same limitation.

For maximum compatibility, consider using a workspace-relative path or GitHub Actions environment variables. You may want to verify this path works consistently across all runner types and document any caveats.

Please confirm whether ~/work/_temp/_github_home/.cache/unity3d/bee is reliably resolved by actions/cache@v3 on all runner types, or provide the equivalent GitHub Actions expression syntax (e.g., ${{ env.HOME }}/work/_temp/_github_home/.cache/unity3d/bee).

🧹 Nitpick comments (1)
docs/03-github/04-builder.mdx (1)

113-113: Minor style improvement: use "To" instead of "In order to".

The phrase "In order to make builds run faster" can be more concise as "To make builds run faster".

Apply this diff:

- In order to make builds run faster, you can cache Library files from previous builds. To do so
- simply add Github Actions official [cache action](https://github.marketplace/actions/cache)
+ To make builds run faster, you can cache Library files from previous builds. To do so
+ simply add Github Actions official [cache action](https://github.marketplace/actions/cache)

Based on static analysis hint from LanguageTool.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0ffa39 and 8b2a548.

📒 Files selected for processing (1)
  • docs/03-github/04-builder.mdx (2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/03-github/04-builder.mdx

[style] ~112-~112: Consider a more concise word here.
Context: ...ons tab. ## Caching ### Library cache In order to make builds run faster, you can cache L...

(IN_ORDER_TO_PREMIUM)

🔇 Additional comments (1)
docs/03-github/04-builder.mdx (1)

146-146: Clarify the Windows incremental cache path.

Line 146 states "on a windows runner... this path is different, but the incremental build cache is automatically saved with the Library folder" but provides no explicit alternative path for Windows users. This leaves Windows developers uncertain about where to find or cache the incremental build artifacts.

Please provide:

  1. The actual incremental cache path on Windows runners (e.g., something like ~\AppData\Local\Temp\... or similar).
  2. Clarification on whether Windows users should cache the same path directive or if a conditional/platform-specific approach is needed.

Alternatively, if the Windows path is identical to the Linux path (just different file separators), make that explicit.

@davidmfinol davidmfinol requested a review from Copilot October 21, 2025 20:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR documents how to use incremental build caching in Unity Builder to improve build performance beyond the basic library cache. It adds guidance on configuring the incremental build cache, including platform-specific considerations for Windows runners.

  • Splits the existing caching section into two subsections: Library cache and Incremental build cache
  • Adds example configuration for caching the incremental build cache directory on non-Windows runners
  • Documents that Windows runners automatically cache incremental builds with the Library folder

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread docs/03-github/04-builder.mdx Outdated
Comment thread docs/03-github/04-builder.mdx Outdated
@davidmfinol davidmfinol self-requested a review October 21, 2025 20:37
@davidmfinol davidmfinol enabled auto-merge (squash) October 27, 2025 12:47
Copy link
Copy Markdown
Member

@davidmfinol davidmfinol left a comment

Choose a reason for hiding this comment

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

@js-9 Can you run prettier to fix the formatting? The Copilot suggestions are also valid, I think. We should be able to merge once you've updated.

auto-merge was automatically disabled December 6, 2025 07:50

Head branch was pushed to by a user without write access

@js-9
Copy link
Copy Markdown
Author

js-9 commented Dec 6, 2025

@js-9 Can you run prettier to fix the formatting? The Copilot suggestions are also valid, I think. We should be able to merge once you've updated.

Oh wow! Sorry man, I totally missed your reply. Updated with change from game-ci/unity-test-runner#300 as well, and prettier run.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
docs/03-github/04-builder.mdx (1)

148-148: Capitalize "IL2CPP" for technical consistency.

Line 148 should use "IL2CPP" (all caps) to match Unity's official naming convention and be consistent with how it appears elsewhere in technical documentation.

-On a Windows runner (e.g. if building for il2cpp) this path is different, but the incremental build
+On a Windows runner (e.g. if building for IL2CPP) this path is different, but the incremental build
🧹 Nitpick comments (1)
docs/03-github/04-builder.mdx (1)

114-116: Simplify verbose phrasing.

"In order to" can be shortened to "To" for more concise documentation.

-In order to make builds run faster, you can cache Library files from previous builds. To do so
-simply add Github Actions official [cache action](https://github.com/marketplace/actions/cache)
+To make builds run faster, you can cache Library files from previous builds. Simply add Github Actions official [cache action](https://github.com/marketplace/actions/cache)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2a548 and 3a0e9f5.

📒 Files selected for processing (2)
  • docs/03-github/03-test-runner.mdx (1 hunks)
  • docs/03-github/04-builder.mdx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/03-github/03-test-runner.mdx
🧰 Additional context used
🪛 LanguageTool
docs/03-github/04-builder.mdx

[style] ~113-~113: Consider a more concise word here.
Context: ...ns tab. ## Caching ### Library cache In order to make builds run faster, you can cache L...

(IN_ORDER_TO_PREMIUM)

🔇 Additional comments (1)
docs/03-github/04-builder.mdx (1)

141-141: No changes needed — tilde expansion is officially supported and tested in GitHub Actions.

The path ~/work/_temp/_github_home/.cache/unity3d/bee is correct. GitHub Actions actions/cache@v3 officially documents and supports tilde (~) expansion to the runner HOME directory across all runner types (Ubuntu, Windows, macOS). The v3 release notes include fixes for ~/ path handling on ubuntu-latest, confirming it has been tested and is reliable. Using tilde is the recommended approach; explicit ${{ env.HOME }} expansion is unnecessary.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
docs/03-github/04-builder.mdx (2)

113-114: Simplify "In order to" for conciseness.

Shorten "In order to make builds run faster" to "To make builds run faster" for a more direct, concise opening.

-In order to make builds run faster, you can cache Library files from previous builds. To do so
+To make builds run faster, you can cache Library files from previous builds. To do so

134-134: Use "consecutive" or "subsequent" instead of "consequent" for clarity.

The phrase "consequent builds" is technically valid but unconventional for this context. "Consecutive builds" or "subsequent builds" would be clearer and more idiomatic when referring to builds that follow one another.

-To further speed up consequent builds, you may want to cache the incremental build cache directory.
+To further speed up consecutive builds, you may want to cache the incremental build cache directory.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a0e9f5 and 9accdde.

📒 Files selected for processing (2)
  • docs/03-github/03-test-runner.mdx (1 hunks)
  • docs/03-github/04-builder.mdx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/03-github/03-test-runner.mdx
🧰 Additional context used
🪛 LanguageTool
docs/03-github/04-builder.mdx

[style] ~113-~113: Consider a more concise word here.
Context: ...ns tab. ## Caching ### Library cache In order to make builds run faster, you can cache L...

(IN_ORDER_TO_PREMIUM)

🔇 Additional comments (1)
docs/03-github/04-builder.mdx (1)

141-141: Cache path syntax is correct.

The use of the tilde (~) in the cache path is appropriate and correctly resolves the previous critical issue about shell variable expansion in GitHub Actions. The path will be properly expanded by the cache action.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@docs/03-github/04-builder.mdx`:
- Line 134: Replace the awkward word "consequent" in the sentence "To further
speed up consequent builds, you may want to cache the incremental build cache
directory." with "subsequent" (or "consecutive") so it reads "To further speed
up subsequent builds, you may want to cache the incremental build cache
directory."; update the single sentence in docs/03-github/04-builder.mdx where
the phrase "consequent builds" appears.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb5b24e5-eb67-4088-9ac4-5cecda21f379

📥 Commits

Reviewing files that changed from the base of the PR and between 9accdde and 2589931.

📒 Files selected for processing (1)
  • docs/03-github/04-builder.mdx


### Incremental build cache

To further speed up consequent builds, you may want to cache the incremental build cache directory.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use “subsequent” (or “consecutive”) instead of “consequent”.

Line 134 reads awkwardly in user-facing docs; a quick wording fix would improve clarity.

🤖 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 `@docs/03-github/04-builder.mdx` at line 134, Replace the awkward word
"consequent" in the sentence "To further speed up consequent builds, you may
want to cache the incremental build cache directory." with "subsequent" (or
"consecutive") so it reads "To further speed up subsequent builds, you may want
to cache the incremental build cache directory."; update the single sentence in
docs/03-github/04-builder.mdx where the phrase "consequent builds" appears.

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.

5 participants