ci: Specify the number of build jobs on windows

Followup to 7b51a7c77b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1572>
This commit is contained in:
Jordan Petridis 2024-10-02 22:49:26 +03:00 committed by GStreamer Marge Bot
parent 9e89c93ad5
commit af3bb7558f

View file

@ -42,6 +42,17 @@
"--all-features" "--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 { function Move-Junit {
param ( param (
$Features $Features
@ -100,7 +111,7 @@ foreach($features in $features_matrix) {
} }
Write-Host "with features: $env:LocalFeatures" 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 (!$?) { if (!$?) {
Write-Host "Failed to build crate: $crate" Write-Host "Failed to build crate: $crate"
@ -114,7 +125,7 @@ foreach($features in $features_matrix) {
$env:G_DEBUG="fatal_warnings" $env:G_DEBUG="fatal_warnings"
$env:RUST_BACKTRACE="1" $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 (!$?) { if (!$?) {
Write-Host "Tests failed to for crate: $crate" Write-Host "Tests failed to for crate: $crate"
Exit 1 Exit 1