@@ -165,6 +165,45 @@ func (c *RustTestsCheck) Run(ctx *CheckContext) error {
165165 return nil
166166}
167167
168+ // RustTestsLinuxCheck runs Rust tests in a Linux Docker container.
169+ // This catches platform-specific issues (e.g., #[cfg(target_os = "macos")]) before CI.
170+ type RustTestsLinuxCheck struct {}
171+
172+ func (c * RustTestsLinuxCheck ) Name () string {
173+ return "tests (Linux)"
174+ }
175+
176+ func (c * RustTestsLinuxCheck ) Run (ctx * CheckContext ) error {
177+ rustDir := filepath .Join (ctx .RootDir , "apps" , "desktop" , "src-tauri" )
178+
179+ // Check if Docker is available
180+ if ! commandExists ("docker" ) {
181+ fmt .Printf ("%sSKIPPED%s (Docker not installed)\n " , colorYellow , colorReset )
182+ return nil
183+ }
184+
185+ // Check if Docker daemon is running
186+ checkCmd := exec .Command ("docker" , "info" )
187+ if _ , err := runCommand (checkCmd , true ); err != nil {
188+ fmt .Printf ("%sSKIPPED%s (Docker not running)\n " , colorYellow , colorReset )
189+ return nil
190+ }
191+
192+ // Run tests in a Rust container
193+ cmd := exec .Command ("docker" , "run" , "--rm" ,
194+ "-v" , rustDir + ":/app" ,
195+ "-w" , "/app" ,
196+ "rust:latest" ,
197+ "sh" , "-c" , "cargo test --no-fail-fast" )
198+ output , err := runCommand (cmd , true )
199+ if err != nil {
200+ fmt .Println ()
201+ fmt .Print (indentOutput (output , " " ))
202+ return fmt .Errorf ("rust tests failed on Linux" )
203+ }
204+ return nil
205+ }
206+
168207// CargoUdepsCheck detects unused dependencies.
169208type CargoUdepsCheck struct {}
170209
0 commit comments