Skip to content

setup: expose zccache store path for consumer caches#154

Merged
zackees merged 1 commit intomainfrom
codex/issue-149-zccache-store-output
Apr 20, 2026
Merged

setup: expose zccache store path for consumer caches#154
zackees merged 1 commit intomainfrom
codex/issue-149-zccache-store-output

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 20, 2026

Summary

  • expose zccache-store-path from .github/actions/setup
  • export ZCCACHE_DIR alongside FBUILD_CACHE_DIR so downstream steps inherit the resolved store path
  • document the consumer-facing actions/cache@v4 pattern for caching zccache plus project build outputs, keyed with the setup action's fbuild-hash

Testing

  • git diff --check
  • verified the new zccache-store-path / ZCCACHE_DIR references across .github/actions/setup/action.yml, .github/actions/setup/README.md, and docs/CI_CACHING.md

Closes #149.

Summary by CodeRabbit

  • New Features

    • Added support for cross-run zccache store caching in GitHub Actions setup, with new zccache-store-path output and ZCCACHE_DIR environment variable.
  • Documentation

    • Updated CI caching guidance with zccache reuse instructions and example workflows.
    • Enhanced GitHub Actions setup documentation with caching examples and cache key recommendations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

The changes expose the zccache object-store directory location from the fbuild setup composite action as a step output and GitHub environment variable, enabling downstream workflows to cache it across runs. Documentation is updated to show the canonical cache block and key recommendations incorporating zccache alongside .fbuild cache.

Changes

Cohort / File(s) Summary
GitHub Actions setup
.github/actions/setup/action.yml, .github/actions/setup/README.md
Added zccache-store-path output and ZCCACHE_DIR environment export to the setup action. README updated with new "Caching the zccache store" section showing actions/cache@v4 example with cache key format. Minor punctuation/wording adjustments (e.g., to >=, dash normalization).
CI caching documentation
docs/CI_CACHING.md
Expanded caching guidance to include cross-run zccache reuse via the new action output. Updated worked example workflow to cache zccache store alongside .fbuild using multi-key cache strategy. Extended cache contents table with $ZCCACHE_DIR entry. Normalized dash punctuation throughout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 A warren of caches, now properly named,
Where zccache's treasure no longer stays tamed—
The path hops to light, through GITHUB_ENV's door,
Cross-run reuse blooms; we compile no more!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exposing zccache store path from the setup action for consumer caching workflows.
Linked Issues check ✅ Passed All requirements from issue #149 are met: zccache-store-path output exposed, ZCCACHE_DIR exported, and canonical cache documentation added.
Out of Scope Changes check ✅ Passed All changes directly address issue #149 objectives; no extraneous modifications detected outside the documented scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-149-zccache-store-output

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.

🧹 Nitpick comments (1)
.github/actions/setup/action.yml (1)

67-74: Add a zccache-dir input and respect pre-existing ZCCACHE_DIR values.

The action unconditionally overwrites ZCCACHE_DIR without providing an input override or respecting any pre-existing value set by the caller at the workflow/job level. This differs from the cache-dir input pattern and silently surprises users who have already configured ZCCACHE_DIR via env:.

For consistency and to avoid surprising overrides, add a zccache-dir input and check for pre-existing ZCCACHE_DIR values:

Suggested change
         if [ -n "${{ inputs.cache-dir }}" ]; then
           CACHE_DIR="${{ inputs.cache-dir }}"
         else
           CACHE_DIR="${RUNNER_TEMP}/fbuild-cache"
         fi
-        ZCCACHE_DIR="${RUNNER_TEMP}/zccache"
+        if [ -n "${{ inputs.zccache-dir }}" ]; then
+          ZCCACHE_DIR="${{ inputs.zccache-dir }}"
+        elif [ -n "${ZCCACHE_DIR:-}" ]; then
+          : # honor caller-provided value
+        else
+          ZCCACHE_DIR="${RUNNER_TEMP}/zccache"
+        fi
         mkdir -p "$CACHE_DIR" "$ZCCACHE_DIR"

Plus add a matching zccache-dir entry under inputs:.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/actions/setup/action.yml around lines 67 - 74, Add a new action
input "zccache-dir" and update the setup logic to respect an existing
ZCCACHE_DIR environment value or the new input instead of always overwriting it:
if ZCCACHE_DIR is already set in the environment keep it, otherwise use the
provided input "zccache-dir" (falling back to "${RUNNER_TEMP}/zccache" when
neither is set), ensure mkdir -p uses the resolved ZCCACHE_DIR, and continue
exporting the resolved value via the existing echo "ZCCACHE_DIR=..." >>
"$GITHUB_ENV" and echo "zccache-store-path=..." >> "$GITHUB_OUTPUT" lines so
callers can override via env: or input.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/actions/setup/action.yml:
- Around line 67-74: Add a new action input "zccache-dir" and update the setup
logic to respect an existing ZCCACHE_DIR environment value or the new input
instead of always overwriting it: if ZCCACHE_DIR is already set in the
environment keep it, otherwise use the provided input "zccache-dir" (falling
back to "${RUNNER_TEMP}/zccache" when neither is set), ensure mkdir -p uses the
resolved ZCCACHE_DIR, and continue exporting the resolved value via the existing
echo "ZCCACHE_DIR=..." >> "$GITHUB_ENV" and echo "zccache-store-path=..." >>
"$GITHUB_OUTPUT" lines so callers can override via env: or input.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f04347dc-1d75-47a3-893a-5139a6a746d7

📥 Commits

Reviewing files that changed from the base of the PR and between fdfed75 and 304c219.

📒 Files selected for processing (3)
  • .github/actions/setup/README.md
  • .github/actions/setup/action.yml
  • docs/CI_CACHING.md

@zackees zackees merged commit bcb4aca into main Apr 20, 2026
77 checks passed
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.

daemon/setup: expose zccache store location so consumer workflows can actions/cache it

1 participant