ci: speed up GitHub Actions builds (~14m → ~3-5m warm)#136
Merged
Conversation
- Introduced a new `[profile.ci]` section in both root and Tauri Cargo.toml files to optimize build settings for continuous integration. - Adjusted compilation parameters to prioritize speed over runtime performance, including reduced optimization level and enabled code generation units.
- Modified the `build_agent_with` function calls in the agent tests to return a temporary directory alongside the agent instance, improving resource management during tests. - Ensured consistency in test setup across multiple test functions.
- Added 'workflow' and '.fastembed_cache' to the .gitignore file to prevent unnecessary files from being tracked in the repository.
Updated the `dispatch_routes_memory_doc_ingest` test to use `AssertUnwindSafe` and `catch_unwind` for better handling of potential panics during execution. This ensures that the test verifies route existence even if the handler encounters a panic, improving robustness against shared state issues in concurrent tests.
…file - Replace manual Cargo registry cache with Swatinem/rust-cache@v2 (caches target/ directories for both core and Tauri crates) - Add mozilla-actions/sccache for cross-branch compilation caching - Install mold linker on Linux for faster linking - Use --profile ci for sidecar build (opt-level 1, codegen-units 16) - Override release profile env vars for Tauri build with CI-tuned settings - Add --bundles none to CI build (skip unused deb/appimage packaging) - Restrict push triggers to main branch only (PRs already cover feature branches, preventing duplicate runs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The sccache-action sets RUSTC_WRAPPER globally for the job. cargo fmt invokes rustc through sccache which fails if the GHA cache service is unavailable. Clear RUSTC_WRAPPER for fmt steps and remove redundant per-step env overrides (the action already sets them job-wide). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Added Default implementations for ConnectionStatus, AgentBuilder, NativeRuntime, AutocompleteEngine, CliChannel, ActionTracker, SkillStatus, and ExtractionMode to streamline object initialization. - Simplified condition checks in several places by replacing map_or with is_some_and and is_none_or for better readability and performance. - Updated various instances of string handling in message sending to remove unnecessary conversions. This refactor enhances code clarity and consistency across the codebase.
- Removed unnecessary blank lines in several files to enhance code readability. - Simplified condition checks by consolidating method calls into single lines for better clarity. - Improved formatting in various functions to maintain consistency across the codebase.
Tauri CLI on this version doesn't support 'none' as a bundle type. Use 'deb' as the lightest single bundle to minimize packaging time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cker images - Introduced a Dockerfile to set up a CI environment with necessary dependencies for Tauri, Rust, Node.js, and sccache. - Created a new workflow to build and push the CI Docker image to GitHub Container Registry on main branch pushes. - Updated existing workflows to utilize the new Docker image for building and testing, enhancing consistency and efficiency in CI processes.
- Removed unnecessary permissions for packages in build, test, and typecheck workflows. - Updated container image references to use a specific digest instead of the latest tag for improved stability and reproducibility in CI processes.
Previous digest was from arm64 build (Mac). Rebuilt with --platform linux/amd64 for GitHub Actions runners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GHCR doesn't support pulling OCI index manifests by digest reliably. Use the rust-1.93.0 tag which is pinned to a specific Rust version and resolves correctly on amd64 CI runners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move from nested ghcr.io/tinyhumansai/openhuman/ci-runner to ghcr.io/tinyhumansai/openhuman_ci to avoid GHCR nested package manifest resolution issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sccache can't access the GHA cache API from inside a Docker container (missing ACTIONS_CACHE_URL/ACTIONS_RUNTIME_TOKEN). Swatinem/rust-cache already caches target/ which provides the main build speedup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Added a trigger for the installer smoke workflow to run on pushes to the main branch, enhancing CI coverage for mainline changes.
- Updated the Sentry DSN retrieval process to include an additional fallback option using `option_env!`, ensuring that the DSN can be sourced from both environment variables and optional configuration, improving robustness in observability setup.
- Included the OPENHUMAN_SENTRY_DSN variable in the release workflow configuration to enhance observability setup. - Updated the ci-secrets.example.json file to include a placeholder for OPENHUMAN_SENTRY_DSN, providing clarity for developers on required environment variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Swatinem/rust-cache@v2— cachestarget/directories for both core and Tauri crates, giving near-instant Rust steps on cache hitssccache(mozilla-actions/sccache-action) for cross-branch compilation unit cachingmoldlinker on Linux CI runners for faster linking (~5-10x vs defaultld)opt-level=1,codegen-units=16, no LTO (trades runtime perf for compile speed in CI)--bundles none) since artifacts aren't usedpushtriggers tomainonly; PRs already trigger onpull_request, so feature branch pushes no longer run checks twiceExpected impact
Files changed
.github/workflows/build.yml— rust-cache, sccache, mold, ci profile,--bundles none.github/workflows/test.yml— rust-cache, sccache, mold, ci profile for sidecar.github/workflows/typecheck.yml— rust-cache, sccache for clippy job, fix triggersCargo.toml—[profile.ci]section (already in prior commit)app/src-tauri/Cargo.toml—[profile.ci]section (already in prior commit).cargo/config.toml— mold linker for Linux (already in prior commit)app/src-tauri/.cargo/config.toml— mold linker for Linux (already in prior commit)Test plan
🤖 Generated with Claude Code