1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00
libvirt/.gitlab-ci.yml
Andrea Bolognani 24fb0270c6 ci: Fix paths shown in the website
Right now we're setting the prefix to a custom path, which
results in paths like

  /builds/libvirt/libvirt/vroot/etc/libvirt/virtqemud.conf

ending up in the generated HTML. In order to avoid that,
set the prefix and other installation paths to reasonable
default values by passing

  -Dsystem=true

and then take advantage of $DESTDIR support to still be able
to write the HTML files without requiring root privileges.

Reported-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-08-11 14:02:00 +02:00

138 lines
4.3 KiB
YAML

variables:
GIT_DEPTH: 100
stages:
- containers
- builds
- integration_tests
- sanity_checks
.script_variables: &script_variables |
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
export CCACHE_MAXSIZE="500M"
export PATH="$CCACHE_WRAPPERSDIR:$PATH"
export VIR_TEST_VERBOSE="1"
export VIR_TEST_DEBUG="1"
include:
- '/ci/gitlab.yml'
- '/ci/integration.yml'
.native_build_job:
extends: .gitlab_native_build_job
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
before_script:
- *script_variables
- cat /packages.txt
script:
- meson setup build --werror $MESON_ARGS || (cat build/meson-logs/meson-log.txt && exit 1)
- meson dist -C build --no-tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --clean --nodeps --define "_without_mingw 1" --define "_topdir $PWD/rpmbuild/" -ta build/meson-dist/libvirt-*.tar.xz;
mv rpmbuild/RPMS/x86_64/ libvirt-rpms/;
else
meson compile -C build;
meson test -C build --no-suite syntax-check --print-errorlogs;
fi
.cross_build_job:
extends: .gitlab_cross_build_job
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
before_script:
- *script_variables
- cat /packages.txt
script:
- meson setup build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1)
- meson compile -C build
- if test "$CROSS" = "i686" ; then meson test -C build --no-suite syntax-check --print-errorlogs ; fi
# This artifact published by this job is downloaded by libvirt.org to
# be deployed to the web root:
# https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=website
website:
stage: builds
image: $CI_REGISTRY_IMAGE/ci-almalinux-8:latest
needs:
- job: x86_64-almalinux-8-container
optional: true
before_script:
- *script_variables
script:
- meson setup build --werror -Dsystem=true || (cat build/meson-logs/meson-log.txt && exit 1)
- DESTDIR=$(pwd)/install ninja -C build install-web
- mv install/usr/share/doc/libvirt/html/ website
artifacts:
expose_as: 'Website'
name: 'website'
when: on_success
expire_in: 30 days
paths:
- website
codestyle:
stage: sanity_checks
image: $CI_REGISTRY_IMAGE/ci-opensuse-leap-153:latest
needs:
- job: x86_64-opensuse-leap-153-container
optional: true
before_script:
- *script_variables
script:
- meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
- ninja -C build libvirt-pot-dep
- meson test -C build --suite syntax-check --no-rebuild --print-errorlogs
# This artifact published by this job is downloaded to push to Weblate
# for translation usage:
# https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=potfile
potfile:
stage: builds
image: $CI_REGISTRY_IMAGE/ci-almalinux-8:latest
needs:
- job: x86_64-almalinux-8-container
optional: true
rules:
- if: "$CI_COMMIT_BRANCH == 'master'"
before_script:
- *script_variables
script:
- meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
- ninja -C build libvirt-pot-dep
- ninja -C build libvirt-pot
- cp po/libvirt.pot libvirt.pot
artifacts:
expose_as: 'Potfile'
name: 'potfile'
when: on_success
expire_in: 30 days
paths:
- libvirt.pot
# Coverity job that is run only by schedules
coverity:
image: $CI_REGISTRY_IMAGE/ci-almalinux-8:latest
needs:
- job: x86_64-almalinux-8-container
optional: true
stage: builds
script:
- curl https://scan.coverity.com/download/linux64 --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN -o /tmp/cov-analysis-linux64.tgz
- tar xfz /tmp/cov-analysis-linux64.tgz
- meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
- cov-analysis-linux64-*/bin/cov-build --dir cov-int meson compile -C build
- tar cfz cov-int.tar.gz 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=@cov-int.tar.gz --form version="$(git describe --tags)" --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
rules:
- if: "$CI_PIPELINE_SOURCE == 'schedule' && $COVERITY_SCAN_PROJECT_NAME && $COVERITY_SCAN_TOKEN"