2021-08-16 15:43:09 +00:00
.templates_sha : &templates_sha 567700e483aabed992d0a4fea84994a0472deff6
2020-04-21 10:19:38 +00:00
include :
- project : 'freedesktop/ci-templates'
ref : *templates_sha
file : '/templates/debian.yml'
- remote : "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/raw/master/ci/images_template.yml"
variables :
FDO_UPSTREAM_REPO : gstreamer/gst-plugins-rs
2020-03-19 09:39:52 +00:00
stages :
2020-04-21 10:19:38 +00:00
- "prep"
2020-03-19 09:39:52 +00:00
- "lint"
- "test"
- "extras"
2018-10-15 12:08:29 +00:00
2021-08-16 15:43:09 +00:00
.debian:11 :
2018-10-15 12:08:29 +00:00
variables :
2021-08-16 15:43:09 +00:00
FDO_DISTRIBUTION_VERSION : 'bullseye-slim'
2018-10-15 12:08:29 +00:00
before_script :
2020-04-21 10:19:38 +00:00
- source ./ci/env.sh
2020-04-21 09:52:09 +00:00
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
2020-08-21 02:29:35 +00:00
# If cargo exists assume we probably will want to update
# the lockfile
- |
if command -v cargo; then
cargo generate-lockfile
cargo update
fi
2020-04-21 10:19:38 +00:00
2021-08-16 15:43:09 +00:00
.debian:11-stable :
extends : .debian:11
2020-04-21 10:19:38 +00:00
variables :
2021-08-16 15:43:09 +00:00
FDO_DISTRIBUTION_TAG : '$GST_RS_STABLE-${GST_RS_IMG_TAG}_2021-08-16.0'
FDO_BASE_IMAGE : "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:$GST_RS_STABLE-$GST_RS_IMG_TAG"
2020-04-21 10:19:38 +00:00
2021-08-16 15:43:09 +00:00
.debian:11-msrv :
extends : .debian:11
2020-04-21 10:19:38 +00:00
variables :
2021-08-16 15:43:09 +00:00
FDO_DISTRIBUTION_TAG : '$GST_RS_MSRV-${GST_RS_IMG_TAG}_2021-08-16.0'
FDO_BASE_IMAGE : "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:$GST_RS_MSRV-$GST_RS_IMG_TAG"
2020-04-21 10:19:38 +00:00
2021-08-16 15:43:09 +00:00
.debian:11-nightly :
extends : .debian:11
2020-04-21 10:19:38 +00:00
variables :
2021-08-16 15:43:09 +00:00
FDO_DISTRIBUTION_TAG : 'nightly-${GST_RS_IMG_TAG}_2021-08-16.0'
FDO_BASE_IMAGE : "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:nightly-$GST_RS_IMG_TAG"
2020-04-21 10:19:38 +00:00
.build-debian-container :
extends :
- .fdo.container-build@debian
stage : prep
variables :
FDO_DISTRIBUTION_PACKAGES : "libcsound64-dev llvm clang nasm libsodium-dev"
2021-01-04 09:23:22 +00:00
FDO_DISTRIBUTION_EXEC : >-
bash ci/install-dav1d.sh &&
apt clean &&
2021-01-04 15:03:44 +00:00
bash ./ci/install-rust-ext.sh
2020-04-22 06:33:36 +00:00
rules :
- if : '$UPDATE_IMG == null'
2020-04-21 10:19:38 +00:00
build-stable :
extends :
- .build-debian-container
2021-08-16 15:43:09 +00:00
- .debian:11-stable
2020-04-21 10:19:38 +00:00
2020-11-01 10:13:36 +00:00
build-msrv :
2020-04-21 10:19:38 +00:00
extends :
- .build-debian-container
2021-08-16 15:43:09 +00:00
- .debian:11-msrv
2020-04-21 10:19:38 +00:00
build-nightly :
extends :
- .build-debian-container
2021-08-16 15:43:09 +00:00
- .debian:11-nightly
2020-04-21 10:19:38 +00:00
2020-04-22 06:33:36 +00:00
# Those jobs are triggered by gstreamer-rs when updating its images
update-stable :
extends : build-stable
rules :
- if : '$UPDATE_IMG == "stable"'
variables :
FDO_FORCE_REBUILD : 1
2020-11-01 10:13:36 +00:00
update-msrv :
extends : build-msrv
2020-04-22 06:33:36 +00:00
rules :
2020-11-01 10:13:36 +00:00
- if : '$UPDATE_IMG == "msrv"'
2020-04-22 06:33:36 +00:00
variables :
FDO_FORCE_REBUILD : 1
update-nightly :
extends : build-nightly
rules :
- if : '$UPDATE_IMG == "nightly"'
variables :
FDO_FORCE_REBUILD : 1
2020-04-21 10:19:38 +00:00
.dist-debian-container :
extends :
- .fdo.distribution-image@debian
variables :
SODIUM_USE_PKG_CONFIG : "true"
after_script :
- rm -rf target
.img-stable :
extends :
- .dist-debian-container
2021-08-16 15:43:09 +00:00
- .debian:11-stable
2020-04-21 10:19:38 +00:00
2020-11-01 10:13:36 +00:00
.img-msrv :
2020-04-21 10:19:38 +00:00
extends :
- .dist-debian-container
2021-08-16 15:43:09 +00:00
- .debian:11-msrv
2020-04-21 10:19:38 +00:00
.img-nightly :
extends :
- .dist-debian-container
2021-08-16 15:43:09 +00:00
- .debian:11-nightly
2019-07-04 14:37:17 +00:00
.cargo test :
2020-03-19 09:39:52 +00:00
stage : "test"
2021-08-16 15:43:09 +00:00
variables :
# csound-sys only looks at /usr/lib and /usr/local top levels
CSOUND_LIB_DIR : '/usr/lib/x86_64-linux-gnu/'
2018-10-15 12:08:29 +00:00
script :
2019-07-04 14:37:17 +00:00
- rustc --version
2020-08-21 02:29:35 +00:00
- cargo build --locked --color=always --all
- G_DEBUG=fatal_warnings cargo test --locked --color=always --all
- cargo build --locked --color=always --all --examples --all-features
- G_DEBUG=fatal_warnings cargo test --locked --color=always --all --examples --all-features
2018-10-15 12:08:29 +00:00
2020-11-01 10:13:36 +00:00
test msrv :
2020-04-21 10:19:38 +00:00
extends :
- '.cargo test'
2020-11-01 10:13:36 +00:00
- .img-msrv
2020-04-22 06:33:36 +00:00
rules :
2020-11-01 10:13:36 +00:00
- if : '$UPDATE_IMG == null || $UPDATE_IMG == "msrv"'
2018-10-15 12:08:29 +00:00
2019-11-30 18:51:31 +00:00
test stable :
2020-04-21 10:19:38 +00:00
extends :
- '.cargo test'
- .img-stable
2020-04-22 06:33:36 +00:00
rules :
- if : '$UPDATE_IMG == null || $UPDATE_IMG == "stable"'
2018-10-15 12:08:29 +00:00
test nightly :
allow_failure : true
2020-04-21 10:19:38 +00:00
extends :
- '.cargo test'
- .img-nightly
2020-04-22 06:33:36 +00:00
rules :
- if : '$UPDATE_IMG == null || $UPDATE_IMG == "nightly"'
2018-10-15 12:08:29 +00:00
2021-05-26 09:07:27 +00:00
.meson :
2020-11-18 14:12:34 +00:00
extends : .img-stable
2021-05-26 09:07:27 +00:00
rules :
- if : '$UPDATE_IMG == null || $UPDATE_IMG == "stable"'
variables :
2021-08-16 15:43:09 +00:00
# csound-sys only looks at /usr/lib and /usr/local top levels
CSOUND_LIB_DIR : '/usr/lib/x86_64-linux-gnu/'
2021-05-26 09:07:27 +00:00
meson shared :
extends : .meson
2020-11-18 14:12:34 +00:00
script :
2020-11-18 14:53:01 +00:00
- meson build --default-library=shared --prefix=$(pwd)/install
- ninja -C build install
- ./ci/check-plugins-installed.py install
2020-11-18 14:12:34 +00:00
meson static :
2021-05-26 09:07:27 +00:00
extends : .meson
2020-11-18 14:12:34 +00:00
script :
2020-11-27 12:44:04 +00:00
- meson build --default-library=static --prefix=$(pwd)/install -Dsodium=built-in
- ninja -C build install
- ./ci/generate-static-test.py test-static-link-all
- cd test-static-link-all
- PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(pwd)/../install/lib/x86_64-linux-gnu/pkgconfig meson build
2020-11-18 14:12:34 +00:00
- ninja -C build
2020-11-27 12:44:04 +00:00
- ./build/test-gst-static
2020-11-18 14:12:34 +00:00
2018-10-15 12:08:29 +00:00
rustfmt :
2020-04-21 10:19:38 +00:00
extends : .img-stable
2020-03-19 09:39:52 +00:00
stage : "lint"
2020-04-30 16:19:48 +00:00
rules :
- when : 'always'
2018-10-15 12:08:29 +00:00
script :
- cargo fmt --version
- cargo fmt -- --color=always --check
2019-07-04 14:37:17 +00:00
2020-06-11 13:17:33 +00:00
check commits :
extends : .img-stable
stage : "lint"
rules :
- when : 'always'
script :
- ci-fairy check-commits --textwidth 0 --no-signed-off-by
2019-07-04 14:37:17 +00:00
clippy :
2020-04-21 10:19:38 +00:00
extends : .img-stable
2020-03-19 09:39:52 +00:00
stage : 'extras'
2021-08-16 15:43:09 +00:00
variables :
# csound-sys only looks at /usr/lib and /usr/local top levels
CSOUND_LIB_DIR : '/usr/lib/x86_64-linux-gnu/'
2020-04-30 16:19:48 +00:00
rules :
- when : 'always'
2019-07-04 14:37:17 +00:00
script :
2021-06-04 20:32:54 +00:00
- cargo clippy --locked --color=always --all --all-features --all-targets -- -A clippy::single_match -A clippy::manual_range_contains -A clippy::upper_case_acronyms -A clippy::blocks-in-if-conditions -D warnings
2019-10-10 12:40:09 +00:00
2020-04-16 11:03:28 +00:00
deny :
2020-04-21 10:19:38 +00:00
extends : .img-stable
2020-03-19 09:39:52 +00:00
stage : 'extras'
2020-04-30 16:11:25 +00:00
rules :
- if : '$CI_PIPELINE_SOURCE == "schedule"'
2019-10-10 12:40:09 +00:00
script :
2020-04-16 11:03:28 +00:00
- cargo deny check
2019-11-21 08:15:36 +00:00
outdated :
2020-04-21 10:19:38 +00:00
extends : .img-stable
2020-04-14 08:49:14 +00:00
allow_failure : true
2019-11-21 08:15:36 +00:00
stage : 'extras'
2020-04-30 16:11:25 +00:00
rules :
- if : '$CI_PIPELINE_SOURCE == "schedule"'
2019-11-21 08:15:36 +00:00
script :
- cargo outdated --root-deps-only --exit-code 1 -v
2021-01-11 15:26:57 +00:00
coverage :
2021-04-22 08:25:00 +00:00
allow_failure : true
2021-01-11 15:26:57 +00:00
extends :
- .img-nightly
stage : 'extras'
rules :
- when : 'always'
variables :
RUSTFLAGS : "-Zinstrument-coverage"
LLVM_PROFILE_FILE : "gst-plugins-rs-%p-%m.profraw"
2021-08-16 15:43:09 +00:00
# csound-sys only looks at /usr/lib and /usr/local top levels
CSOUND_LIB_DIR : '/usr/lib/x86_64-linux-gnu/'
2021-01-11 15:26:57 +00:00
script :
- cargo test --locked --color=always --all-features
# generate html report
2021-04-23 12:19:53 +00:00
- grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o ./coverage/
2021-01-11 15:26:57 +00:00
# generate cobertura report for gitlab integration
2021-04-23 12:19:53 +00:00
- grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o coverage.xml
# output coverage summary for gitlab parsing.
# TODO: use grcov once https://github.com/mozilla/grcov/issues/556 is fixed
- grep "%" coverage/index.html | head -1 || true
2021-01-11 15:26:57 +00:00
artifacts :
paths :
- 'coverage'
reports :
cobertura : coverage.xml