Skip to content

Commit d6cca15

Browse files
committed
ci: optimize Windows CI speed by skipping redundant NAPI rebuild and disabling Defender
- Replace `pnpm build` with `pnpm -F vite-plus-cli build-ts` in CLI E2E Build CLI step — NAPI bindings are already built and cached by the build-upstream action, no need to recompile (~3 min saved on Windows) - Disable Windows Defender real-time scanning in test and cli-e2e-test jobs to reduce I/O overhead on NTFS (~30-50% faster file operations) Closes #715
1 parent 62bfff3 commit d6cca15

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ 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
75+
if: runner.os == 'Windows'
76+
shell: powershell
77+
run: Set-MpPreference -DisableRealtimeMonitoring $true
78+
7379
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
7480
with:
7581
save-cache: ${{ github.ref_name == 'main' }}
@@ -186,6 +192,12 @@ jobs:
186192
- name: Configure Git for access to vite-task
187193
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/"
188194

195+
# Disable Windows Defender real-time scanning to speed up I/O-heavy builds (~30-50% faster)
196+
- name: Disable Windows Defender
197+
if: runner.os == 'Windows'
198+
shell: powershell
199+
run: Set-MpPreference -DisableRealtimeMonitoring $true
200+
189201
- run: |
190202
brew install rustup
191203
rustup install stable
@@ -210,9 +222,10 @@ jobs:
210222
with:
211223
target: ${{ matrix.os == 'ubuntu-latest' && 'x86_64-unknown-linux-gnu' || matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'aarch64-apple-darwin' }}
212224

225+
# Skip native rebuild — NAPI bindings are already built and cached by build-upstream
213226
- name: Build CLI
214227
run: |
215-
pnpm build
228+
pnpm -F vite-plus-cli build-ts
216229
pnpm bootstrap-cli:ci
217230
if [[ "$RUNNER_OS" == "Windows" ]]; then
218231
echo "$USERPROFILE\.vite-plus\bin" >> $GITHUB_PATH

0 commit comments

Comments
 (0)