2021-05-28 03:02:25 +00:00
|
|
|
# List of all the crates we want to build
|
|
|
|
# We need to do this manually to avoid trying
|
|
|
|
# to build egl,wayland,x11 etc, which can't
|
|
|
|
# work on windows
|
|
|
|
[string[]] $crates = @(
|
|
|
|
'gstreamer',
|
|
|
|
# Unix specific atm
|
|
|
|
# 'gstreamer-allocators'
|
|
|
|
'gstreamer-app',
|
|
|
|
'gstreamer-audio',
|
|
|
|
'gstreamer-base',
|
|
|
|
'gstreamer-check',
|
|
|
|
'gstreamer-controller',
|
|
|
|
'gstreamer-editing-services',
|
2022-05-19 10:12:30 +00:00
|
|
|
'gstreamer-gl',
|
2021-05-28 03:02:25 +00:00
|
|
|
# 'gstreamer-gl/egl',
|
|
|
|
# 'gstreamer-gl/wayland',
|
|
|
|
# 'gstreamer-gl/x11',
|
2024-04-30 09:31:29 +00:00
|
|
|
'gstreamer-mpegts',
|
2021-05-28 03:02:25 +00:00
|
|
|
'gstreamer-mpegts/sys',
|
|
|
|
'gstreamer-net',
|
|
|
|
'gstreamer-pbutils',
|
|
|
|
'gstreamer-player',
|
|
|
|
'gstreamer-rtp',
|
|
|
|
'gstreamer-rtsp',
|
|
|
|
'gstreamer-rtsp-server',
|
|
|
|
'gstreamer-sdp',
|
2024-04-30 09:31:29 +00:00
|
|
|
'gstreamer-tag',
|
2021-05-28 03:02:25 +00:00
|
|
|
'gstreamer-tag/sys',
|
|
|
|
'gstreamer-video',
|
|
|
|
'gstreamer-webrtc',
|
|
|
|
'tutorials',
|
|
|
|
'examples'
|
|
|
|
)
|
|
|
|
|
2022-12-13 19:18:12 +00:00
|
|
|
# "" is the default build, no flags appended
|
2022-12-13 18:39:20 +00:00
|
|
|
[string[]] $features_matrix = @(
|
2022-12-13 19:18:12 +00:00
|
|
|
# "--no-default-features",
|
2023-05-08 20:05:17 +00:00
|
|
|
# "--features=v1_18",
|
|
|
|
# "--features=v1_20",
|
2022-12-13 18:39:20 +00:00
|
|
|
"",
|
2023-05-08 20:05:17 +00:00
|
|
|
"--all-features"
|
2022-12-13 18:39:20 +00:00
|
|
|
)
|
2021-05-28 03:02:25 +00:00
|
|
|
|
2024-10-02 19:49:26 +00:00
|
|
|
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")
|
|
|
|
|
2024-08-20 17:48:04 +00:00
|
|
|
function Move-Junit {
|
|
|
|
param (
|
|
|
|
$Features
|
|
|
|
)
|
|
|
|
|
|
|
|
if ($env:CI_PROJECT_DIR) {
|
|
|
|
$parent = $env:CI_PROJECT_DIR
|
|
|
|
} else {
|
|
|
|
$parent = $PWD.path
|
|
|
|
}
|
|
|
|
Write-Host "Parent directory: $parent"
|
|
|
|
|
|
|
|
$new_report_dir = "$parent/junit_reports/$crate/"
|
|
|
|
If(!(test-path -PathType container $new_report_dir))
|
|
|
|
{
|
|
|
|
New-Item -Path "$new_report_dir" -ItemType "directory"
|
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Failed to create directory: $new_report_dir"
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($Features -eq "--all-features") {
|
|
|
|
$suffix = "all"
|
|
|
|
} elseif ($Features -eq "--no-default-features") {
|
|
|
|
$suffix = "no-default"
|
|
|
|
} else {
|
|
|
|
$suffix = "default"
|
|
|
|
}
|
|
|
|
|
|
|
|
Move-Item "$parent/target/nextest/ci/junit.xml" "$new_report_dir/junit-$suffix.xml"
|
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Failed to move junit file"
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-13 18:39:20 +00:00
|
|
|
foreach($features in $features_matrix) {
|
|
|
|
foreach($crate in $crates)
|
|
|
|
{
|
|
|
|
Write-Host "Building crate: $crate"
|
|
|
|
Write-Host "Features: $features"
|
|
|
|
$env:LocalFeatures = $features
|
2021-05-28 03:02:25 +00:00
|
|
|
|
2022-12-13 18:39:20 +00:00
|
|
|
# Don't append feature flags if the string is null/empty
|
|
|
|
# Or when we want to build without default features
|
|
|
|
if ($env:LocalFeatures -and ($env:LocalFeatures -ne '--no-default-features')) {
|
|
|
|
if ($crate -eq 'examples') {
|
2022-12-28 11:42:05 +00:00
|
|
|
# FIXME: We can do --all-features for examples once we have gtk3 installed in the image
|
2024-06-20 08:49:14 +00:00
|
|
|
$env:LocalFeatures = "--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition,gst-play,gst-player,ges,image,cairo-rs,gst-video/v1_18,windows,gl"
|
2022-12-13 18:39:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($crate -eq 'tutorials') {
|
|
|
|
$env:LocalFeatures = ''
|
|
|
|
}
|
2021-05-28 03:02:25 +00:00
|
|
|
}
|
|
|
|
|
2022-12-13 18:39:20 +00:00
|
|
|
Write-Host "with features: $env:LocalFeatures"
|
2024-10-02 19:49:26 +00:00
|
|
|
cargo build $cargo_opts --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures
|
2021-05-28 03:02:25 +00:00
|
|
|
|
2022-12-13 18:39:20 +00:00
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Failed to build crate: $crate"
|
|
|
|
Exit 1
|
|
|
|
}
|
2021-05-28 03:02:25 +00:00
|
|
|
|
2022-12-13 18:39:20 +00:00
|
|
|
if (($crate -eq "gstreamer-tag/sys") -or ($crate -eq "gstreamer-mpegts/sys")) {
|
|
|
|
Write-Host "Skipping tests for $crate"
|
|
|
|
continue
|
|
|
|
}
|
2021-05-28 03:02:25 +00:00
|
|
|
|
2022-12-13 18:39:20 +00:00
|
|
|
$env:G_DEBUG="fatal_warnings"
|
2024-06-06 11:50:35 +00:00
|
|
|
$env:RUST_BACKTRACE="1"
|
2024-10-02 19:49:26 +00:00
|
|
|
cargo nextest run --profile=ci --no-fail-fast $cargo_opts --manifest-path $crate/Cargo.toml $env:LocalFeatures
|
2022-12-13 18:39:20 +00:00
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Tests failed to for crate: $crate"
|
|
|
|
Exit 1
|
|
|
|
}
|
2024-08-20 17:48:04 +00:00
|
|
|
|
|
|
|
Move-Junit -Features $features
|
2021-05-28 03:02:25 +00:00
|
|
|
}
|
2022-08-17 15:03:27 +00:00
|
|
|
}
|