2018-10-08 06:46:47 +00:00
stages :
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
2019-05-02 15:51:22 +00:00
.tarball_setup :
2018-10-08 06:46:47 +00:00
variables :
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
DEPENDENCIES : |
curl
2019-04-23 15:47:50 +00:00
libssl-dev
liborc-0.4-dev
2018-10-08 06:46:47 +00:00
libglib2.0-dev
libxml2-dev
libgtk-3-dev
libegl1-mesa
libgles2-mesa
libgl1-mesa-dri
libgl1-mesa-glx
libwayland-egl1-mesa
before_script :
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends $DEPENDENCIES
2018-10-08 08:47:44 +00:00
2018-10-08 06:46:47 +00:00
- mkdir -p precompiled-gst && cd precompiled-gst
2019-04-23 15:47:50 +00:00
- curl -L https://people.freedesktop.org/~slomo/gstreamer-1.16.0.tar.gz | tar xz
2018-10-08 06:46:47 +00:00
- sed -i "s;prefix=/root/gstreamer;prefix=$PWD/gstreamer;g" $PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig/*.pc
- export PKG_CONFIG_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig
- export GST_PLUGIN_SYSTEM_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/gstreamer-1.0
- export GST_PLUGIN_SCANNER=$PWD/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
- export PATH=$PATH:$PWD/gstreamer/bin
- export LD_LIBRARY_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
2018-11-09 16:36:36 +00:00
- cd "${CI_PROJECT_DIR}"
cache :
key : "gst"
paths :
- "${CARGO_HOME}"
2019-05-02 15:51:22 +00:00
.cargo test :
extends : '.tarball_setup'
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-09-09 07:40:54 +00:00
FEATURES=futures,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
2019-07-10 08:21:53 +00:00
test 1.36 :
# 1.36 img
2018-11-04 16:43:07 +00:00
# https://hub.docker.com/_/rust/
2019-07-10 08:21:53 +00:00
image : "rust:1.36-slim"
2019-05-02 15:51:22 +00:00
extends : '.cargo test'
2018-10-08 06:46:47 +00:00
test stable :
2019-08-13 14:24:19 +00:00
# Stable img
# https://hub.docker.com/_/rust/
image : "rust:slim"
extends : '.cargo test'
test stable all-features :
2018-10-08 06:46:47 +00:00
# Stable img
# https://hub.docker.com/_/rust/
image : "rust:slim"
2019-07-04 14:28:15 +00:00
variables :
ALL_FEATURES : 'yes'
2019-05-02 15:51:22 +00:00
extends : '.cargo test'
2018-10-08 06:46:47 +00:00
test nightly :
2019-08-13 14:24:19 +00:00
# Nightly
# https://hub.docker.com/r/rustlang/rust/
image : "rustlang/rust:nightly-slim"
allow_failure : true
extends : '.cargo test'
test nightly all-features :
2018-10-08 06:46:47 +00:00
# Nightly
# https://hub.docker.com/r/rustlang/rust/
image : "rustlang/rust:nightly-slim"
allow_failure : true
2019-05-02 15:51:26 +00:00
variables :
2019-07-04 14:28:15 +00:00
ALL_FEATURES : 'yes'
2019-05-02 15:51:22 +00:00
extends : '.cargo test'
2018-10-08 09:03:42 +00:00
rustfmt :
2019-01-16 15:01:29 +00:00
image : "rust:slim"
2018-10-08 09:03:42 +00:00
stage : "lint"
script :
2018-12-09 17:33:17 +00:00
- rustup component add rustfmt
2018-10-08 09:03:42 +00:00
- cargo fmt --version
- cargo fmt -- --color=always --check
2018-11-09 16:44:26 +00:00
clippy :
2019-05-02 15:51:22 +00:00
extends : '.tarball_setup'
2019-07-04 14:28:15 +00:00
image : "rust:slim"
2018-11-09 16:44:26 +00:00
stage : 'extras'
script :
- rustup component add clippy-preview
- 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-09-09 07:40:54 +00:00
FEATURES=futures,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-09-07 10:08:09 +00:00
cargo clippy --color=always --manifest-path $crate/Cargo.toml --features=$FEATURES -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless
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
- |
cargo clippy --color=always --manifest-path examples/Cargo.toml --bins --examples --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless
cargo clippy --color=always --manifest-path tutorials/Cargo.toml --bins --examples --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless