Skip to content

Cache Rust builds in CI - #222

Merged
huacnlee merged 1 commit into
mainfrom
ci/rust-cache
Sep 15, 2026
Merged

huacnlee merged 1 commit into
mainfrom
ci/rust-cache

Conversation

@huacnlee

Copy link
Copy Markdown
Owner

Every CI job compiled the whole dependency tree from scratch on every run, and the standalone app jobs did it twice (test profile, then release). The macOS job alone spent 15 minutes in "Build and test the standalone host".

Adds Swatinem/rust-cache (pinned) after the toolchain step in every job that runs cargo across ci.yml and native-credentials.yml. The cache is keyed by job and Cargo.lock, so each job keeps its own compiled dependencies and only this crate is rebuilt on later runs. The first run after merge populates the caches; the gain shows from the second.

The release workflow is untouched: a published binary is built clean.

🤖 Generated with Claude Code

No CI job kept anything between runs, so every one compiled the whole
dependency tree from scratch, and the standalone app jobs did it twice,
once for the test profile and once for release. The macOS job spent
fifteen minutes in that step. rust-cache keeps the registry and the
compiled dependencies keyed by job and lockfile; only this crate is
rebuilt on the next run. The release workflow stays as it is: a
published binary is built clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
huacnlee added a commit that referenced this pull request Sep 15, 2026
The macOS CI job spent 615 seconds in the lib test suite that takes 35
seconds locally. The job log shows the time in
`backend::mail::action_tests` and the other synthetic-peer tests, in
gaps of 12, 24, 36… seconds: one 10-second `connect_timeout` per new
connection.

The peers listen on `127.0.0.1` with a certificate for `localhost`, and
the tests connect by name. On the runner the IPv6 loopback address is
answered first and the connection attempt on it is left to time out
before IPv4 is tried.

A `#[cfg(test)]` helper pins `localhost` to `127.0.0.1` on every test
client (`resolve()`, so the certificate is still verified against the
name), applied in the JMAP and Gmail `client_builder()`s and the two
ad-hoc report clients. No production code path changes.

Expected effect: the macOS standalone app job drops from ~19 minutes to
under ten. Together with #222 (dependency caching) the remaining time is
the release build and Qt.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@huacnlee
huacnlee merged commit 15a5e7f into main Sep 15, 2026
14 checks passed
@huacnlee
huacnlee deleted the ci/rust-cache branch September 15, 2026 11:30
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