wireplumber/.gitlab-ci.yml
2021-06-15 13:29:24 +03:00

180 lines
5.5 KiB
YAML

stages:
- container
- container_coverity
- build
- analysis
- pages
variables:
FDO_UPSTREAM_REPO: 'pipewire/wireplumber'
# change to build against a different tag or branch of pipewire
PIPEWIRE_HEAD: 'master'
# ci-templates as of Mar 19th 2021
.templates_sha: &templates_sha 290b79e0e78eab67a83766f4e9691be554fc4afd
include:
- project: 'freedesktop/ci-templates'
ref: *templates_sha
file: '/templates/fedora.yml'
.fedora:
variables:
# Update this tag when you want to trigger a rebuild
FDO_DISTRIBUTION_TAG: '2021-05-25.1'
FDO_DISTRIBUTION_VERSION: '34'
# findutils: used by the .build script below
# dbus-devel: required by pipewire
# dbus-daemon: required by GDBus unit tests
# pip, doxygen: required for documentation
FDO_DISTRIBUTION_PACKAGES: >-
findutils
gcc
gcc-c++
git
meson
glib2-devel
gobject-introspection-devel
dbus-devel
dbus-daemon
python3-pip
doxygen
# install Sphinx and Breathe to generate documentation
# also install glib2-doc (required to make documentation links to GLib work)
# manually, to remove the 'tsflags=nodocs' flag that is enabled by default
# in the fedora docker image
FDO_DISTRIBUTION_EXEC: >-
pip3 install lxml Sphinx sphinx-rtd-theme breathe ;
dnf -y install glib2-doc --setopt='tsflags='
.coverity:
variables:
FDO_REPO_SUFFIX: 'coverity'
FDO_BASE_IMAGE: registry.freedesktop.org/$FDO_UPSTREAM_REPO/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_PACKAGES: >-
curl
FDO_DISTRIBUTION_EXEC: >-
mkdir -p /opt ;
cd /opt ;
curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64
--form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN ;
tar xf /tmp/cov-analysis-linux64.tgz ;
mv cov-analysis-linux64-* coverity ;
rm /tmp/cov-analysis-linux64.tgz
only:
variables:
- $COVERITY
.not_coverity:
except:
variables:
- $COVERITY
.build:
before_script:
# setup the environment
- export BUILD_ID="$CI_JOB_ID"
- export PREFIX="$PWD/prefix-$BUILD_ID"
- export PW_BUILD_DIR="$PWD/build-pipewire-$BUILD_ID"
# Build pipewire
# Fedora also ships that, but without the test plugins that we need...
- git clone --depth=1 --branch="$PIPEWIRE_HEAD"
https://gitlab.freedesktop.org/pipewire/pipewire.git
- meson "$PW_BUILD_DIR" pipewire --prefix="$PREFIX"
-Dpipewire-alsa=disabled -Dpipewire-jack=disabled
-Dalsa=disabled -Dv4l2=disabled -Djack=disabled -Dbluez5=disabled
-Dvulkan=disabled -Dgstreamer=disabled -Dsystemd=disabled
-Ddocs=disabled -Dman=disabled -Dexamples=disabled -Dpw-cat=disabled
-Dsdl2=disabled -Dsndfile=disabled -Dlibpulse=disabled -Davahi=disabled
-Decho-cancel-webrtc=disabled -Dmedia-session=disabled
-Dvideotestsrc=enabled -Daudiotestsrc=enabled -Dtest=enabled
- ninja -C "$PW_BUILD_DIR" install
# misc environment only for wireplumber
- export WP_BUILD_DIR="$PWD/build-wireplumber-$BUILD_ID"
- export XDG_RUNTIME_DIR="$(mktemp -p $PWD -d xdg-runtime-XXXXXX)"
- export PKG_CONFIG_PATH="$(dirname $(find "$PREFIX" -name 'libpipewire-*.pc')):$PKG_CONFIG_PATH"
script:
# Build wireplumber
- meson "$WP_BUILD_DIR" . --prefix="$PREFIX"
-Dintrospection=enabled -Ddoc=enabled
- cd "$WP_BUILD_DIR"
- ninja
- ninja test
- ninja install
artifacts:
name: wireplumber-$CI_COMMIT_SHA
when: always
paths:
- build-*/meson-logs
- prefix-*
container_fedora:
extends:
- .fedora
- .fdo.container-build@fedora
stage: container
variables:
GIT_STRATEGY: none
container_coverity:
extends:
- .fedora
- .coverity
- .fdo.container-build@fedora
stage: container_coverity
variables:
GIT_STRATEGY: none
build_on_fedora:
extends:
- .fedora
- .not_coverity
- .fdo.distribution-image@fedora
- .build
stage: build
build_with_coverity:
extends:
- .fedora
- .coverity
- .fdo.suffixed-image@fedora
- .build
stage: analysis
script:
- export PATH=/opt/coverity/bin:$PATH
- meson "$WP_BUILD_DIR" . --prefix="$PREFIX"
-Dintrospection=disabled -Ddoc=disabled -Dwpipc=enabled
- cov-configure --config coverity_conf.xml
--comptype gcc --compiler cc --template
--xml-option=append_arg@C:--ppp_translator
--xml-option=append_arg@C:"replace/G_SPAWN_ERROR_2BIG.*=.* G_SPAWN_ERROR_TOO_BIG,/G_SPAWN_ERROR_2BIG = G_SPAWN_ERROR_TOO_BIG,"
--xml-option=append_arg@C:--ppp_translator
--xml-option=append_arg@C:"replace/G_PARAM_PRIVATE.*=.* G_PARAM_STATIC_NAME,/G_PARAM_PRIVATE = G_PARAM_STATIC_NAME,"
- cov-build --dir cov-int --config coverity_conf.xml ninja -C "$WP_BUILD_DIR"
- tar caf wireplumber.tar.lzma cov-int
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
--form file=@wireplumber.tar.lzma --form version="`git describe --tags`"
--form description="`git describe --tags` / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID "
artifacts:
name: wireplumber-coverity-$CI_COMMIT_SHA
when: always
paths:
- build-*/meson-logs
- cov-int/build-log.txt
pages:
extends:
- .not_coverity
stage: pages
dependencies:
- build_on_fedora
script:
- mkdir public
- cp -R prefix-*/share/doc/wireplumber/html/* public/
artifacts:
paths:
- public
only:
- master