Skip to content

perf(ci): speed up PR CI wall clock and local dev builds#1028

Draft
wpfleger96 wants to merge 1 commit into
mainfrom
worktree-wpfleger+ci-build-times
Draft

perf(ci): speed up PR CI wall clock and local dev builds#1028
wpfleger96 wants to merge 1 commit into
mainfrom
worktree-wpfleger+ci-build-times

Conversation

@wpfleger96

Copy link
Copy Markdown
Collaborator

Summary

Measured baseline: PR CI ~10 min wall clock, release.yml ~25 min wall clock.

CI — critical path & compute

  • profile.ci opt-level 1 for workspace crates (Cargo.toml): deps keep opt-level = 3 via [profile.ci.package."*"] so the main-seeded dep cache stays byte-identical. The relay build should drop from ~4m38s → ~2m15–2m45s. opt-level 1 keeps debug-assertions off (release inherit) so the e2e timing stability from #307 is preserved.

  • mold linker (rui314/setup-mold@v1) on three Linux link jobs: unit-tests, desktop-core, desktop-e2e-relay. Not added to clippy (check-mode, no link), cross-compile (links inside the cross container), or macOS (ld64 beats mold on Apple Silicon).

  • Concurrency group on ci.yml: superseded PR pushes cancel in-flight runs. Mirrors the existing group already on docker.yml. Never cancels main/release pushes so cache seeding is unaffected.

  • cross check on PRs, cross build on main (server-cross-compile): catches compile/build-script/proc-macro errors on PRs; link-only musl errors surface on the main push. Saves ~5+ runner-min per Rust PR and removes the future wall-clock cap.

CI — smaller wins

  • Flutter pin + cache (mobile job): flutter-version: 3.41.7 matches the hermit pin. Eliminates floating-stable drift against local dev and adds cache: true.

Local dev

  • .cargo/config.toml (new): debug = "line-tables-only" for [profile.dev]. Full file/line backtraces, no per-variable debug info — ~20–30% faster local builds and much faster link on macOS. Applies to both the root workspace and desktop/src-tauri via cargo config discovery (cargo walks up from cwd; workspace exclusion does not affect config files). Also shrinks CI test binaries since the test profile inherits dev, superseding the CARGO_PROFILE_TEST_DEBUG=0 approach. If you need lldb variable inspection: CARGO_PROFILE_DEV_DEBUG=2 cargo build ….

  • .vscode/settings.json (new): rust-analyzer.cargo.targetDir: true sends RA's cargo check to target/rust-analyzer/ so it no longer invalidates the cargo build artifact cache. Cursor reads .vscode/ too. Updated .gitignore to track this file.

  • Remove clippy from lefthook pre-push: both rust-clippy and desktop-tauri-clippy duplicated the CI rust-lint job and cost 2–4 min per push. CI still gates merges. Fast tests stay in pre-push.

Release — parallel platform builds

  • New create-release job in release.yml (~30s): derives and validates the version, creates the versioned GitHub release (no assets), and ensures buzz-desktop-latest exists. All four platform jobs (release, release-macos-x64, release-linux, release-windows) now depend only on create-release and run in parallel. Previously they all serialized behind the full ~12-min arm64 build + notarization via needs: release. Expected: ~25 min → ~13–15 min.

Verification

For the profile.ci change specifically: re-run the integration shards a few times to confirm no e2e flakiness at opt-level 1. If Playwright timeouts reappear, bump [profile.ci] to opt-level = 2 — still ~25–35% faster than 3 and well above the opt-0 threshold that triggered #307.

For the release parallelization: test with a -test prerelease tag (routes to --prerelease --latest=false via the version regex) to confirm all four platform jobs start within ~1 min of each other.

PR CI critical path: ~10m → ~8m target, release.yml: ~25m → ~13-15m.

- Reduce `profile.ci` workspace opt-level to 1 (deps keep opt-level 3 via
  package."*" override so main-seeded dep caches stay valid). The 4m38s relay
  build should drop to ~2m15-2m45s. opt-1 keeps debug-assertions off (release
  inherit) so the PR #307 e2e flakiness fix holds.
- Add rui314/setup-mold to unit-tests, desktop-core, and desktop-e2e-relay
  (Linux link jobs only; not clippy/macOS/cross).
- Add concurrency group to ci.yml so superseded PR pushes cancel in-flight runs.
- Switch server-cross-compile to `cross check` on PRs, `cross build` on main.
  Catches compile/build-script errors on PRs; link-only errors surface on the
  main push which keeps full builds.
- Pin mobile job to flutter-version 3.41.7 (matches hermit) and enable caching.
- Add .cargo/config.toml with debug="line-tables-only" for local dev; applies
  to both the root and desktop/src-tauri workspaces via cargo config discovery.
- Add .vscode/settings.json with rust-analyzer.cargo.targetDir=true so RA
  checks land in target/rust-analyzer/ and stop invalidating cargo build cache.
- Remove rust-clippy and desktop-tauri-clippy from lefthook pre-push; CI
  rust-lint still gates merges. Saves 2-4m per push locally.
- Parallelize release.yml: new create-release job (~30s) derives version,
  creates the GitHub release, and ensures buzz-desktop-latest exists. All four
  platform build jobs now depend only on create-release and run in parallel
  instead of serializing behind the full ~12m arm64 build.
@wpfleger96 wpfleger96 marked this pull request as draft June 13, 2026 08:49
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