Skip to content

Commit bbf5146

Browse files
committed
ci: optimize Windows CI speed with Dev Drive and Defender disable
1. ci.yml: Upgrade Windows Test and CLI E2E jobs from Defender-only to Dev Drive (ReFS) — same approach used by oxc and rolldown. ReFS Dev Drives bypass Defender scanning automatically and reduce NTFS metadata overhead. Expected: faster cargo cache restore, cargo build, and test. 2. e2e-test.yml: Add Defender disable to Windows build job and e2e-test jobs which previously had no Windows I/O optimization at all. The build job took ~4min 18s on Windows vs ~1min 57s on Ubuntu. References: - oxc: https://github.com/oxc-project/oxc (uses setup-dev-drive) - rolldown: https://github.com/rolldown/rolldown (uses setup-dev-drive) - setup-dev-drive: https://github.com/samypr100/setup-dev-drive
1 parent b66f338 commit bbf5146

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,17 @@ jobs:
7070
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
7171
- uses: ./.github/actions/clone
7272

73-
# Disable Windows Defender real-time scanning to speed up I/O-heavy builds (~30-50% faster)
74-
- name: Disable Windows Defender
73+
# Use Dev Drive with ReFS on Windows for faster I/O (bypasses Defender scanning automatically)
74+
- name: Setup Dev Drive
75+
uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
7576
if: runner.os == 'Windows'
76-
shell: powershell
77-
run: Set-MpPreference -DisableRealtimeMonitoring $true
77+
with:
78+
workspace-copy: true
79+
drive-size: 12GB
80+
drive-format: ReFS
81+
env-mapping: |
82+
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
83+
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
7884
7985
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
8086
with:
@@ -192,11 +198,17 @@ jobs:
192198
- name: Configure Git for access to vite-task
193199
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/"
194200

195-
# Disable Windows Defender real-time scanning to speed up I/O-heavy builds (~30-50% faster)
196-
- name: Disable Windows Defender
201+
# Use Dev Drive with ReFS on Windows for faster I/O (bypasses Defender scanning automatically)
202+
- name: Setup Dev Drive
203+
uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
197204
if: runner.os == 'Windows'
198-
shell: powershell
199-
run: Set-MpPreference -DisableRealtimeMonitoring $true
205+
with:
206+
workspace-copy: true
207+
drive-size: 12GB
208+
drive-format: ReFS
209+
env-mapping: |
210+
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
211+
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
200212
201213
- run: |
202214
brew install rustup

.github/workflows/e2e-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ jobs:
8383
- name: Configure Git for access to vite-task
8484
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/"
8585

86+
# Disable Windows Defender real-time scanning to speed up I/O-heavy builds (~30-50% faster)
87+
- name: Disable Windows Defender
88+
if: runner.os == 'Windows'
89+
shell: powershell
90+
run: Set-MpPreference -DisableRealtimeMonitoring $true
91+
8692
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
8793
with:
8894
save-cache: ${{ github.ref_name == 'main' }}
@@ -258,6 +264,12 @@ jobs:
258264
with:
259265
ecosystem-ci-project: ${{ matrix.project.name }}
260266

267+
# Disable Windows Defender real-time scanning to speed up I/O-heavy operations
268+
- name: Disable Windows Defender
269+
if: runner.os == 'Windows'
270+
shell: powershell
271+
run: Set-MpPreference -DisableRealtimeMonitoring $true
272+
261273
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
262274
with:
263275
node-version: ${{ matrix.project.node-version }}

0 commit comments

Comments
 (0)