From d867077c3a0066c964f84265687adfd338731578 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 13 Dec 2022 20:39:20 +0200 Subject: [PATCH] ci: Combine windows features builds Part of gstreamer/gstreamer-rs#417 Part-of: --- .gitlab-ci.yml | 10 ------ ci/run_windows_tests.ps1 | 78 ++++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e96a3f3c2..0855d94da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -687,17 +687,7 @@ windows rust docker msrv: - 'docker' - 'windows' - '2022' - parallel: - matrix: - - FEATURES: - - "--features=v1_18," - - "--features=v1_20," - - "--features=v1_22," - - "--no-default-features" - - "" script: - - echo $env:FEATURES - # Skip -sys tests as they don't work # https://github.com/gtk-rs/gtk3-rs/issues/54 # diff --git a/ci/run_windows_tests.ps1 b/ci/run_windows_tests.ps1 index 7c7d7d9ce..4b7786a00 100644 --- a/ci/run_windows_tests.ps1 +++ b/ci/run_windows_tests.ps1 @@ -35,47 +35,57 @@ 'examples' ) -foreach($crate in $crates) -{ - Write-Host "Building crate: $crate" - Write-Host "Features: $env:FEATURES" - $env:LocalFeatures = $env:FEATURES +[string[]] $features_matrix = @( + "--no-default-features", + "", + "--features=v1_18,", + "--features=v1_20,", + "--features=v1_22," +) - # 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 'gstreamer') { - $env:LocalFeatures += "serde," +foreach($features in $features_matrix) { + foreach($crate in $crates) + { + Write-Host "Building crate: $crate" + Write-Host "Features: $features" + $env:LocalFeatures = $features + + # 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 'gstreamer') { + $env:LocalFeatures += "serde," + } + + if ($crate -eq 'examples') { + # FIXME: We can do --all-features for examples once we have gtk installed in the image + $env:LocalFeatures = "--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition" + } + + if ($crate -eq 'tutorials') { + $env:LocalFeatures = '' + } } - if ($crate -eq 'examples') { - # FIXME: We can do --all-features for examples once we have gtk installed in the image - $env:LocalFeatures = "--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition" + Write-Host "with features: $env:LocalFeatures" + cargo build --color=always --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures + + if (!$?) { + Write-Host "Failed to build crate: $crate" + Exit 1 } - if ($crate -eq 'tutorials') { - $env:LocalFeatures = '' + if (($crate -eq "gstreamer-tag/sys") -or ($crate -eq "gstreamer-mpegts/sys")) { + Write-Host "Skipping tests for $crate" + continue } - } - Write-Host "with features: $env:LocalFeatures" - cargo build --color=always --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures + $env:G_DEBUG="fatal_warnings" + cargo test --no-fail-fast --color=always --manifest-path $crate/Cargo.toml $env:LocalFeatures - if (!$?) { - Write-Host "Failed to build crate: $crate" - Exit 1 - } - - if (($crate -eq "gstreamer-tag/sys") -or ($crate -eq "gstreamer-mpegts/sys")) { - Write-Host "Skipping tests for $crate" - continue - } - - $env:G_DEBUG="fatal_warnings" - cargo test --no-fail-fast --color=always --manifest-path $crate/Cargo.toml $env:LocalFeatures - - if (!$?) { - Write-Host "Tests failed to for crate: $crate" - Exit 1 + if (!$?) { + Write-Host "Tests failed to for crate: $crate" + Exit 1 + } } }