2020-01-02 06:12:21 +00:00
include : "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/master/gitlab/ci_template.yml"
2018-10-15 12:08:29 +00:00
2019-07-04 14:37:17 +00:00
.tarball_setup :
2018-10-15 12:08:29 +00:00
variables :
2019-07-04 14:37:17 +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"
2019-03-20 14:36:10 +00:00
SODIUM_USE_PKG_CONFIG : "true"
2018-10-15 12:08:29 +00:00
DEPENDENCIES : |
2019-10-12 14:26:50 +00:00
clang
2018-10-15 12:08:29 +00:00
curl
2019-03-20 14:36:10 +00:00
file
2019-10-12 14:26:50 +00:00
git
2019-03-20 14:36:10 +00:00
libsodium-dev
2018-10-15 12:08:29 +00:00
libssl-dev
liborc-0.4-dev
libglib2.0-dev
2019-04-22 06:43:43 +00:00
libgdk-pixbuf2.0-dev
libgtk-3-dev
2018-10-15 12:08:29 +00:00
libxml2-dev
libegl1-mesa
libgles2-mesa
libgl1-mesa-dri
libgl1-mesa-glx
libwayland-egl1-mesa
2019-10-12 14:26:50 +00:00
llvm
nasm
python3-pip
python3-setuptools
python3-wheel
2019-10-04 21:20:04 +00:00
xz-utils
2018-10-15 12:08:29 +00:00
before_script :
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends $DEPENDENCIES
2019-10-12 14:26:50 +00:00
- pip3 install --user meson ninja
- export PATH="$PATH:$HOME/.local/bin"
2018-10-15 12:08:29 +00:00
- mkdir -p precompiled-gst && cd precompiled-gst
2019-10-04 21:20:04 +00:00
- curl -L https://people.freedesktop.org/~slomo/gstreamer-1.16.1.tar.xz | tar xJ
2018-10-15 12:08:29 +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
2019-10-12 14:26:50 +00:00
# The build feature is required for the dav1d plugin for building and
# statically linking the C dav1d library into the dav1d-rs bindings.
# FIXME: The feature name should explicitly mention the dav1d plugin but
# Cargo currently doesn't support passthrough for that scenario.
- export RUSTFLAGS='--cfg feature="build"'
2018-10-15 12:08:29 +00:00
2019-07-04 14:37:17 +00:00
- cd "${CI_PROJECT_DIR}"
cache :
key : "gst"
paths :
- "${CARGO_HOME}"
.cargo test :
extends : '.tarball_setup'
2020-01-02 06:12:21 +00:00
stage : "build"
variables :
GIT_STRATEGY : 'fetch'
2018-10-15 12:08:29 +00:00
script :
2019-07-04 14:37:17 +00:00
- rustc --version
- cargo build --color=always --all
- G_DEBUG=fatal_warnings cargo test --color=always --all
- cargo build --color=always --all --examples --all-features
- G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features
2018-10-15 12:08:29 +00:00
2019-11-30 18:51:31 +00:00
test 1.39 :
2019-11-11 12:29:41 +00:00
# 1.39 img
2018-11-04 16:52:25 +00:00
# https://hub.docker.com/_/rust/
2019-11-30 18:51:31 +00:00
image : "rust:1.39-slim-buster"
extends : '.cargo test'
2018-10-15 12:08:29 +00:00
2019-11-30 18:51:31 +00:00
test stable :
2018-10-15 12:08:29 +00:00
# Stable img
# https://hub.docker.com/_/rust/
2019-10-04 21:20:04 +00:00
image : "rust:slim-buster"
2019-11-30 18:51:31 +00:00
extends : '.cargo test'
2018-10-15 12:08:29 +00:00
test nightly :
# Nightly
# https://hub.docker.com/r/rustlang/rust/
2019-10-04 21:20:04 +00:00
image : "rustlang/rust:nightly-buster-slim"
2018-10-15 12:08:29 +00:00
allow_failure : true
2019-07-04 14:37:17 +00:00
extends : '.cargo test'
2018-10-15 12:08:29 +00:00
rustfmt :
2019-10-04 21:20:04 +00:00
image : "rust:slim-buster"
2020-01-02 06:12:21 +00:00
stage : "preparation"
variables :
GIT_STRATEGY : 'fetch'
2018-10-15 12:08:29 +00:00
script :
2019-11-30 18:51:31 +00:00
- rustup component add rustfmt
2018-10-15 12:08:29 +00:00
- cargo fmt --version
- cargo fmt -- --color=always --check
2019-07-04 14:37:17 +00:00
clippy :
extends : '.tarball_setup'
2019-10-04 21:20:04 +00:00
image : "rust:slim-buster"
2020-01-02 06:12:21 +00:00
stage : 'test'
variables :
GIT_STRATEGY : 'fetch'
2019-07-04 14:37:17 +00:00
script :
2019-11-30 18:51:31 +00:00
- rustup component add clippy-preview
2019-12-22 08:20:18 +00:00
- cargo clippy --color=always --all --all-features --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless
2019-10-10 12:40:09 +00:00
audit :
extends : '.tarball_setup'
image : "rust:slim-buster"
2020-01-02 06:12:21 +00:00
stage : 'test'
variables :
GIT_STRATEGY : 'fetch'
2019-10-10 12:40:09 +00:00
only :
- schedules
script :
2019-10-21 11:14:10 +00:00
- cargo install --force cargo-audit
2019-10-10 12:40:09 +00:00
- cargo audit --deny-warnings