Skip to content

ci: 测量 Gradle 缓存对安卓构建的效果(草稿,不合并) - #249

Closed
sunerpy wants to merge 2 commits into
mainfrom
ci/measure-gradle-cache
Closed

sunerpy wants to merge 2 commits into
mainfrom
ci/measure-gradle-cache

Conversation

@sunerpy

@sunerpy sunerpy commented Nov 10, 2026

Copy link
Copy Markdown
Owner

只用来测量,不合并。

安卓构建(android-arm64 · release build + package checks)每次都从头下载 Gradle 的依赖、从头编译:最近的 PR CI 里这个 job 要 15–16 分钟,其中 Gradle 构建 7 分多钟。这个 PR 在 Gradle 发行包那一步之前加上 gradle/actions/setup-gradle(v6.4.1,cache-provider: basic,在这个 PR 上也写缓存),跑两次(第二次是空提交):

  • 第一次:没有缓存,记下构建时间和写出的缓存大小;
  • 第二次:读第一次的缓存,记下构建时间。

测完删除这个 PR 写的缓存(gh cache delete --all --ref refs/pull/<n>/merge),关闭 PR、删掉分支。结果写进评论。

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #249   +/-   ##
=======================================
  Coverage   93.56%   93.57%           
=======================================
  Files         489      489           
  Lines       85860    85860           
  Branches     4909     4909           
=======================================
+ Hits        80338    80344    +6     
+ Misses       4853     4847    -6     
  Partials      669      669           
Flag Coverage Δ
rust 93.81% <ø> (+<0.01%) ⬆️
web 92.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy

sunerpy commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

测量结果

android-arm64 · release build + package checks,同一个分支的两次运行:

Gradle 自身(BUILD SUCCESSFUL in) 构建步骤 整个 job
第一次,没有缓存(run 42799051186) 10m 30s 858 秒 16.8 分钟
第二次,读第一次的缓存(run 42801712145) 5m 54s 507 秒 10.6 分钟
参考:最近 6 次没有这个缓存的运行 6m 35s – 10m 48s,中位数约 10m 7s 10.4 – 20.5 分钟,中位数约 16 分钟
  • 两次都是 470 个任务全部执行,省下的是依赖下载和 Gradle 用户目录里的转换结果,不是构建缓存。
  • 缓存 1339 MB(setup-java-Linux-x64-gradle-…),恢复用了约 40 秒。
  • 仓库的 Actions 缓存在这次写入后到了 11.05 GB,超过 10 GB 上限;要长期用,需要给它腾出位置。

测完删除这个 PR 的缓存,关闭 PR,不合并。

@sunerpy sunerpy closed this Nov 10, 2026
@sunerpy
sunerpy deleted the ci/measure-gradle-cache branch November 10, 2026 10:59
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