fix(ci): add Windows Defender exclusions to reduce Windows runner lag#152
Open
mrdailey99 wants to merge 2 commits into
Open
fix(ci): add Windows Defender exclusions to reduce Windows runner lag#152mrdailey99 wants to merge 2 commits into
mrdailey99 wants to merge 2 commits into
Conversation
…ner lag npm install -g and NUTS subprocess spawning are ~4x slower on Windows because Defender scans every file write and every node_modules load per sf subprocess. Adding path exclusions before each step brings Windows times in line with Linux/macOS. Guards are windows-latest-only so other matrix legs are unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the CI workflow to speed up Windows jobs by adding Windows Defender exclusion paths prior to installing the Salesforce CLI and running NUTS, reducing file-scan overhead on windows-latest.
Changes:
- Add Defender exclusions for npm cache directories before
npm install -g @salesforce/clion Windows runners. - Add Defender exclusions for the repository workspace and
sfdirectories before running NUTS on Windows runners.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+62
to
+64
| Add-MpPreference -ExclusionPath "$env:APPDATA\npm" | ||
| Add-MpPreference -ExclusionPath "$env:APPDATA\npm-cache" | ||
| Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\npm-cache" |
Comment on lines
+149
to
+155
| - name: 'Exclude workspace from Windows Defender (NUTS speed)' | ||
| if: matrix.os == 'windows-latest' | ||
| shell: powershell | ||
| run: | | ||
| Add-MpPreference -ExclusionPath "${{ github.workspace }}" | ||
| Add-MpPreference -ExclusionPath "$env:APPDATA\sf" | ||
| Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\sf" |
DisableRealtimeMonitoring + cache sf CLI on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add-MpPreference -ExclusionPathsteps (Windows-only, guarded byif: matrix.os == 'windows-latest') beforesf installationandExecute NUTSsf installationtakes ~4 min on Windows vs <15 s on Linux/macOS because Defender scans every file write duringnpm install -g @salesforce/cli(thousands of small files on NTFS)Execute NUTSis slower on Windows because NUTS tests spawnsfsubprocesses viaexecCmd()for every assertion, and Defender rescans node_modules on each subprocess loadTest plan
windows-latestonly and verifysf installationcompletes in under 30 sExecute NUTSduration on Windows approaches Linux/macOS timesGenerated with Claude Code