2020-04-14 12:10:42 +00:00
# We use https://gitlab.freedesktop.org/freedesktop/ci-templates
# to build the images used by the ci.
#
# Here is how to properly update thoses image:
# - new Rust stable version: update FDO_DISTRIBUTION_TAG
# - add dependencies: update FDO_DISTRIBUTION_PACKAGES and update FDO_DISTRIBUTION_TAG
# - update GStreamer version: update the tag in ci/install-gst.sh and update FDO_DISTRIBUTION_TAG
#
# Updating FDO_DISTRIBUTION_TAG is done by either:
# - setting it to the current date and the version suffix to 0
# - incrementing the version suffix
#
# After each update commit your changes and push to your personnal repo.
# After review and ci approval merge the branch as usual.
#
# Updating the nightly image should be done by simply running a scheduled ci
# pipeline on the upstream repo with the $UPDATE_NIGHTLY variable defined.
.templates_sha : &templates_sha acda94e139030dc2caa058118956225e55bbec5f
include :
- project : 'freedesktop/ci-templates'
ref : *templates_sha
file : '/templates/debian.yml'
variables :
FDO_UPSTREAM_REPO : gstreamer/gstreamer-rs
2018-10-08 06:46:47 +00:00
stages :
2020-04-14 12:10:42 +00:00
- "prep"
2018-10-08 09:03:42 +00:00
- "lint"
2018-11-04 14:32:17 +00:00
- "test"
2018-11-09 16:44:26 +00:00
- "extras"
2018-10-08 06:46:47 +00:00
2020-04-14 12:10:42 +00:00
.debian:10 :
2018-10-08 06:46:47 +00:00
variables :
2020-04-14 12:10:42 +00:00
FDO_DISTRIBUTION_VERSION : 10
FDO_DISTRIBUTION_TAG : '$RUST_VERSION-2020-04-16.0'
2018-11-09 16:36:36 +00:00
# Only stuff inside the repo directory can be cached
# Override the CARGO_HOME variable to force its location
CARGO_HOME : "${CI_PROJECT_DIR}/.cargo_home"
2018-10-08 06:46:47 +00:00
before_script :
2020-04-14 12:10:42 +00:00
- source ./ci/env.sh
.debian:10-stable :
extends : .debian:10
variables :
RUST_VERSION : "stable"
2018-10-08 08:47:44 +00:00
2020-04-14 12:10:42 +00:00
.debian:10-1-40 :
extends : .debian:10
variables :
RUST_VERSION : "1.40.0"
.debian:10-nightly :
extends : .debian:10
variables :
RUST_VERSION : "nightly"
2018-10-08 06:46:47 +00:00
2020-04-14 12:10:42 +00:00
.build-debian-container :
extends :
- .fdo.container-build@debian
stage : prep
variables :
FDO_DISTRIBUTION_PACKAGES : "build-essential curl liborc-0.4-dev libglib2.0-dev libxml2-dev libgtk-3-dev libegl1-mesa libgles2-mesa libgl1-mesa-dri libgl1-mesa-glx libwayland-egl1-mesa xz-utils libssl-dev git wget ca-certificates"
FDO_DISTRIBUTION_EXEC : 'bash ci/install-gst.sh && bash ci/install-rust.sh $RUST_VERSION'
build-stable :
extends :
- .build-debian-container
- .debian:10-stable
build-1-40 :
extends :
- .build-debian-container
- .debian:10-1-40
build-nightly :
extends :
- .build-debian-container
- .debian:10-nightly
update-nightly :
extends : build-nightly
only :
variables :
- $UPDATE_NIGHTLY == "1"
variables :
FDO_FORCE_REBUILD : 1
2018-11-09 16:36:36 +00:00
2020-04-14 12:10:42 +00:00
.dist-debian-container :
extends :
- .fdo.distribution-image@debian
2018-11-09 16:36:36 +00:00
cache :
key : "gst"
paths :
- "${CARGO_HOME}"
2020-04-14 12:10:42 +00:00
.img-stable :
extends :
- .dist-debian-container
- .debian:10-stable
.img-1-40 :
extends :
- .dist-debian-container
- .debian:10-1-40
.img-nightly :
extends :
- .dist-debian-container
- .debian:10-nightly
2019-05-02 15:51:22 +00:00
.cargo test :
2018-11-09 16:36:36 +00:00
stage : "test"
2018-10-08 06:46:47 +00:00
script :
- rustc --version
2019-08-13 14:24:19 +00:00
# First build and test all the crates with their relevant features
# Keep features in sync with below
- |
for crate in gstreamer*; do
if [ -n "$ALL_FEATURES" ]; then
if [ $crate = "gstreamer" ]; then
2019-11-11 10:56:20 +00:00
FEATURES=ser_de,v1_16
2019-08-13 14:24:19 +00:00
elif [ $crate = "gstreamer-gl" ]; then
FEATURES=egl,x11,wayland,v1_16
else
FEATURES=v1_16
fi
cargo build --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
cargo build --color=always --manifest-path $crate/Cargo.toml
G_DEBUG=fatal_warnings cargo test --color=always --manifest-path $crate/Cargo.toml
fi
done
2019-05-02 15:51:26 +00:00
2019-08-13 14:24:19 +00:00
# If we do a build with all features then also build the
# tutorials/examples with all features
2019-05-02 15:51:26 +00:00
- |
2019-07-04 14:28:15 +00:00
if [ -n "$ALL_FEATURES" ]; then
2019-08-13 14:24:19 +00:00
cargo build --color=always --manifest-path examples/Cargo.toml --bins --examples --all-features
cargo build --color=always --manifest-path tutorials/Cargo.toml --bins --examples --all-features
2019-05-02 15:51:26 +00:00
fi
2018-10-08 06:46:47 +00:00
2020-04-12 16:22:09 +00:00
test 1.40 :
2020-04-14 12:10:42 +00:00
extends :
- '.cargo test'
- .img-1-40
2018-10-08 06:46:47 +00:00
test stable :
2020-04-14 12:10:42 +00:00
extends :
- '.cargo test'
- .img-stable
2019-08-13 14:24:19 +00:00
test stable all-features :
2019-07-04 14:28:15 +00:00
variables :
ALL_FEATURES : 'yes'
2020-04-14 12:10:42 +00:00
extends :
- '.cargo test'
- .img-stable
2018-10-08 06:46:47 +00:00
test nightly :
2019-08-13 14:24:19 +00:00
allow_failure : true
2020-04-14 12:10:42 +00:00
extends :
- '.cargo test'
- .img-nightly
2019-08-13 14:24:19 +00:00
test nightly all-features :
2018-10-08 06:46:47 +00:00
allow_failure : true
2019-05-02 15:51:26 +00:00
variables :
2019-07-04 14:28:15 +00:00
ALL_FEATURES : 'yes'
2020-04-14 12:10:42 +00:00
extends :
- '.cargo test'
- .img-nightly
2018-10-08 09:03:42 +00:00
rustfmt :
2020-04-14 12:10:42 +00:00
extends : .img-stable
2018-10-08 09:03:42 +00:00
stage : "lint"
script :
- cargo fmt --version
- cargo fmt -- --color=always --check
2018-11-09 16:44:26 +00:00
clippy :
2020-04-14 12:10:42 +00:00
extends : .img-stable
2018-11-09 16:44:26 +00:00
stage : 'extras'
script :
- cargo clippy --version
2019-08-13 14:24:19 +00:00
# Keep features in sync with above
- |
for crate in gstreamer*; do
if [ $crate = "gstreamer" ]; then
2019-11-11 10:56:20 +00:00
FEATURES=ser_de,v1_16
2019-08-13 14:24:19 +00:00
elif [ $crate = "gstreamer-gl" ]; then
FEATURES=egl,x11,wayland,v1_16
else
FEATURES=v1_16
fi
2019-12-22 08:19:47 +00:00
cargo clippy --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
2019-08-13 14:24:19 +00:00
done
2019-09-07 10:08:09 +00:00
# And also run over all the examples/tutorials
- |
2019-12-22 08:19:47 +00:00
cargo clippy --color=always --manifest-path examples/Cargo.toml --all-targets --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc
cargo clippy --color=always --manifest-path tutorials/Cargo.toml --all-targets --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc
2019-10-08 10:36:30 +00:00
audit :
2020-04-14 12:10:42 +00:00
extends : .img-stable
2019-10-08 10:36:30 +00:00
stage : 'extras'
only :
- schedules
script :
- cargo audit --deny-warnings
2020-04-10 10:27:38 +00:00
2020-02-25 13:12:22 +00:00
gir-checks :
2020-04-14 12:10:42 +00:00
extends : .img-stable
2020-02-25 13:12:22 +00:00
stage : 'extras'
script :
2020-04-15 13:03:35 +00:00
- git clone --depth 1 https://github.com/gtk-rs/checker
2020-02-25 13:12:22 +00:00
- cd checker && echo '[workspace]' >> Cargo.toml
- cargo build --release
- |
cargo run --release -- \
--gir-file ../Gir_GstApp.toml ../gstreamer-app \
--gir-file ../Gir_GstAudio.toml ../gstreamer-audio/ \
--gir-file ../Gir_GstBase.toml ../gstreamer-base \
--gir-file ../Gir_GstCheck.toml ../gstreamer-check/ \
--gir-file ../Gir_GstEditingServices.toml ../gstreamer-editing-services/ \
--gir-file ../Gir_GstGL.toml ../gstreamer-gl/ \
--gir-file ../Gir_GstNet.toml ../gstreamer-net/ \
--gir-file ../Gir_GstPbutils.toml ../gstreamer-pbutils/ \
--gir-file ../Gir_GstPlayer.toml ../gstreamer-player/ \
--gir-file ../Gir_GstRtp.toml ../gstreamer-rtp/ \
--gir-file ../Gir_GstRtspServer.toml ../gstreamer-rtsp-server/ \
--gir-file ../Gir_GstRtsp.toml ../gstreamer-rtsp/ \
--gir-file ../Gir_GstSdp.toml ../gstreamer-sdp/ \
--gir-file ../Gir_Gst.toml ../gstreamer/ \
--gir-file ../Gir_GstVideo.toml ../gstreamer-video/ \
--gir-file ../Gir_GstWebRTC.toml ../gstreamer-webrtc/
2020-03-22 14:18:47 +00:00
- cd ..
- |
for crate in gstreamer*; do
echo '-->' $crate
(cd $crate && ../checker/check_init_asserts)
done
2020-02-25 13:12:22 +00:00
2020-04-10 10:27:38 +00:00
outdated :
2020-04-14 12:10:42 +00:00
extends : .img-stable
2020-04-13 08:44:58 +00:00
allow_failure : true
2020-04-10 10:27:38 +00:00
stage : 'extras'
only :
- schedules
script :
- cargo outdated --root-deps-only --exit-code 1 -v