mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
Merge branch 'expose-artifacts-in-pr' into 'main'
ci: Expose the coverage report and docs as links in the MR's See merge request GNOME/glib!2820
This commit is contained in:
commit
d37beda25e
@ -10,7 +10,7 @@ cache:
|
|||||||
- _ccache/
|
- _ccache/
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v18"
|
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v19"
|
||||||
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
|
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
|
||||||
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v13"
|
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v13"
|
||||||
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v9"
|
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v9"
|
||||||
@ -93,6 +93,7 @@ fedora-x86_64:
|
|||||||
when: always
|
when: always
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
|
- "_build/docs/reference/"
|
||||||
- "_build/config.h"
|
- "_build/config.h"
|
||||||
- "_build/glib/glibconfig.h"
|
- "_build/glib/glibconfig.h"
|
||||||
- "_build/meson-logs"
|
- "_build/meson-logs"
|
||||||
@ -477,8 +478,14 @@ coverage:
|
|||||||
artifacts:
|
artifacts:
|
||||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
expose_as: 'Coverage Report'
|
||||||
paths:
|
paths:
|
||||||
- _coverage/
|
- _coverage/coverage/index.html
|
||||||
|
- _coverage
|
||||||
|
reports:
|
||||||
|
coverage_report:
|
||||||
|
coverage_format: cobertura
|
||||||
|
path: _coverage/*-cobertura/cobertura-*.xml
|
||||||
before_script:
|
before_script:
|
||||||
- bash .gitlab-ci/show-execution-environment.sh
|
- bash .gitlab-ci/show-execution-environment.sh
|
||||||
script:
|
script:
|
||||||
|
@ -10,6 +10,14 @@ for path in _coverage/*.lcov; do
|
|||||||
lcov --config-file .lcovrc -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
|
lcov --config-file .lcovrc -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
|
||||||
# Remove any coverage from system files
|
# Remove any coverage from system files
|
||||||
lcov --config-file .lcovrc -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
|
lcov --config-file .lcovrc -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
|
||||||
|
|
||||||
|
# Convert to cobertura format for gitlab integration
|
||||||
|
cobertura_base="${path/.lcov}-cobertura"
|
||||||
|
cobertura_xml="${cobertura_base}.xml"
|
||||||
|
lcov_cobertura "${path}" --output "${cobertura_xml}"
|
||||||
|
mkdir -p "${cobertura_base}"
|
||||||
|
cobertura-split-by-package.py "${cobertura_xml}" "${cobertura_base}"
|
||||||
|
rm -f "${cobertura_xml}"
|
||||||
done
|
done
|
||||||
|
|
||||||
genhtml \
|
genhtml \
|
||||||
|
@ -76,6 +76,9 @@ RUN dnf -y update \
|
|||||||
|
|
||||||
RUN pip3 install meson==0.60.3
|
RUN pip3 install meson==0.60.3
|
||||||
|
|
||||||
|
COPY install-gitlab-cobertura-tools.sh .
|
||||||
|
RUN ./install-gitlab-cobertura-tools.sh
|
||||||
|
|
||||||
# Set /etc/machine-id as it’s needed for some D-Bus tests
|
# Set /etc/machine-id as it’s needed for some D-Bus tests
|
||||||
RUN systemd-machine-id-setup
|
RUN systemd-machine-id-setup
|
||||||
|
|
||||||
|
17
.gitlab-ci/install-gitlab-cobertura-tools.sh
Executable file
17
.gitlab-ci/install-gitlab-cobertura-tools.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# We need cobertura reports for gitlab-ci coverage_report,
|
||||||
|
# so this scripts helps us doing that until we switch to gcovr
|
||||||
|
pip3 install lcov-cobertura==2.0.2
|
||||||
|
|
||||||
|
# We need to split the coverage files, see:
|
||||||
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/328772#note_840831654
|
||||||
|
SPLIT_COBERTURA_SHA512="8388ca3928a27f2ef945a7d45f1dec7253c53742a0dd1f6a3b4a07c0926b24d77f8b5c51fc7920cb07320879b7b89b0e0e13d2101117403b8c052c72e28dbcb7"
|
||||||
|
wget -O /usr/local/bin/cobertura-split-by-package.py \
|
||||||
|
https://gitlab.com/gitlab-org/gitlab/uploads/9d31762a33a10158f5d79d46f4102dfb/split-by-package.py
|
||||||
|
echo "${SPLIT_COBERTURA_SHA512} /usr/local/bin/cobertura-split-by-package.py" | sha512sum -c
|
||||||
|
chmod +x /usr/local/bin/cobertura-split-by-package.py
|
||||||
|
sed -i "s,\(/usr/bin/env python\).*,\13," \
|
||||||
|
/usr/local/bin/cobertura-split-by-package.py
|
@ -23,6 +23,8 @@ if docker -v |& grep -q podman; then
|
|||||||
# is incompatible with some of the dockerd instances on GitLab
|
# is incompatible with some of the dockerd instances on GitLab
|
||||||
# CI runners.
|
# CI runners.
|
||||||
export BUILDAH_FORMAT=docker
|
export BUILDAH_FORMAT=docker
|
||||||
|
elif getent group docker | grep -q "\b${USER}\b"; then
|
||||||
|
SUDO_CMD=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
Loading…
Reference in New Issue
Block a user