From 15e587fa5765930f2adaa5563a90cf21c9dabbca Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 21 Sep 2026 18:54:15 -0500 Subject: [PATCH 1/2] ci: add Defender exclusions to the Windows test job The filesystem-heavy suites (repository, teams, database owner) run 4x to 15x slower on Windows than Linux, largely from Defender real-time scanning of the temp and cache directories. Add a best-effort exclusion step before running tests; it never fails the job when denied. --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f934491..dd06c3f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,32 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-test- + - name: Windows: opt out of real-time scanning for cache and temp + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + # Best-effort. Windows Defender real-time scanning is the dominant + # cost for the filesystem-heavy suites (repository, teams, database + # owner). Exclusions are non-fatal: on managed runners the call may + # be denied and the run continues. + $paths = @( + "$env:GITHUB_WORKSPACE", + "$env:RUNNER_TEMP", + "$env:LOCALAPPDATA\Temp" + ) + if ("$env:CARGO_HOME" -ne "") { $paths += "$env:CARGO_HOME" } + else { $paths += "$env:USERPROFILE\.cargo" } + foreach ($p in $paths) { + if (Test-Path $p) { + try { + Add-MpPreference -ExclusionPath $p -ErrorAction Stop | Out-Null + } catch { + Write-Host "Defender exclusion denied for $p (non-fatal): $($_.Exception.Message)" + } + } + } + Write-Host "Defender exclusions requested." + - name: Run tests run: cargo test --workspace From 9eb5a799b5a032745d9c0710931e45e24c9176bb Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 21 Sep 2026 19:48:50 -0500 Subject: [PATCH 2/2] ci: fix step name YAML (unquoted colon in scalar) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd06c3f3..6846eaa4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-test- - - name: Windows: opt out of real-time scanning for cache and temp + - name: Windows opt out of real-time scanning for cache and temp if: matrix.os == 'windows-latest' shell: pwsh run: |