From 9b65cbece04fed91b8475b0739b3f3ef862625a5 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 2 Oct 2024 22:49:26 +0300 Subject: [PATCH] ci: Specify the number of build jobs on windows Followup to 7b51a7c77b49ce76c8ca787cbcffa7b1a4b49528 Part-of: --- ci/run_windows_tests.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci/run_windows_tests.ps1 b/ci/run_windows_tests.ps1 index 3b6ee67d9..1a1455ac2 100644 --- a/ci/run_windows_tests.ps1 +++ b/ci/run_windows_tests.ps1 @@ -42,6 +42,17 @@ "--all-features" ) +if ($env:FDO_CI_CONCURRENT) +{ + $ncpus = $env:FDO_CI_CONCURRENT +} +else +{ + $ncpus = (Get-WmiObject -Class Win32_ComputerSystem).NumberOfLogicalProcessors +} +Write-Host "Build Jobs: $ncpus" +$cargo_opts = @("--color=always", "--jobs=$ncpus") + function Move-Junit { param ( $Features @@ -100,7 +111,7 @@ foreach($features in $features_matrix) { } Write-Host "with features: $env:LocalFeatures" - cargo build --color=always --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures + cargo build $cargo_opts --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures if (!$?) { Write-Host "Failed to build crate: $crate" @@ -114,7 +125,7 @@ foreach($features in $features_matrix) { $env:G_DEBUG="fatal_warnings" $env:RUST_BACKTRACE="1" - cargo nextest run --profile=ci --no-fail-fast --color=always --manifest-path $crate/Cargo.toml $env:LocalFeatures + cargo nextest run --profile=ci --no-fail-fast $cargo_opts --manifest-path $crate/Cargo.toml $env:LocalFeatures if (!$?) { Write-Host "Tests failed to for crate: $crate" Exit 1