ci: add Windows Defender disable to e2e-test.yml#723
Conversation
✅ Deploy Preview for viteplus-staging canceled.
|
CI Speed Comparison: Before vs After
|
| Step | Before (Defender disable) | After (Dev Drive) | Delta |
|---|---|---|---|
| Defender / Dev Drive setup | 1s | 48s | +47s (one-time) |
| setup-rust (cache restore) | 1m27s | 19s | ✅ -1m8s |
cargo check |
2m14s | 10m14s | ❌ +8m (cold cache!) |
cargo test |
1m53s | 6m2s | ❌ +4m9s (cold cache!) |
| Total | 6m9s | 18m12s | ❌ +12m (+197%) |
The cache restore was faster (19s vs 1m27s — registry on ReFS is fast), but the target directory cache was invalidated because the workspace path changed from C:\... to the Dev Drive path. This forced a full rebuild.
CLI E2E (Windows) — ❌ Slight regression (9m38s → 11m53s)
| Step | Before (Defender disable) | After (Dev Drive) | Delta |
|---|---|---|---|
| Dev Drive setup | 2s | 43s | +41s |
| setup-rust | 47s | 20s | ✅ -27s |
| setup-node | 1m10s | 1m41s | -31s |
| Build upstream | 1m30s | 1m40s | -10s |
| Snapshot tests | 3m51s | 4m48s | -57s |
| Total | 9m38s | 11m53s | ❌ +2m15s |
E2E Build (Windows) — ⏸️ Minimal change (Defender disable only)
| Metric | Before (no optimization) | After (Defender disable) |
|---|---|---|
| Total | 4m18s | 4m6s |
Defender disable showed ~12s improvement, marginal.
Root Cause
workspace-copy: true changes GITHUB_WORKSPACE to the Dev Drive. The oxc-project/setup-rust action caches the target/ directory keyed to the original workspace path, so the cache becomes a miss. This means every run does a full Rust rebuild.
Fix Options
-
Remove
workspace-copy: true— Only mapCARGO_HOMEandRUSTUP_HOMEto the Dev Drive (like rolldown does). The workspace stays on C: drive, cache works normally, and cargo registry I/O still benefits. -
Revert to Defender-only — The simpler
Set-MpPreferenceapproach was already working well for this repo.
I'll push a fix with option 1 (matching rolldown's approach) to see if it preserves the cache while still benefiting from the Dev Drive for cargo/rustup.
v2 Results (Defender + Dev Drive, no workspace-copy)Test (Windows) — 16m22s (still cold cache)
CLI E2E (Windows) — 10m20s (slight regression)
AnalysisThe cargo target directory cache is still cold — the v1 run with RecommendationThe Dev Drive adds complexity (~14s setup) but the main benefit (faster cache restore) is modest. Given that:
I suggest simplifying: revert to Defender-disable only (remove the Dev Drive step). The Want me to push this simplification? |
Disable Windows Defender real-time scanning on Windows runners in e2e-test.yml (build job and e2e-test jobs) which previously had no Windows I/O optimization. Expected: ~20-30% faster I/O on Windows build and test steps.
e36e950 to
27fcb86
Compare
Summary
Add Windows Defender real-time scanning disable to
e2e-test.ymlWindows jobs, which previously had no Windows I/O optimization.Changes
e2e-test.yml — Add Defender disable (new)
windows-latest): AddedSet-MpPreference -DisableRealtimeMonitoring $truewindows-latest): Added Defender disable forvp install, test execution, etc.ci.yml — No change
Test and CLI E2E jobs already had Defender disable from PR #716.
Expected Impact
Notes
Dev Drive (
setup-dev-drive) was also tested in this PR but reverted — it caused cargo target directory cache invalidation due to workspace path changes, resulting in full rebuilds. See comparison comment for details. The simpler Defender-disable approach is sufficient.