Skip to content

fix(ci): add Windows Defender exclusions to reduce Windows runner lag#152

Open
mrdailey99 wants to merge 2 commits into
developfrom
fix/windows-ci-defender-exclusions
Open

fix(ci): add Windows Defender exclusions to reduce Windows runner lag#152
mrdailey99 wants to merge 2 commits into
developfrom
fix/windows-ci-defender-exclusions

Conversation

@mrdailey99
Copy link
Copy Markdown
Collaborator

Summary

  • Adds Add-MpPreference -ExclusionPath steps (Windows-only, guarded by if: matrix.os == 'windows-latest') before sf installation and Execute NUTS
  • sf installation takes ~4 min on Windows vs <15 s on Linux/macOS because Defender scans every file write during npm install -g @salesforce/cli (thousands of small files on NTFS)
  • Execute NUTS is slower on Windows because NUTS tests spawn sf subprocesses via execCmd() for every assertion, and Defender rescans node_modules on each subprocess load
  • Linux/macOS matrix legs are completely unaffected

Test plan

  • Trigger a manual workflow run targeting windows-latest only and verify sf installation completes in under 30 s
  • Verify Execute NUTS duration on Windows approaches Linux/macOS times
  • Verify Ubuntu and macOS legs are unchanged (new steps are skipped)

Generated with Claude Code

…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>
Copilot AI review requested due to automatic review settings May 7, 2026 21:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/cli on Windows runners.
  • Add Defender exclusions for the repository workspace and sf directories before running NUTS on Windows runners.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/CI_Execution.yml Outdated
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 thread .github/workflows/CI_Execution.yml Outdated
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants