Skip to content

ci: 限制 iOS 内容缓存快照,停止按 PR 提交重复保存 - #648

Merged
sunnylqm merged 2 commits into
masterfrom
ci/bound-ios-cache-snapshots-20260928
Sep 28, 2026
Merged

sunnylqm merged 2 commits into
masterfrom
ci/bound-ios-cache-snapshots-20260928

Conversation

@sunnylqm

@sunnylqm sunnylqm commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

改动

  • 仅调整 Homebrew 下载、ccache、Metro 三种可按内容校验的缓存。
  • PR 和 native leg 只读;成功的 master push / core leg 保存每日快照。key 包含 OS、架构、缓存类别与 Xcode 版本,不再每个源码 SHA 保存一份。
  • 统一封装为本仓库 composite action,并将其路径加入原 iOS PR / push 触发路径,修改缓存策略本身也必须验证。

保持不变

core/native 两个矩阵、全部原测试和 --retries 1、60 分钟上限、模拟器预启动、Bun/Pods/Detox framework 缓存均保持不变。原生 app 的完整输入键、无前缀回退约束、命中后的 JS bundle 刷新没有改变。失败诊断仍保留 7 天。

本次不拆分原生应用构建,也不增加巨型跨任务应用 artifact;需要冷/热缓存耗时对照后再决定。新的共享缓存第一次运行可能冷启动,日快照节省的是写入/存储重复,不承诺每次编译更快。旧缓存没有被删除。

验证

本地 composite YAML、日期 shell 语法、读写 cache key 一致与默认只读检查通过。完整 iOS E2E 由本 PR 运行验证;没有本地 macOS 构建结果,也不把 YAML 检查当作 E2E 通过。未合并或发版。


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Updated the iOS automated test workflow to reuse daily caches for build tools and dependencies, scoped to the platform and Xcode version.
    • Pull requests and pushes to the main branch now run when cache settings change. Cache updates are restricted to the core build leg, while other runs use existing cached data. These changes affect automated testing and do not alter app features or behavior.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 878cdb1b-2881-4f89-8420-4aae289beda5

📥 Commits

Reviewing files that changed from the base of the PR and between d599ec2 and fc562d6.

📒 Files selected for processing (2)
  • .github/actions/e2e-cache/action.yml
  • .github/workflows/e2e_ios.yml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The iOS E2E workflow now uses a shared composite action to manage daily Homebrew, ccache, and Metro caches. Cache writes are enabled only for the core matrix leg, and only on qualifying pushes to master.

Changes

iOS E2E cache

Layer / File(s) Summary
Define daily cache behavior
.github/actions/e2e-cache/action.yml
The composite action accepts a cache path and scope. It builds keys from the runner OS, architecture, scope, and UTC date. It saves caches only when writes are enabled for a push to master in the e2e-ios job; other runs restore only.
Wire caches into the iOS workflow
.github/workflows/e2e_ios.yml
The workflow triggers when the action changes. It uses the action for Homebrew, ccache, and Metro with Xcode-versioned scopes. The core matrix leg enables writes.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant E2EWorkflow as e2e_ios workflow
  participant CacheAction as e2e-cache action
  participant ActionsCache as GitHub Actions cache
  E2EWorkflow->>CacheAction: Pass path, scope, and write flag
  CacheAction->>ActionsCache: Restore using scoped daily key and prefix
  opt Push to master in e2e-ios with write enabled
    CacheAction->>ActionsCache: Save cache
  end
Loading

Merge Risk: ⚪ Minimal · up to fc562

The cache change appears mergeable after the normal iOS E2E checks; no specific failure requiring a pre-merge fix is established.

Architecture Summary

Architecture risk: 🔵 Low · up to fc562

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .github/actions/e2e-cache/action.yml: Adds the action metadata and declares required path and scope inputs plus write, which defaults to 'false'.
  • observed — Modified behavior in .github/actions/e2e-cache/action.yml: Adds a composite step that computes the cache date using UTC in YYYYMMDD format.
  • observed — Modified behavior in .github/actions/e2e-cache/action.yml: Adds cache handling keyed by runner OS, architecture, scope, and UTC day, with a scope-specific restore prefix. When write is true and the event is a push to refs/heads/master in job e2e-ios, it uses the cache action to restore and save; for all other cases, it uses the restore-only action.
  • observed — Modified behavior in .github/workflows/e2e_ios.yml: Adds changes to .github/actions/e2e-cache/** as a pull-request path trigger.
🚥 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 clearly summarizes the main change: limiting iOS cache snapshot writes and stopping duplicate per-PR saves.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@sunnylqm
sunnylqm merged commit 86de253 into master Sep 28, 2026
8 of 9 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.

1 participant