From 3788914ceac73cee626f402d144bd8b6c712a3b3 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 3 Oct 2024 01:28:30 +0300 Subject: [PATCH] ci: Specify the number of build jobs on windows Followup to b5e0e071 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 3ff197a1..c2ef8708 100644 --- a/ci/run_windows_tests.ps1 +++ b/ci/run_windows_tests.ps1 @@ -13,6 +13,17 @@ $env:ErrorActionPreference='Stop' "--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", "--all-targets") + function Run-Tests { param ( $Features @@ -28,7 +39,7 @@ function Run-Tests { Write-Host "Features: $Features" Write-Host "Exclude string: $local_exclude" - cargo build --color=always --workspace $local_exclude --all-targets $Features + cargo build $cargo_opts --workspace $local_exclude $Features if (!$?) { Write-Host "Build failed" @@ -37,7 +48,7 @@ function Run-Tests { $env:G_DEBUG="fatal_warnings" $env:RUST_BACKTRACE="1" - cargo nextest run --profile=ci --no-fail-fast --color=always --workspace $local_exclude --all-targets $Features + cargo nextest run $cargo_opts --profile=ci --no-fail-fast --workspace $local_exclude $Features if (!$?) { Write-Host "Tests failed" Exit 1