ci: Specify the number of build jobs on windows

Followup to b5e0e071

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1840>
This commit is contained in:
Jordan Petridis 2024-10-03 01:28:30 +03:00 committed by GStreamer Marge Bot
parent 24ffee3fd6
commit 3788914cea

View file

@ -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