mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-18 16:28:25 +00:00
ci: use fdo template
Build our own images based on the ones used by gstreamer-rs ci. Fix #109 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/321>
This commit is contained in:
parent
957aac94ae
commit
54586c6ecc
166
.gitlab-ci.yml
166
.gitlab-ci.yml
|
@ -1,67 +1,103 @@
|
||||||
|
.templates_sha: &templates_sha 8becba49be7e5886311972356345532ed9dd84c1
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- "prep"
|
||||||
- "lint"
|
- "lint"
|
||||||
- "test"
|
- "test"
|
||||||
- "extras"
|
- "extras"
|
||||||
|
|
||||||
.tarball_setup:
|
.debian:10:
|
||||||
variables:
|
variables:
|
||||||
|
FDO_DISTRIBUTION_VERSION: 10
|
||||||
|
FDO_DISTRIBUTION_TAG: '$RUST_VERSION-${GST_RS_IMG_TAG}_2020-04-27.0'
|
||||||
# Only stuff inside the repo directory can be cached
|
# Only stuff inside the repo directory can be cached
|
||||||
# Override the CARGO_HOME variable to force its location
|
# Override the CARGO_HOME variable to force its location
|
||||||
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo_home"
|
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo_home"
|
||||||
SODIUM_USE_PKG_CONFIG: "true"
|
FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/10:$RUST_VERSION-$GST_RS_IMG_TAG"
|
||||||
DEPENDENCIES: |
|
|
||||||
clang
|
|
||||||
curl
|
|
||||||
file
|
|
||||||
git
|
|
||||||
libsodium-dev
|
|
||||||
libssl-dev
|
|
||||||
liborc-0.4-dev
|
|
||||||
libglib2.0-dev
|
|
||||||
libgdk-pixbuf2.0-dev
|
|
||||||
libgtk-3-dev
|
|
||||||
libxml2-dev
|
|
||||||
libegl1-mesa
|
|
||||||
libgles2-mesa
|
|
||||||
libgl1-mesa-dri
|
|
||||||
libgl1-mesa-glx
|
|
||||||
libwayland-egl1-mesa
|
|
||||||
llvm
|
|
||||||
nasm
|
|
||||||
libcsound64-dev
|
|
||||||
python3-pip
|
|
||||||
python3-setuptools
|
|
||||||
python3-wheel
|
|
||||||
xz-utils
|
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get update -yqq
|
- source ./ci/env.sh
|
||||||
- apt-get install -yqq --no-install-recommends $DEPENDENCIES
|
|
||||||
- pip3 install --user meson ninja
|
|
||||||
- export PATH="$PATH:$HOME/.local/bin"
|
|
||||||
|
|
||||||
- mkdir -p precompiled-gst && cd precompiled-gst
|
|
||||||
|
|
||||||
- curl -L https://people.freedesktop.org/~slomo/gstreamer-1.16.1.tar.xz | tar xJ
|
|
||||||
- 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
|
|
||||||
# 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"'
|
|
||||||
- cd "${CI_PROJECT_DIR}"
|
|
||||||
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
|
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
|
||||||
|
|
||||||
|
.debian:10-stable:
|
||||||
|
extends: .debian:10
|
||||||
|
variables:
|
||||||
|
RUST_VERSION: "stable"
|
||||||
|
|
||||||
|
.debian:10-1-40:
|
||||||
|
extends: .debian:10
|
||||||
|
variables:
|
||||||
|
RUST_VERSION: "1.40.0"
|
||||||
|
|
||||||
|
.debian:10-nightly:
|
||||||
|
extends: .debian:10
|
||||||
|
variables:
|
||||||
|
RUST_VERSION: "nightly"
|
||||||
|
|
||||||
|
.build-debian-container:
|
||||||
|
extends:
|
||||||
|
- .fdo.container-build@debian
|
||||||
|
stage: prep
|
||||||
|
variables:
|
||||||
|
FDO_DISTRIBUTION_PACKAGES: "libcsound64-dev llvm clang nasm libsodium-dev"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
.dist-debian-container:
|
||||||
|
extends:
|
||||||
|
- .fdo.distribution-image@debian
|
||||||
cache:
|
cache:
|
||||||
key: "gst"
|
key: "gst"
|
||||||
paths:
|
paths:
|
||||||
- "${CARGO_HOME}"
|
- "${CARGO_HOME}"
|
||||||
|
variables:
|
||||||
|
SODIUM_USE_PKG_CONFIG: "true"
|
||||||
|
# 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.
|
||||||
|
RUSTFLAGS: "--cfg feature=\"build\""
|
||||||
|
after_script:
|
||||||
|
- rm -rf target
|
||||||
|
|
||||||
|
.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
|
||||||
|
|
||||||
.cargo test:
|
.cargo test:
|
||||||
extends: '.tarball_setup'
|
|
||||||
stage: "test"
|
stage: "test"
|
||||||
script:
|
script:
|
||||||
- rustc --version
|
- rustc --version
|
||||||
|
@ -71,57 +107,47 @@ stages:
|
||||||
- G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features
|
- G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features
|
||||||
|
|
||||||
test 1.40:
|
test 1.40:
|
||||||
# 1.40 img
|
extends:
|
||||||
# https://hub.docker.com/_/rust/
|
- '.cargo test'
|
||||||
image: "rust:1.40-slim-buster"
|
- .img-1-40
|
||||||
extends: '.cargo test'
|
|
||||||
|
|
||||||
test stable:
|
test stable:
|
||||||
# Stable img
|
extends:
|
||||||
# https://hub.docker.com/_/rust/
|
- '.cargo test'
|
||||||
image: "rust:slim-buster"
|
- .img-stable
|
||||||
extends: '.cargo test'
|
|
||||||
|
|
||||||
test nightly:
|
test nightly:
|
||||||
# Nightly
|
|
||||||
# https://hub.docker.com/r/rustlang/rust/
|
|
||||||
image: "rustlang/rust:nightly-buster-slim"
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
extends: '.cargo test'
|
extends:
|
||||||
|
- '.cargo test'
|
||||||
|
- .img-nightly
|
||||||
|
|
||||||
rustfmt:
|
rustfmt:
|
||||||
image: "rust:slim-buster"
|
extends: .img-stable
|
||||||
stage: "lint"
|
stage: "lint"
|
||||||
script:
|
script:
|
||||||
- rustup component add rustfmt
|
|
||||||
- cargo fmt --version
|
- cargo fmt --version
|
||||||
- cargo fmt -- --color=always --check
|
- cargo fmt -- --color=always --check
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
extends: '.tarball_setup'
|
extends: .img-stable
|
||||||
image: "rust:slim-buster"
|
|
||||||
stage: 'extras'
|
stage: 'extras'
|
||||||
script:
|
script:
|
||||||
- rustup component add clippy-preview
|
|
||||||
- cargo clippy --color=always --all --all-features --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -D warnings
|
- cargo clippy --color=always --all --all-features --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -D warnings
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
extends: '.tarball_setup'
|
extends: .img-stable
|
||||||
image: "rust:slim-buster"
|
|
||||||
stage: 'extras'
|
stage: 'extras'
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
script:
|
script:
|
||||||
- cargo install --force cargo-audit
|
|
||||||
- cargo audit --deny-warnings
|
- cargo audit --deny-warnings
|
||||||
|
|
||||||
outdated:
|
outdated:
|
||||||
extends: '.tarball_setup'
|
extends: .img-stable
|
||||||
image: "rust:slim-buster"
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
stage: 'extras'
|
stage: 'extras'
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
script:
|
script:
|
||||||
- cargo install --force --git https://github.com/kbknapp/cargo-outdated
|
|
||||||
- cargo outdated --root-deps-only --exit-code 1 -v
|
- cargo outdated --root-deps-only --exit-code 1 -v
|
||||||
|
|
8
ci/env.sh
Normal file
8
ci/env.sh
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
export RUSTUP_HOME='/usr/local/rustup'
|
||||||
|
export PATH=$PATH:/usr/local/cargo/bin
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig
|
||||||
|
export GST_PLUGIN_SYSTEM_PATH=/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0
|
||||||
|
export GST_PLUGIN_SCANNER=/usr/local/libexec/gstreamer-1.0/gst-plugin-scanner
|
||||||
|
export PATH=$PATH:/usr/local/bin
|
||||||
|
export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
|
Loading…
Reference in a new issue