Compare commits

...

2 Commits

Author SHA1 Message Date
Psychotoxical dcb975adfd fix(audio): silence the windows-only clippy lints, and run clippy there
Three lints only exist on a Windows build, so the ubuntu clippy job never
reported them:

- Two `needless_return`s in psysonic-audio, where the early return is what
  separates the two cfg branches. Stripping the Linux branch leaves a lone
  block, which is what clippy reads as redundant — allowed with a note
  rather than restructured, since the Linux side cannot be compiled here.
- `child_process_memory_label` was gated on `any(test, linux, macos)` while
  its only test is gated on `any(linux, macos)`, so a Windows test build
  defined it with no caller at all. Gating both the same way settles it.

With those out of the way, clippy can run on windows-latest as well.
2026-07-27 15:37:23 +02:00
Psychotoxical af96a2301a ci(rust): run the workspace tests on windows too
Windows is the second platform the app ships on, and parts of the backend
only exist there: SQLite locking behaviour differs, and the
`cfg(not(target_os = "linux"))` branches never compile on an ubuntu runner.
A sync-capability test that fails only on Windows sat red on main for a week
because nothing in CI could see it.

Adds a second cargo test job rather than turning the existing one into a
matrix, so the job name stays stable — `cargo test --workspace` is the name
branch protection and the promote workflows already know.
2026-07-27 15:29:57 +02:00
4 changed files with 47 additions and 1 deletions
+35
View File
@@ -36,6 +36,24 @@ jobs:
working-directory: src-tauri
run: cargo test --workspace --all-targets
# Windows is the second platform the app ships on, and parts of the backend
# are cfg-gated to it — SQLite locking behaviour, path handling, and the
# `cfg(not(target_os = "linux"))` branches never compile on the ubuntu jobs
# above. A test that only fails there used to reach main unnoticed and stayed
# red for a week (see the shared-cache fix in psysonic-library's store).
test-windows:
name: cargo test --workspace (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: cargo test --workspace
working-directory: src-tauri
run: cargo test --workspace --all-targets
clippy:
name: cargo clippy --workspace
runs-on: ubuntu-24.04
@@ -57,6 +75,23 @@ jobs:
working-directory: src-tauri
run: cargo clippy --workspace --all-targets -- -D warnings
# Same blind spot as `test-windows`: the lints in the Windows-only cfg
# branches are invisible to the ubuntu clippy job above.
clippy-windows:
name: cargo clippy --workspace (windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: cargo clippy --workspace
working-directory: src-tauri
run: cargo clippy --workspace --all-targets -- -D warnings
coverage:
name: cargo llvm-cov (baseline + hot-path file gate)
runs-on: ubuntu-24.04
@@ -520,6 +520,11 @@ pub(crate) fn effective_default_output_device_name_for_poll() -> Option<String>
resolve_effective_default_output_device_name(false)
}
// The early `return` is what separates the two cfg branches below. On a
// non-Linux build the second branch is stripped, leaving a lone block that
// clippy then reads as a needless return — so the lint is an artefact of the
// expansion, not of the code as written.
#[allow(clippy::needless_return)]
fn resolve_effective_default_output_device_name(enumerate_devices: bool) -> Option<String> {
// Windows/macOS: single cpal default query (pre-#1274). Full `output_devices()`
// enumeration contends with WASAPI/CoreAudio and is only needed for Linux/PipeWire
@@ -111,6 +111,10 @@ pub fn audio_default_output_device_name_for_poll() -> Option<String> {
/// Find a stored per-device EQ key that denotes the same sink as `candidate`
/// (exact or Linux ALSA logical match).
// See `dev_io::resolve_effective_default_output_device_name` — the early
// `return` separates the cfg branches, and only the stripped non-Linux build
// makes it look redundant.
#[allow(clippy::needless_return)]
#[tauri::command]
#[specta::specta]
pub fn audio_match_stored_output_device_key(
+3 -1
View File
@@ -171,7 +171,9 @@ fn collect_relevant_proc_stats(self_pid: i32) -> Vec<(i32, String, i32, u64)> {
}
/// Map a child process name to a stable perf-probe label (Linux `comm` or macOS name).
#[cfg(any(test, target_os = "linux", target_os = "macos"))]
// Matches the gating of its only test: `test` alone would define this on
// Windows test builds, where nothing calls it.
#[cfg(any(target_os = "linux", target_os = "macos"))]
fn child_process_memory_label(name: &str) -> &'static str {
let lower = name.to_ascii_lowercase();
if lower.contains("webkitwebproces") || lower.contains("web content") || lower.contains("webcontent") {