CI: Do not enable all features in .cargo test sys

This solves build breakage when dox is enabled on non-nightly targets,
which uses the experimental doc_cfg feature.
This commit is contained in:
Marijn Suijten 2020-11-19 12:03:50 +01:00
parent e88994a0b7
commit 3129027b9d

View file

@ -198,23 +198,28 @@ plugins-update-nightly:
# First build and test all the crates with their relevant features # First build and test all the crates with their relevant features
# Keep features in sync with below # Keep features in sync with below
- | - |
get_features() {
crate=$1
if [ "$crate" = "gstreamer" ]; then
echo "ser_de,v1_18"
elif [ "$crate" = "gstreamer-gl" ]; then
echo "egl,x11,wayland,v1_18"
else
echo "v1_18"
fi
}
for crate in gstreamer*; do for crate in gstreamer*; do
if [ -e $crate/Cargo.toml ]; then if [ -e $crate/Cargo.toml ]; then
if [ -n "$ALL_FEATURES" ]; then if [ -n "$ALL_FEATURES" ]; then
if [ $crate = "gstreamer" ]; then FEATURES="--features=$(get_features $crate)"
FEATURES=ser_de,v1_18
elif [ $crate = "gstreamer-gl" ]; then
FEATURES=egl,x11,wayland,v1_18
else
FEATURES=v1_18
fi
cargo build --locked --color=always --manifest-path $crate/Cargo.toml --features=$FEATURES
G_DEBUG=fatal_warnings cargo test --color=always --manifest-path $crate/Cargo.toml --features=$FEATURES
else else
cargo build --locked --color=always --manifest-path $crate/Cargo.toml FEATURES=""
G_DEBUG=fatal_warnings cargo test --color=always --manifest-path $crate/Cargo.toml
fi fi
echo "Building and testing $crate with $FEATURES"
cargo build --locked --color=always --manifest-path $crate/Cargo.toml $FEATURES
G_DEBUG=fatal_warnings cargo test --color=always --manifest-path $crate/Cargo.toml $FEATURES
fi fi
done done
@ -261,36 +266,44 @@ test nightly all-features:
stage: "test" stage: "test"
script: script:
- rustc --version - rustc --version
- |
get_features() {
module=${1%%/sys}
if [ "$module" = "gstreamer-gl" ]; then
echo "egl,x11,wayland,v1_18"
else
echo "v1_18"
fi
}
# First build and test all the crates with their relevant features # First build and test all the crates with their relevant features
# Keep features in sync with below # Keep features in sync with below
- |
for crate in gstreamer*/sys; do for crate in gstreamer*/sys; do
if [ -e $crate/Cargo.toml ]; then if [ -e $crate/Cargo.toml ]; then
cargo build --locked --color=always --manifest-path $crate/Cargo.toml --all-features echo "Building $crate with $(get_features $crate)"
cargo build --locked --color=always --manifest-path $crate/Cargo.toml --features $(get_features $crate)
fi fi
done done
# Run tests for crates we can currently run. # Run tests for crates we can currently run.
# Other tests are broken currently. # Other tests are broken currently.
- | for crate in gstreamer/sys \
for crate in gstreamer/sys \ gstreamer-app/sys \
gstreamer-app/sys \ gstreamer-audio/sys \
gstreamer-audio/sys \ gstreamer-base/sys \
gstreamer-base/sys \ gstreamer-check/sys \
gstreamer-check/sys \ gstreamer-controller/sys \
gstreamer-controller/sys \ gstreamer-mpegts/sys \
gstreamer-mpegts/sys \ gstreamer-net/sys \
gstreamer-net/sys \ gstreamer-pbutils/sys \
gstreamer-pbutils/sys \ gstreamer-player/sys \
gstreamer-player/sys \ gstreamer-rtsp-server/sys \
gstreamer-rtsp-server/sys \ gstreamer-rtsp/sys \
gstreamer-rtsp/sys \ gstreamer-sdp/sys \
gstreamer-sdp/sys \ gstreamer-tag/sys \
gstreamer-tag/sys \ gstreamer-video/sys \
gstreamer-video/sys \ gstreamer-webrtc/sys; do
gstreamer-webrtc/sys; \ echo "Testing $crate with $(get_features $crate)"
do \ cargo test --locked --color=always --manifest-path $crate/Cargo.toml --features $(get_features $crate)
cargo test --locked --color=always --manifest-path $crate/Cargo.toml --all-features; \ done
done
test stable sys: test stable sys:
extends: extends:
@ -327,15 +340,21 @@ clippy:
- cargo clippy --version - cargo clippy --version
# Keep features in sync with above # Keep features in sync with above
- | - |
get_features() {
crate=$1
if [ "$crate" = "gstreamer" ]; then
echo "ser_de,v1_18"
elif [ "$crate" = "gstreamer-gl" ]; then
echo "egl,x11,wayland,v1_18"
else
echo "v1_18"
fi
}
for crate in gstreamer*; do for crate in gstreamer*; do
if [ -e $crate/Cargo.toml ]; then if [ -e $crate/Cargo.toml ]; then
if [ $crate = "gstreamer" ]; then FEATURES=$(get_features $crate)
FEATURES=ser_de,v1_18
elif [ $crate = "gstreamer-gl" ]; then echo "Running clippy on $crate with $FEATURES"
FEATURES=egl,x11,wayland,v1_18
else
FEATURES=v1_18
fi
cargo clippy --locked --color=always --manifest-path $crate/Cargo.toml --features=$FEATURES --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -D warnings cargo clippy --locked --color=always --manifest-path $crate/Cargo.toml --features=$FEATURES --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -D warnings
fi fi