ci: Set build jobs according to FDO_CI_CONCURRENT when available

The CI runners run multiple jobs concurrently, and as such we should
only be building with the number of jobs allocated to us when the
variable is set.

Related to https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1545

Also move the rest of the common flags we pass to cargo together so it's
a bit easier to read.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1795>
This commit is contained in:
Jordan Petridis 2024-09-20 14:59:33 +03:00 committed by GStreamer Marge Bot
parent 746acfc423
commit b8bc0609ba

View file

@ -95,13 +95,14 @@ trigger:
RUST_BACKTRACE: 'full'
script:
- rustc --version
- CARGO_FLAGS="-j${FDO_CI_CONCURRENT:-$(nproc)} --locked --color=always --all --all-targets"
- cargo build --locked --color=always --workspace --all-targets
- G_DEBUG=fatal_warnings cargo test --locked --color=always --workspace --all-targets
- cargo build --locked --color=always --workspace --all-targets --all-features --exclude gst-plugin-gtk4
- G_DEBUG=fatal_warnings cargo test --locked --color=always --workspace --all-targets --all-features --exclude gst-plugin-gtk4
- cargo build --locked --color=always --workspace --all-targets --no-default-features
- G_DEBUG=fatal_warnings cargo test --locked --color=always --workspace --all-targets --no-default-features
- cargo build $CARGO_FLAGS
- G_DEBUG=fatal_warnings cargo test $CARGO_FLAGS
- cargo build $CARGO_FLAGS --all-features --exclude gst-plugin-gtk4
- G_DEBUG=fatal_warnings cargo test $CARGO_FLAGS --all-features --exclude gst-plugin-gtk4
- cargo build $CARGO_FLAGS --no-default-features
- G_DEBUG=fatal_warnings cargo test $CARGO_FLAGS --no-default-features
test msrv:
extends:
@ -332,9 +333,10 @@ clippy:
# csound-sys only looks at /usr/lib and /usr/local top levels
CSOUND_LIB_DIR: '/usr/lib/x86_64-linux-gnu/'
script:
- cargo clippy --locked --color=always --all --all-targets -- -D warnings -A unknown-lints
- cargo clippy --locked --color=always --all --all-features --all-targets --exclude gst-plugin-gtk4 -- -D warnings -A unknown-lints
- cargo clippy --locked --color=always --all --all-targets --no-default-features -- -D warnings -A unknown-lints
- CARGO_FLAGS="-j${FDO_CI_CONCURRENT:-$(nproc)} --locked --color=always --all --all-targets"
- cargo clippy $CARGO_FLAGS -- -D warnings -A unknown-lints
- cargo clippy $CARGO_FLAGS --all-features --exclude gst-plugin-gtk4 -- -D warnings -A unknown-lints
- cargo clippy $CARGO_FLAGS --no-default-features -- -D warnings -A unknown-lints
deny:
extends: .debian:12-stable
@ -376,7 +378,9 @@ coverage:
# csound-sys only looks at /usr/lib and /usr/local top levels
CSOUND_LIB_DIR: '/usr/lib/x86_64-linux-gnu/'
script:
- cargo test --locked --color=always --all --all-features --exclude gst-plugin-gtk4
- CARGO_FLAGS="-j${FDO_CI_CONCURRENT:-$(nproc)} --locked --color=always --all"
- cargo test $CARGO_FLAGS --all-features --exclude gst-plugin-gtk4
# generate html report
- grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o ./coverage/
# generate cobertura report for gitlab integration