[tracker-miners/wip/carlosg/coverage] ci: Add coverage stage




commit 457ce7ce31efd4f6a4374af4c2657fdc2b573baf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Sep 29 23:18:26 2020 +0200

    ci: Add coverage stage
    
    Like we have in the Tracker repo. Although the numbers are less
    spectacular.

 .gitlab-ci.yml | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c133b1549..c91269aa2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -63,6 +63,27 @@ test-ubuntu-rolling:
   image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/ubuntu:rolling
   <<: *test
 
+coverage-analysis:
+  stage: analysis
+  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
+  allow_failure: true
+  script:
+    - dnf install -y gcovr
+    # Build tracker, we must go out the subproject route as we don't want
+    # tracker code to be included in the coverity reports for tracker-miners.
+    - su tracker -c '.gitlab-ci/checkout-tracker.sh'
+    - su tracker -c 'export INSTALL=`pwd`/install; cd subprojects/tracker; meson build --libdir lib --prefix 
$INSTALL; cd build; ninja install;'
+    - su tracker -c 'mkdir -p coverage-build/coveragereport'
+    - su tracker -c 'export INSTALL=`pwd`/install; cd coverage-build; meson 
--pkg-config-path=$INSTALL/lib/pkgconfig .. -Db_lto=true -Db_coverage=true'
+    - su tracker -c 'cd coverage-build; ninja'
+    - su tracker -c 'export LD_LIBRARY_PATH=`pwd`/install/lib; cd coverage-build; env LANG=C.UTF-8 
LC_ALL=C.UTF-8 dbus-run-session eatmydata meson test --print-errorlogs ${MESON_TEST_EXTRA_ARGS}'
+    - su tracker -c 'cd coverage-build; gcovr --html-details --print-summary --root=.. 
--exclude=../docs/reference --exclude=../tests --exclude=../utils --exclude=../examples --output 
coveragereport/index.html'
+  coverage: '/^lines: (\d+\.\d+\%)/'
+  artifacts:
+    when: always
+    paths:
+    - coverage-build/coveragereport
+
 coverity:
   stage: analysis
   image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]