diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd4200e4f..00d5b9ec2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -118,18 +118,21 @@ trigger: extends: .debian:12 variables: RUST_IMAGE_FULL: "1" + RUST_VERSION: '$GST_RS_STABLE' FDO_DISTRIBUTION_TAG: '$GST_RS_STABLE-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh $GST_RS_STABLE $RUST_IMAGE_FULL' .debian:12-msrv: extends: .debian:12 variables: + RUST_VERSION: '$GST_RS_MSRV' FDO_DISTRIBUTION_TAG: '$GST_RS_MSRV-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh $GST_RS_MSRV $RUST_IMAGE_FULL' .debian:12-nightly: extends: .debian:12 variables: + RUST_VERSION: 'nightly' FDO_DISTRIBUTION_TAG: 'nightly-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh nightly $RUST_IMAGE_FULL' @@ -615,6 +618,8 @@ test windows msrv: - job: 'windows rust docker msrv' artifacts: false extends: '.msvc2019 build' + variables: + RUST_VERSION: !reference [variables, "GST_RS_MSRV"] test windows stable: needs: @@ -624,3 +629,5 @@ test windows stable: artifacts: false image: "$WINDOWS_RUST_STABLE_IMAGE" extends: '.msvc2019 build' + variables: + RUST_VERSION: !reference [variables, "GST_RS_STABLE"] diff --git a/ci/run-cargo-test.sh b/ci/run-cargo-test.sh index cf1a32ae5..3cc827c13 100755 --- a/ci/run-cargo-test.sh +++ b/ci/run-cargo-test.sh @@ -6,7 +6,8 @@ rustc --version cargo --version cpus=$(nproc || sysctl -n hw.ncpu) -CARGO_FLAGS="-j${FDO_CI_CONCURRENT:-$cpus}" +CARGO_FLAGS="--color=always -j${FDO_CI_CONCURRENT:-$cpus}" +CARGO_NEXTEST_FLAGS="--profile=ci --no-tests=pass" parent="${CI_PROJECT_DIR:-$(pwd)}" @@ -20,8 +21,8 @@ for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do echo "Building and testing $crate with $FEATURES" - cargo build $CARGO_FLAGS --locked --color=always --manifest-path "$crate/Cargo.toml" $FEATURES - RUST_BACKTRACE=1 G_DEBUG=fatal_warnings cargo nextest run --profile=ci --no-tests=pass $CARGO_FLAGS --color=always --manifest-path "$crate/Cargo.toml" $FEATURES + cargo build $CARGO_FLAGS --locked --manifest-path "$crate/Cargo.toml" $FEATURES + RUST_BACKTRACE=1 G_DEBUG=fatal_warnings cargo nextest run $CARGO_NEXTEST_FLAGS $CARGO_FLAGS --locked --manifest-path "$crate/Cargo.toml" $FEATURES new_report_dir="$parent/junit_reports/$crate" mkdir -p "$new_report_dir" @@ -34,6 +35,6 @@ if [ -n "$EXAMPLES_TUTORIALS" ]; then # List all features except windows/win32 EXAMPLES_FEATURES="--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition,gl,gst-gl-x11,gst-gl-egl,allocators,gst-play,gst-player,ges,image,cairo-rs,gst-video/v1_18" - cargo build $CARGO_FLAGS --locked --color=always --manifest-path examples/Cargo.toml --bins --examples "$EXAMPLES_FEATURES" - cargo build $CARGO_FLAGS --locked --color=always --manifest-path tutorials/Cargo.toml --bins --examples --all-features + cargo build $CARGO_FLAGS --locked --manifest-path examples/Cargo.toml --bins --examples "$EXAMPLES_FEATURES" + cargo build $CARGO_FLAGS --locked --manifest-path tutorials/Cargo.toml --bins --examples --all-features fi diff --git a/ci/run-clippy.sh b/ci/run-clippy.sh index dff60e021..cce143a6e 100755 --- a/ci/run-clippy.sh +++ b/ci/run-clippy.sh @@ -6,6 +6,9 @@ rustc --version cargo --version cargo clippy --version +cpus=$(nproc || sysctl -n hw.ncpu) +CARGO_FLAGS="--color=always -j${FDO_CI_CONCURRENT:-$cpus}" + # Keep features in sync with run-cargo-test.sh get_features() { crate=$1 @@ -25,7 +28,7 @@ for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do echo "Running clippy on $crate with $FEATURES" - cargo clippy --locked --color=always --manifest-path "$crate/Cargo.toml" $FEATURES --all-targets -- $CLIPPY_LINTS + cargo clippy $CARGO_FLAGS --locked --manifest-path "$crate/Cargo.toml" $FEATURES --all-targets -- $CLIPPY_LINTS fi done @@ -34,5 +37,5 @@ done EXAMPLES_FEATURES="--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition,gl,gst-gl-x11,gst-gl-egl,allocators,gst-play,gst-player,ges,image,cairo-rs,gst-video/v1_18" # And also run over all the examples/tutorials -cargo clippy --locked --color=always --manifest-path examples/Cargo.toml --all-targets "$EXAMPLES_FEATURES" -- $CLIPPY_LINTS -cargo clippy --locked --color=always --manifest-path tutorials/Cargo.toml --all-targets --all-features -- $CLIPPY_LINTS +cargo clippy $CARGO_FLAGS --locked --manifest-path examples/Cargo.toml --all-targets "$EXAMPLES_FEATURES" -- $CLIPPY_LINTS +cargo clippy $CARGO_FLAGS --locked --manifest-path tutorials/Cargo.toml --all-targets --all-features -- $CLIPPY_LINTS diff --git a/ci/run-sys-cargo-test.sh b/ci/run-sys-cargo-test.sh index 15951cb22..9cfda2748 100755 --- a/ci/run-sys-cargo-test.sh +++ b/ci/run-sys-cargo-test.sh @@ -6,14 +6,15 @@ rustc --version cargo --version cpus=$(nproc || sysctl -n hw.ncpu) -CARGO_FLAGS="-j${FDO_CI_CONCURRENT:-$cpus}" +CARGO_FLAGS="--color=always -j${FDO_CI_CONCURRENT:-$cpus}" +CARGO_NEXTEST_FLAGS="--profile=ci --no-tests=pass" parent="${CI_PROJECT_DIR:-$(pwd)}" for crate in gstreamer*/sys gstreamer-gl/*/sys; do if [ -e "$crate/Cargo.toml" ]; then echo "Building $crate with --all-features" - cargo build $CARGO_FLAGS --locked --color=always --manifest-path "$crate/Cargo.toml" --all-features + cargo build $CARGO_FLAGS --locked --manifest-path "$crate/Cargo.toml" --all-features fi done @@ -44,7 +45,7 @@ for crate in gstreamer/sys \ gstreamer-video/sys \ gstreamer-webrtc/sys; do echo "Testing $crate with --all-features)" - RUST_BACKTRACE=1 cargo nextest run --profile ci --no-tests=pass $CARGO_FLAGS --locked --color=always --manifest-path $crate/Cargo.toml --all-features + RUST_BACKTRACE=1 cargo nextest run $CARGO_NEXTEST_FLAGS $CARGO_FLAGS --locked --manifest-path $crate/Cargo.toml --all-features new_report_dir="$parent/junit_reports/$crate" mkdir -p "$new_report_dir" diff --git a/ci/run_windows_tests.ps1 b/ci/run_windows_tests.ps1 index 42342fca1..f7da7f806 100644 --- a/ci/run_windows_tests.ps1 +++ b/ci/run_windows_tests.ps1 @@ -52,6 +52,7 @@ else } Write-Host "Build Jobs: $ncpus" $cargo_opts = @("--color=always", "--jobs=$ncpus") +$cargo_nextest_opts=@("--profile=ci", "--no-fail-fast", "--no-tests=pass") function Move-Junit { param ( @@ -125,7 +126,7 @@ foreach($features in $features_matrix) { $env:G_DEBUG="fatal_warnings" $env:RUST_BACKTRACE="1" - cargo nextest run --profile=ci --no-fail-fast --no-tests=pass $cargo_opts --manifest-path $crate/Cargo.toml $env:LocalFeatures + cargo nextest run $cargo_nextest_opts $cargo_opts --manifest-path $crate/Cargo.toml $env:LocalFeatures if (!$?) { Write-Host "Tests failed to for crate: $crate" Exit 1