Skip to content

Commit ed41c21

Browse files
perf(ci): add build parallelism env vars to Windows CI setup
Export CARGO_BUILD_JOBS, RUSTFLAGS (-Zthreads), and CARGO_PROFILE_RELEASE_CODEGEN_UNITS to match build.ps1 settings. Without these, codegen-units=1 from Cargo.toml serializes LLVM codegen to a single thread, dropping CPU utilization to 20-30% on the 8-core i7-9700K runner during mt-tauri compilation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 62e9428 commit ed41c21

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/actions/setup-tauri-build/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ runs:
6565
echo "RUSTUP_TOOLCHAIN=nightly-2026-02-09" >> $env:GITHUB_ENV
6666
rustup toolchain install nightly-2026-02-09 --no-self-update --target x86_64-pc-windows-msvc
6767
rustup default nightly-2026-02-09
68+
# Parallelism: match build.ps1 settings
69+
$cpus = [Environment]::ProcessorCount
70+
$buildJobs = [Math]::Max(1, $cpus - 2)
71+
$rustThreads = [Math]::Max(1, [Math]::Round($cpus * 0.8))
72+
echo "CARGO_BUILD_JOBS=$buildJobs" >> $env:GITHUB_ENV
73+
echo "RUSTFLAGS=-Zthreads=$rustThreads" >> $env:GITHUB_ENV
74+
echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=$rustThreads" >> $env:GITHUB_ENV
6875
rustc --version
6976
cargo --version
7077

0 commit comments

Comments
 (0)