diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2023-01-17 00:36:18 +0100 |
---|---|---|
committer | Niels De Graef <ndegraef@redhat.com> | 2023-01-17 00:53:52 +0100 |
commit | 52ddfcf2fccf79e7d84f806a28056e77c3d997b6 (patch) | |
tree | 49baa30eab96876493feccbc60b68fb2e9426a2b | |
parent | 27c58b22badcdca2a783ba161496bb2a98bfd714 (diff) | |
download | gcr-52ddfcf2fccf79e7d84f806a28056e77c3d997b6.tar.gz |
ci: Generate coverage report
GitLab can visualize coverage reports [1] if they're generated with one
of the supported formats, one of them being Cobertura [2].
Meson provides integration with several tools, with `gcovr` being one of
them, which can also generate a coverage report in the Cobertura XML
format [3]. Meson provides support to generate this report with the
custom `coverage-xml` target, so let's use that so we get fancy coverage
reports.
[1]: https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html
[2]: http://cobertura.github.io/cobertura/
[3]: https://gcovr.com/en/stable/output/cobertura.html#cobertura-output
-rw-r--r-- | .gitlab-ci.yml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9544de..5640609 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,12 +72,13 @@ fedora:coverage: stage: build before_script: - dnf upgrade -y - - dnf install -y 'dnf-command(builddep)' $DEPENDENCIES lcov git gi-docgen + - dnf install -y 'dnf-command(builddep)' $DEPENDENCIES lcov git gi-docgen gcovr - dnf builddep -y gcr script: - meson _build -Db_coverage=true - dbus-run-session -- meson test -C _build - ninja coverage-html -C _build + - ninja coverage-xml -C _build - ninja docs -C _build coverage: '/^\s+lines.+:\s+([\d.]+\%)\s+/' artifacts: @@ -85,6 +86,9 @@ fedora:coverage: when: always reports: junit: "_build/meson-logs/testlog.junit.xml" + coverage_report: + coverage_format: cobertura + path: "_build/meson-logs/coverage.xml" paths: - "_build/config.h" - "_build/meson-logs" |