mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-11-15 21:31:03 +00:00
196 lines
5.4 KiB
YAML
196 lines
5.4 KiB
YAML
include:
|
|
- project: "freedesktop/ci-templates" # the project to include from
|
|
ref: "34f4ade99434043f88e164933f570301fd18b125" # git ref of that project
|
|
file: "/templates/fedora.yml" # the actual file to include
|
|
- local: "ci/images_template.yml"
|
|
|
|
stages:
|
|
- prepare
|
|
- lint
|
|
- test
|
|
- release
|
|
|
|
variables:
|
|
FDO_UPSTREAM_REPO: "dabrain34/GstPipelineStudio"
|
|
GNOME_RUNTIME_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:41"
|
|
WINDOWS_RUST_STABLE_IMAGE: "$CI_REGISTRY_IMAGE/windows:$GST_RS_IMG_TAG-main-$GST_RS_STABLE"
|
|
WINDOWS_RUST_STABLE_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/windows:$GST_RS_IMG_TAG-main-$GST_RS_STABLE"
|
|
|
|
# Version and tag for our current container
|
|
.fedora:
|
|
variables:
|
|
FDO_DISTRIBUTION_VERSION: "36"
|
|
# Update this to trigger a container rebuild
|
|
FDO_DISTRIBUTION_TAG: "2023-02-13.1"
|
|
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 --color=always
|
|
# cargo update --color=always
|
|
# fi
|
|
|
|
build-fedora-container:
|
|
extends:
|
|
- .fedora # our template job above
|
|
- .fdo.container-build@fedora@x86_64 # the CI template
|
|
stage: prepare
|
|
variables:
|
|
# clang-devel: required by rust bindgen
|
|
FDO_DISTRIBUTION_PACKAGES: >-
|
|
gtk4-devel
|
|
clang-devel
|
|
gstreamer1-devel
|
|
gstreamer1-plugins-base-devel
|
|
gstreamer1-plugins-bad-free-devel
|
|
ninja-build
|
|
pkg-config
|
|
python3-devel
|
|
python3-pip
|
|
python3-setuptools
|
|
util-linux
|
|
xorg-x11-server-Xvfb
|
|
wget
|
|
git
|
|
FDO_DISTRIBUTION_EXEC: >-
|
|
ci/install-rust.sh stable &&
|
|
pip3 install meson
|
|
|
|
.windows rust docker build:
|
|
stage: prepare
|
|
variables:
|
|
# Unlike the buildah/linux jobs, this file
|
|
# needs to be relative to windows-docker/ subdir
|
|
# as it makes life easier in the powershell script
|
|
#
|
|
# We also don't need a CONTEXT_DIR var as its also
|
|
# hardcoded to be windows-docker/
|
|
DOCKERFILE: 'ci/windows-docker/Dockerfile'
|
|
GST_UPSTREAM_BRANCH: 'main'
|
|
tags:
|
|
- 'windows'
|
|
- 'shell'
|
|
- '2022'
|
|
script:
|
|
# We need to pass an array and to resolve the env vars, so we can't use a variable:
|
|
- $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "RUST_VERSION=$RUST_VERSION")
|
|
|
|
- "& ci/windows-docker/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
|
|
- |
|
|
if (!($?)) {
|
|
echo "Failed to build the image"
|
|
Exit 1
|
|
}
|
|
|
|
windows rust docker stable:
|
|
extends: '.windows rust docker build'
|
|
variables:
|
|
RUST_IMAGE: !reference [variables, "WINDOWS_RUST_STABLE_IMAGE"]
|
|
RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_STABLE_UPSTREAM_IMAGE"]
|
|
RUST_VERSION: !reference [variables, "GST_RS_STABLE"]
|
|
|
|
.msvc2019 build:
|
|
stage: test
|
|
tags:
|
|
- 'docker'
|
|
- 'windows'
|
|
- '2022'
|
|
script:
|
|
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 &&
|
|
powershell ./ci/run_windows.ps1"
|
|
|
|
- |
|
|
if (!$?) {
|
|
Write-Host "Tests Failed!"
|
|
Exit 1
|
|
}
|
|
|
|
test windows stable:
|
|
needs:
|
|
- job: 'windows rust docker stable'
|
|
artifacts: false
|
|
image: "$WINDOWS_RUST_STABLE_IMAGE"
|
|
extends: '.msvc2019 build'
|
|
|
|
rustfmt-clippy:
|
|
extends:
|
|
- .fedora
|
|
- .fdo.distribution-image@fedora
|
|
stage: lint
|
|
script:
|
|
- meson build
|
|
- cargo fmt --version
|
|
- cargo fmt -- --color=always --check
|
|
- cargo clippy --version
|
|
- cargo clippy --color=always --all-targets -- -D warnings
|
|
|
|
test-stable:
|
|
extends:
|
|
- .fedora
|
|
- .fdo.distribution-image@fedora
|
|
stage: test
|
|
script:
|
|
- meson build
|
|
- rustc --version
|
|
- cargo build --color=always --all-targets
|
|
- >
|
|
xvfb-run -a -s "-screen 0 1024x768x24"
|
|
cargo test --color=always
|
|
|
|
rustdoc:
|
|
extends:
|
|
- .fedora
|
|
- .fdo.distribution-image@fedora
|
|
stage: release
|
|
only:
|
|
- flatpak
|
|
- tags
|
|
variables:
|
|
RUSTDOCFLAGS: "-Dwarnings"
|
|
script:
|
|
- meson build
|
|
- rustdoc --version
|
|
- cargo doc --no-deps
|
|
|
|
dist-package:
|
|
extends:
|
|
- .fedora
|
|
- .fdo.distribution-image@fedora
|
|
stage: release
|
|
only:
|
|
- flatpak
|
|
script:
|
|
- meson build
|
|
- ninja -C build dist
|
|
|
|
flatpak:
|
|
image: $GNOME_RUNTIME_IMAGE
|
|
stage: release
|
|
only:
|
|
- flatpak
|
|
- tags
|
|
# Using gstreamer runner avoids an issue with 'bwrap: No permissions to creating new namespace' during flatpak builder
|
|
tags:
|
|
- gstreamer
|
|
variables:
|
|
BUNDLE: "gst-pipeline-studio-nightly.flatpak"
|
|
MANIFEST_PATH: "build-aux/org.freedesktop.dabrain34.GstPipelineStudio.Devel.json"
|
|
FLATPAK_MODULE: "gst-pipeline-studio"
|
|
APP_ID: "org.freedesktop.dabrain34.GstPipelineStudio.Devel"
|
|
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
|
script:
|
|
- flatpak-builder app ${MANIFEST_PATH}
|
|
- flatpak build-export repo app
|
|
- flatpak build-bundle repo ${BUNDLE} ${APP_ID}
|
|
artifacts:
|
|
name: "Flatpak artifacts"
|
|
expose_as: "Get Flatpak bundle here"
|
|
when: "always"
|
|
paths:
|
|
- "${BUNDLE}"
|
|
- ".flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/meson-log.txt"
|
|
- ".flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/testlog.txt"
|
|
expire_in: 14 days
|