summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2022-09-15 02:22:41 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2022-09-15 03:12:08 +0200
commit29cf6b2b65556aa53b32563f9cad8c458ff606ee (patch)
treee56ed6f17929b97a27a660da9bbe9f752e38bebb /.gitlab-ci
parent22f5016303a958afeab5d3ebd3c4284548c4580d (diff)
downloadglib-29cf6b2b65556aa53b32563f9cad8c458ff606ee.tar.gz
ci: Install lcov-cobertura and cobertura-split script in coverage images
These are needed to be able to get cobertura reports in gitlab.
Diffstat (limited to '.gitlab-ci')
-rw-r--r--.gitlab-ci/fedora.Dockerfile3
-rwxr-xr-x.gitlab-ci/install-gitlab-cobertura-tools.sh17
2 files changed, 20 insertions, 0 deletions
diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile
index 2506f9386..85f910cb9 100644
--- a/.gitlab-ci/fedora.Dockerfile
+++ b/.gitlab-ci/fedora.Dockerfile
@@ -76,6 +76,9 @@ RUN dnf -y update \
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
RUN systemd-machine-id-setup
diff --git a/.gitlab-ci/install-gitlab-cobertura-tools.sh b/.gitlab-ci/install-gitlab-cobertura-tools.sh
new file mode 100755
index 000000000..59ec251e9
--- /dev/null
+++ b/.gitlab-ci/install-gitlab-cobertura-tools.sh
@@ -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