Skip to content

ci: preserve Swift SDK Rust build cache#3632

Open
vivekgsharma wants to merge 1 commit into
v3.1-devfrom
ci/preserve-swift-sdk-rust-cache
Open

ci: preserve Swift SDK Rust build cache#3632
vivekgsharma wants to merge 1 commit into
v3.1-devfrom
ci/preserve-swift-sdk-rust-cache

Conversation

@vivekgsharma
Copy link
Copy Markdown
Collaborator

@vivekgsharma vivekgsharma commented May 12, 2026

Summary

  • preserve the Rust target/ directory during the Swift SDK workspace cleanup so Apple target artifacts can be reused on self-hosted runners
  • switch the cargo registry/git cache step to restore-only with a broad restore key to avoid the long post-job cache save

Validation

  • git diff --check -- .github/workflows/swift-sdk-build.yml
  • python3 -c 'import pathlib, yaml; yaml.safe_load(pathlib.Path(".github/workflows/swift-sdk-build.yml").read_text()); print("yaml ok")'

Summary by CodeRabbit

  • Chores
    • Updated build workflow configuration to improve checkout and cache handling for the Swift SDK build process.

Review Change Stack

@github-actions github-actions Bot added this to the v3.1.0 milestone May 12, 2026
@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented May 12, 2026

Review Gate

Commit: a711ba29

  • Debounce: 3483m ago (need 30m)

  • CI checks: build failure: PR title, PR title

  • CodeRabbit review: comment found

  • Off-peak hours: off-peak (12:51 PM PT Thursday)

  • Run review now (check to override)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

The Swift SDK build workflow changes optimize caching and cleanup: the checkout step now avoids full cleaning, replaced by explicit git reset and git clean that preserve Rust target/ directories. Cargo caching switches from full cache behavior to restore-only restoration of registry and Git caches using restore-keys.

Changes

Build Workflow Cache and Cleanup Optimization

Layer / File(s) Summary
Git checkout and selective cleanup
.github/workflows/swift-sdk-build.yml
Checkout sets clean: false, and a new cleanup step runs git reset --hard HEAD followed by git clean -ffdx, explicitly excluding target/ and target/** directories to preserve Rust build cache.
Cargo registry cache restoration
.github/workflows/swift-sdk-build.yml
Cargo caching switches from actions/cache@v5 to actions/cache/restore@v5, restoring ~/.cargo/registry and ~/.cargo/git with cargo-registry- restore-key prefix instead of full cache behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit hops through GitHub Actions with glee,
Selective cleanup preserves the Rust build tree,
Cargo caches restored, no more wasted time,
Faster builds ahead—the workflow's sublime! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check ✅ Passed The title 'ci: preserve Swift SDK Rust build cache' accurately and specifically describes the main change: modifying CI workflow to preserve Rust build artifacts during cleanup.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/preserve-swift-sdk-rust-cache

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@vivekgsharma vivekgsharma changed the title Preserve Swift SDK Rust build cache ci: preserve Swift SDK Rust build cache May 12, 2026
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