Skip to content

ci(kmp): add remote HTTP build cache and Konan toolchain caching#1016

Merged
thebentern merged 2 commits into
masterfrom
ci/kmp-build-cache
Jul 22, 2026
Merged

ci(kmp): add remote HTTP build cache and Konan toolchain caching#1016
thebentern merged 2 commits into
masterfrom
ci/kmp-build-cache

Conversation

@jamesarich

Copy link
Copy Markdown
Contributor

Summary

Adds Gradle build-cache reuse for the packages/kmp artifact, which compiles all 14 KMP targets (incl. native) on macOS in every KMP workflow.

What changed

  • packages/kmp/gradle/build-cache.settings.gradle (new): shared remote HTTP build cache, applied from packages/kmp/settings.gradle.kts, configured from GRADLE_CACHE_URL / GRADLE_CACHE_USERNAME / GRADLE_CACHE_PASSWORD (CI secrets; nothing hardcoded). Push only with credentials → fork PRs are pull-only and can't poison the cache.
  • ~/.konan caching (actions/cache@v6) added to kmp-pull-request.yml, snapshot-kmp.yml, and both jobs of publish-kmp.yml — keyed on build.gradle.kts + wrapper. Today every run re-downloads the Kotlin/Native toolchain from cold.
  • GRADLE_CACHE_* env wired into all three KMP workflows.

Required repo secrets (please add)

GRADLE_CACHE_URL, GRADLE_CACHE_USERNAME (meshtastic), GRADLE_CACHE_PASSWORD. Absent them, the remote cache disables itself (local + Konan cache still work) — CI never breaks.

Notes

actionlint clean on all three workflows. Only touches the KMP packaging/CI — no .proto or generated-code changes.

🤖 Generated with Claude Code

- Add packages/kmp/gradle/build-cache.settings.gradle (shared remote HTTP
  build cache), applied from packages/kmp/settings.gradle.kts and
  configured from the GRADLE_CACHE_URL / GRADLE_CACHE_USERNAME /
  GRADLE_CACHE_PASSWORD secrets. Push is enabled only when credentials are
  present, so fork PRs are pull-only and cannot poison the cache.
- Pass GRADLE_CACHE_* to the KMP CI, snapshot, and publish workflows.
- Cache ~/.konan across those workflows — each compiles all 14 KMP targets
  (including native) on macOS from a cold Konan today.

Part of the Meshtastic KMP library standard alignment (CI caching).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jamesarich, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a2308b8a-b81e-40e7-8d92-3a722e4a3fab

📥 Commits

Reviewing files that changed from the base of the PR and between b73e5ad and f92ce54.

📒 Files selected for processing (5)
  • .github/workflows/kmp-pull-request.yml
  • .github/workflows/publish-kmp.yml
  • .github/workflows/snapshot-kmp.yml
  • packages/kmp/gradle/build-cache.settings.gradle
  • packages/kmp/settings.gradle.kts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/kmp-build-cache

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.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow pull-request / build (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 21, 2026, 7:58 PM

Addresses CodeRabbit review of the shared build-cache script:
- Drop allowInsecureProtocol/allowUntrustedServer — the cache server presents
  a valid public TLS cert, so enforce HTTPS + certificate validation.
- Write to the cache only on trusted events (push/merge_group/local) with
  credentials present, so pull_request runs stay pull-only and cannot poison
  the cache.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jamesarich
jamesarich marked this pull request as ready for review July 21, 2026 20:38
@thebentern
thebentern merged commit 642aae4 into master Jul 22, 2026
4 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.

2 participants