ci: Specify the number of build jobs on windows

Followup to 7b51a7c77b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1502>
This commit is contained in:
Jordan Petridis 2024-10-02 22:49:26 +03:00
parent ce13ac33fd
commit 9b65cbece0

View file

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