ci: Build again with --all-features when possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1259>
This commit is contained in:
Jordan Petridis 2023-05-08 23:05:17 +03:00
parent 9d61e39ed2
commit 13f4085456
3 changed files with 8 additions and 45 deletions

View file

@ -5,27 +5,10 @@ set -ex
rustc --version
cargo --version
# First build and test all the crates with their relevant features
# Keep features in sync with the list below below
get_features() {
crate=$1
case "$crate" in
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
echo "--features=serde,v1_24"
;;
gstreamer-validate)
echo ""
;;
*)
echo "--features=v1_24"
;;
esac
}
for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do
if [ -e "$crate/Cargo.toml" ]; then
if [ -n "$ALL_FEATURES" ]; then
FEATURES=$(get_features "$crate")
FEATURES="--all-features"
else
FEATURES=""
fi

View file

@ -5,29 +5,13 @@ set -ex
rustc --version
cargo --version
get_features() {
module=${1%%/sys}
case "$module" in
gstreamer-validate)
echo ""
;;
*)
echo "--features=v1_24"
;;
esac
}
# First build and test all the crates with their relevant features
# Keep features in sync with below
for crate in gstreamer*/sys gstreamer-gl/*/sys; do
if [ -e "$crate/Cargo.toml" ]; then
echo "Building $crate with $(get_features "$crate")"
cargo build --locked --color=always --manifest-path "$crate/Cargo.toml" $(get_features "$crate")
echo "Building $crate with --all-features"
cargo build --locked --color=always --manifest-path "$crate/Cargo.toml" --all-features
fi
done
# Run tests for crates we can currently run.
# Other tests are broken currently.
for crate in gstreamer/sys \
gstreamer-app/sys \
gstreamer-audio/sys \
@ -48,6 +32,6 @@ for crate in gstreamer/sys \
gstreamer-tag/sys \
gstreamer-video/sys \
gstreamer-webrtc/sys; do
echo "Testing $crate with $(get_features $crate)"
cargo test --locked --color=always --manifest-path $crate/Cargo.toml "$(get_features $crate)"
echo "Testing $crate with --all-features)"
cargo test --locked --color=always --manifest-path $crate/Cargo.toml --all-features
done

View file

@ -38,10 +38,10 @@
# "" is the default build, no flags appended
[string[]] $features_matrix = @(
# "--no-default-features",
# "--features=v1_18,",
# "--features=v1_20,",
# "--features=v1_18",
# "--features=v1_20",
"",
"--features=v1_24,"
"--all-features"
)
foreach($features in $features_matrix) {
@ -54,10 +54,6 @@ foreach($features in $features_matrix) {
# 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 gtk3 installed in the image
$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"