[gnome-settings-daemon/wip/claudio/CI: 3/4] CI: add code coverage report
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/claudio/CI: 3/4] CI: add code coverage report
- Date: Mon, 4 Feb 2019 10:33:38 +0000 (UTC)
commit 333754324d66381db5537c551d6a3a420c72452c
Author: Claudio André <claudioandre br gmail com>
Date: Thu Jul 12 17:33:18 2018 -0300
CI: add code coverage report
It works only if enabled via CI/CD Settings. More info available at
https://docs.gitlab.com/ee/user/project/pipelines/settings.html#test-coverage-parsing.
.gitlab-ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f2915d86..2e98381b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,7 @@ stages:
- build
- test
- manual
+ - delivery
.Log files: &log_files [./*.log, _build/meson-logs/]
@@ -82,7 +83,50 @@ test:
meson test -C _build --verbose --no-stdsplit
fi
+# Runs the coverage test.
+coverage:
+ <<: *save_build_logs
+ stage: test
+ variables:
+ BUILD_OPTS: "-Db_coverage=true"
+ coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
+ only:
+ - master@GNOME/gnome-settings-daemon
+
+ script:
+ - *environment_information
+ - *build_procedure
+ - *run_tests
+
+ - ninja -C _build coverage-html
+
+ # Parse the report to get the coverage result
+ - |
+ echo == Coverage ==
+ sed -e 's/<[^>]*>//g' _build/meson-logs/coveragereport/index.html | tr -d ' \t' | grep -A3 -P
'^Lines:$' | tr '\n' ' '; echo
+
+##
+# Stage: Delivery
+#
+# Publishes the Coverage Report generated above
+##
+pages:
+ stage: delivery
+ dependencies:
+ - coverage
+ script:
+ - mv _build/meson-logs/coveragereport/ public/
+ artifacts:
+ paths:
+ - public
+ only:
+ - master@GNOME/gnome-settings-daemon
+
+##
+# Stage: Manual
+#
# Runs the sanitizers [address, thread, undefined, and memory].
+##
.sanitizer: &sanitizer
<<: *save_build_logs
stage: manual
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]