gst-plugins-rs/.gitlab-ci.yml
2024-04-19 19:09:27 +02:00

119 lines
5.8 KiB
YAML

.templates_sha: &templates_sha fddab8aa63e89a8e65214f59860d9c0f030360c9
include:
- project: 'freedesktop/ci-templates'
ref: *templates_sha
file: '/templates/debian.yml'
- project: 'gstreamer/gstreamer-rs'
ref: main
file: '/ci/images_template.yml'
- project: 'gstreamer/gstreamer'
ref: main
file: '/.gitlab-image-tags.yml'
variables:
FDO_UPSTREAM_REPO: gstreamer/gstreamer-rs
# We use GStreamer image to build the documentation as it is the simplest way
# to ensure that we are testing against the same thing as GStreamer itself.
# The tag name is included above from the main repo.
GSTREAMER_DOC_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer/amd64/fedora:$FEDORA_TAG-main"
# Use the gstreamer image to trigger the cerbero job, same as the monorepo
CERBERO_TRIGGER_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer/amd64/fedora:$FEDORA_TAG-main"
WINDOWS_BASE: "registry.freedesktop.org/gstreamer/gstreamer-rs/windows"
WINDOWS_RUST_MINIMUM_IMAGE: "$WINDOWS_BASE:$GST_RS_IMG_TAG-main-$GST_RS_MSRV"
WINDOWS_RUST_STABLE_IMAGE: "$WINDOWS_BASE:$GST_RS_IMG_TAG-main-$GST_RS_STABLE"
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
# don't create a pipeline if its a commit pipeline, on a branch and that branch has
# open merge requests (bc we will get a MR build instead)
- if: $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
default:
interruptible: true
stages:
- "test"
.macos:arm64:
image: "registry.freedesktop.org/gstreamer/cerbero/macos-arm64/14-sonoma:2023-10-25.2"
tags:
- 'gst-mac-arm'
.macos:arm64-stable:
extends: .macos:arm64
after_script:
- rm -rf target
before_script:
- CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> $HOME/.zprofile
- eval "$(/opt/homebrew/bin/brew shellenv)"
- CI=1 brew install pkg-config
- export GST_VERSION=1.24.2
- curl --proto '=https' --tlsv1.2 -o gstreamer-1.0-${GST_VERSION}-universal.pkg -sSf https://gstreamer.freedesktop.org/data/pkg/osx/${GST_VERSION}/gstreamer-1.0-${GST_VERSION}-universal.pkg
- curl --proto '=https' --tlsv1.2 -o gstreamer-1.0-devel-${GST_VERSION}-universal.pkg -sSf https://gstreamer.freedesktop.org/data/pkg/osx/${GST_VERSION}/gstreamer-1.0-devel-${GST_VERSION}-universal.pkg
- sudo installer -pkg gstreamer-1.0-${GST_VERSION}-universal.pkg -target /
- sudo installer -pkg gstreamer-1.0-devel-${GST_VERSION}-universal.pkg -target /
- export PKG_CONFIG_PATH=/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig:$PKG_CONFIG_PATH
- export DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/GStreamer.framework/Versions/1.0/lib:$DYLD_FALLBACK_LIBRARY_PATH
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- echo -e "[net]\ngit-fetch-with-cli = true" > $HOME/.cargo/config
- source "$HOME/.cargo/env"
test macos-arm64 stable:
extends: '.macos:arm64-stable'
stage: 'test'
#needs:
# - 'trigger'
script:
- rustc --version
# Package exclusion list:
# * csound: macOS support was added after latest csound-sys release.
# see https://github.com/neithanmo/csound-rs/commit/797fc49d6ddf5e78f8f2d609baab5d46e5f2ca5f
# * dav1d: gstreamer-1.0-devel-1.24.2-universal.pkg comes with version
# 1.1.0 (via gstreamer-1.0-codecs). dav1d-rs requires >= 1.3.0.
# brew provides a suitable version but it would conflict with gstreamer's.
# * gtk4: gstreamer-1.0-devel-1.24.2-universal.pkg comes with glib-2.0 in
# version 2.74.4 but gtk4-rs requires >= 2.76.0.
# brew provides a suitable version but it would conflict with gstreamer's.
# Also exclude examples which use gst-plugin-gtk4:
# * gtk-livesync from gst-plugin-livesync
# * gtk-recording from gst-plugin-togglerecord
# * gtk-fallbackswitch from gst-plugin-fallbackswitch
# Note for later: gst-plugin-gtk4 can't be compiled with
# --all-feautes because brew doesn't provide X11 nor Wayland versions.
- export EXCLUSION_LIST=(gst-plugin-csound gst-plugin-dav1d gst-plugin-gtk4 gst-plugin-livesync gst-plugin-togglerecord gst-plugin-fallbackswitch)
# Packages for which we can't check --examples nor --all-features
- export NO_EXAMPLES_LIST=(gst-plugin-livesync gst-plugin-togglerecord gst-plugin-fallbackswitch)
- export EXCLUDE_ARGS=(`for p in ${EXCLUSION_LIST[@]}; do printf " --exclude %s" $p; done`)
- export NO_EXAMPLES_P_ARGS=(`for p in ${NO_EXAMPLES_LIST[@]}; do printf " -p %s" $p; done`)
- cargo build --locked --workspace ${EXCLUDE_ARGS[@]} --all-targets --color=always
- G_DEBUG=fatal_warnings cargo test --locked --workspace ${EXCLUDE_ARGS[@]} --all-targets --color=always
- cargo build --locked ${NO_EXAMPLES_P_ARGS[@]} --lib --bins --tests --benches --color=always
- G_DEBUG=fatal_warnings cargo test --locked ${NO_EXAMPLES_P_ARGS[@]} --lib --bins --tests --benches --color=always
# --all-features
- cargo build --locked --workspace ${EXCLUDE_ARGS[@]} --all-targets --all-features --color=always
- G_DEBUG=fatal_warnings cargo test --locked --workspace ${EXCLUDE_ARGS[@]} --all-targets --all-features --color=always
# --no-default-features
- cargo build --keep-going --locked --workspace ${EXCLUDE_ARGS[@]} --all-targets --no-default-features --color=always
- G_DEBUG=fatal_warnings cargo test --locked --workspace ${EXCLUDE_ARGS[@]} --all-targets --no-default-features --color=always
- cargo build --locked ${NO_EXAMPLES_P_ARGS[@]} --lib --bins --tests --benches --no-default-features --color=always
- G_DEBUG=fatal_warnings cargo test --locked ${NO_EXAMPLES_P_ARGS[@]} --lib --bins --tests --benches --no-default-features --color=always