mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-10-19 17:43:26 +00:00
## Summary The repository's Actions caches reached 9.57 GB of GitHub's 10 GB quota, and the Rust caches had roughly doubled in ten days. When `Cargo.lock` changes, rust-cache restores the previous entry as a fallback, cargo builds the new dependency versions beside the old ones, and the save keeps both, because its cleanup matches artifacts by crate name only. Every dependency update stacked another generation onto every platform's cache. This change puts a hash of the Rust dependency set into each rust-cache `key`. The key is part of rust-cache's restore prefix, so a dependency change has nothing to fall back to: it builds cold once per platform, and each saved entry holds a single generation. It also stops caching Gradle, whose 843 MB entry only saved dependency downloads. ## Changes - **`scripts/ci/cargo-deps-hash.js`** prints the first 16 hex characters of a SHA-256 over `Cargo.lock`'s registry and git packages (dropping the `aventura` workspace crate) and `src-tauri/Cargo.toml` without its `[package]` version line. A release version bump leaves it unchanged; a dependency version, feature or profile change does not. - **`.github/actions/rust-cache`** (new composite action) runs the script and calls `swatinem/rust-cache@v2` with `key: <key>-<hash>`, `workspaces: '<working-directory>/src-tauri -> target'` and `save-if` on `master` only. If the script fails, the step fails rather than saving under a key without the hash. Inputs: `key`, `working-directory` (default `.`) and `cache-directories`. - **Every rust-cache step uses the action:** `build-desktop.yml` (`<target>-<hash>`, with the Dev Drive path as `working-directory`), `build-android.yml` (`android-v2-<hash>`, still persisting the generated Kotlin), `build-ios.yml` (`ios-<hash>`) and `rust-lint.yml`'s Clippy job (`clippy-<hash>`). `rust-lint.yml` also runs when the script or the action changes. - **Gradle is not cached.** `setup-gradle` keeps `cache-provider: basic` and adds `cache-disabled: true`, so it still validates the wrapper and writes the job summary. - **`docs/development/ci-caching.md`** (new) records what each cache holds and why it is configured that way: the diagnostic runs, how rust-cache keys, restores and prunes, the options weighed against the dependency hash, the Gradle provider comparison, and the decision to keep `armv7`. `release.md` keeps the rules and links there, and its generated-Kotlin explanation moves there. `ci.yml`'s comments, `ios-build-target.md` and `docs/README.md` are updated to match. ### Effect - The first `master` run after this merges, and the first after any later dependency, feature or profile change, builds every Rust cache cold. A PR that makes such a change also builds cold. - Release runs keep hitting: the version bump changes neither this hash nor rust-cache's own lock hash. - The existing, oversized entries stay until GitHub evicts them as least recently used. Deleting them by hand (`gh cache list --key v0-rust-`, then `gh cache delete <id>`) frees the space right away. - Android runs download the Gradle distribution and dependencies each time. ## Testing - New unit tests for `cargoDepsHash`: unchanged by an app version bump and by CRLF line endings, changed by a registry package version and by a dependency feature. - `node scripts/ci/cargo-deps-hash.js` on this branch prints `8cdb41fe24f6ce46`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01AhkosChqt73QngC3UqQB9C <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Android, desktop, iOS, and Rust lint workflows now use shared Rust caching that reflects dependency changes. * Android builds no longer cache Gradle data. * CI workflow descriptions now reflect the updated cache behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ci | ||
| android-setup.sh | ||
| build-ios-unsigned.sh | ||
| check_migrations.js | ||
| check_wry_injection.js | ||
| fake-provider.mjs | ||
| package-manager.js | ||
| package-manager.test.js | ||
| pm.js | ||
| release.js | ||
| remote.js | ||
| remote.test.js | ||
| sync-ios-icons.sh | ||
| version.js | ||
| version.test.js | ||