ci: point Swatinem/rust-cache at the real workspace root
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

Both workflows had `workspaces: src-tauri -> target`, which tells
rust-cache the workspace lives at src-tauri/ and its target dir is
src-tauri/target. Neither is true: the workspace is defined at the repo
root (Cargo.toml:1–3 — members = ["src-tauri", "crates/*"]), so cargo
walks up and puts artifacts at ./target, not ./src-tauri/target.

Result: the cache action was saving an empty (or wrong) directory on
every run. Every CI run on every OS effectively started from a cold
build, which is the actual reason the Windows job appeared to compile
sqlx from scratch every push — it was compiling sqlx from scratch every
push.

Point the cache at the real workspace root. While here, drop the
`working-directory: src-tauri` on the cargo check step so the command
runs from the workspace root too; cargo finds the same workspace either
way, but running from root is consistent with the cache's view.

Expected impact: Windows check job drops from ~15–25 min cold-every-time
to ~2–3 min on warm runs, matching Linux/macOS behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-21 15:42:12 +01:00
parent 26b41389b2
commit da74a84009
2 changed files with 9 additions and 3 deletions

View File

@@ -99,10 +99,12 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# Workspace is at the repo root; target dir is ./target (not
# src-tauri/target). See note in check.yml for details.
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
workspaces: .
shared-key: kon-build-${{ matrix.os }}
- name: Install JS deps