forked from mirrors/gstreamer-rs
We are caching the CARGO_HOME which includes git repos of the gtk-rs bindings. Since we don't specify a branch so it uses the default branch for the ref. cargo build usually does an update if it has network access, but its not guaranteed or the case for other tools like clippy which may still point to the stale git snapshot like here: https://gitlab.freedesktop.org/thaytan/gstreamer-rs/-/jobs/4165449
124 lines
3 KiB
YAML
124 lines
3 KiB
YAML
include:
|
|
- remote: "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/raw/master/ci/images_template.yml"
|
|
|
|
stages:
|
|
- "lint"
|
|
- "test"
|
|
- "extras"
|
|
|
|
.base:
|
|
image: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/10:$RUST_VERSION-$GST_RS_IMG_TAG"
|
|
variables:
|
|
# 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"
|
|
G_DEBUG: "fatal_warnings"
|
|
before_script:
|
|
- source ./ci/env.sh
|
|
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
|
|
# If cargo exists assume we probably will want to update the lockfile
|
|
- |
|
|
if command -v cargo; then
|
|
cargo generate-lockfile
|
|
cargo update
|
|
fi
|
|
cache:
|
|
key: "gst"
|
|
paths:
|
|
- "${CARGO_HOME}"
|
|
|
|
.img-stable:
|
|
extends: .base
|
|
variables:
|
|
RUST_VERSION: "stable"
|
|
|
|
.img-1-40:
|
|
extends: .base
|
|
variables:
|
|
RUST_VERSION: "1.40.0"
|
|
|
|
.img-nightly:
|
|
extends: .base
|
|
variables:
|
|
RUST_VERSION: "nightly"
|
|
|
|
.cargo test:
|
|
stage: "test"
|
|
script:
|
|
- rustc --version
|
|
- cargo --version
|
|
- cargo build --locked --all --color=always
|
|
# FIXME: tests are broken
|
|
# https://github.com/sdroege/gstreamer-sys/issues/16
|
|
# - cargo test --locked --all --color=always
|
|
- cargo build --locked --all --all-features --color=always
|
|
# FIXME: tests are broken
|
|
# https://github.com/sdroege/gstreamer-sys/issues/16
|
|
# - cargo test --locked --all --all-features --color=always
|
|
|
|
# Run tests for crates we can currently run. The others
|
|
# need a new release of the C library first
|
|
- |
|
|
for crate in gstreamer-app-sys \
|
|
gstreamer-audio-sys \
|
|
gstreamer-base-sys \
|
|
gstreamer-check-sys \
|
|
gstreamer-gl-sys \
|
|
gstreamer-mpegts-sys \
|
|
gstreamer-net-sys \
|
|
gstreamer-pbutils-sys \
|
|
gstreamer-player-sys \
|
|
gstreamer-rtsp-sys \
|
|
gstreamer-sdp-sys \
|
|
gstreamer-sys \
|
|
gstreamer-tag-sys \
|
|
gstreamer-video-sys \
|
|
gstreamer-webrtc-sys; \
|
|
do \
|
|
cargo test --locked -p $crate; \
|
|
done
|
|
|
|
test stable:
|
|
extends:
|
|
- '.cargo test'
|
|
- .img-stable
|
|
|
|
test 1.40:
|
|
extends:
|
|
- '.cargo test'
|
|
- .img-1-40
|
|
|
|
test nightly:
|
|
extends:
|
|
- '.cargo test'
|
|
- .img-nightly
|
|
|
|
rustfmt:
|
|
extends: .img-stable
|
|
stage: "lint"
|
|
script:
|
|
- cargo fmt --version
|
|
- cargo fmt -- --color=always --check
|
|
|
|
check commits:
|
|
extends: .img-stable
|
|
stage: "lint"
|
|
script:
|
|
- ci-fairy check-commits --textwidth 0 --no-signed-off-by
|
|
|
|
outdated:
|
|
extends: .img-stable
|
|
allow_failure: true
|
|
stage: 'extras'
|
|
only:
|
|
- schedules
|
|
script:
|
|
- cargo outdated --root-deps-only --exit-code 1 -v
|
|
|
|
deny:
|
|
extends: .img-stable
|
|
stage: 'extras'
|
|
only:
|
|
- schedules
|
|
script:
|
|
- cargo deny check
|