[gtk/wip/sadiq/ci] ci: Add coverage support



commit a8f9b80a227c8f578681e4fd3d70db006076fbcf
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Tue Sep 18 08:48:41 2018 +0530

    ci: Add coverage support

 .gitlab-ci.yml            | 4 +++-
 .gitlab-ci/test-docker.sh | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a67069ebee..29322a7ab5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,8 +17,9 @@ fedora-x86_64:
   stage: build
   script:
     - bash -x ./.gitlab-ci/test-docker.sh
+  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
   artifacts:
-    when: on_failure
+    when: always
     name: "gtk-${CI_COMMIT_REF_NAME}"
     paths:
       - "${CI_PROJECT_DIR}/_build/meson-logs"
@@ -72,6 +73,7 @@ pages:
     - ninja -C _build gdk4-doc gsk4-doc gtk4-doc
 
     - mkdir -p public/
+    - mv _build/meson-logs/coveragereport public/coverage
     - mv _build/docs/reference/gtk/html/ public/gtk/
     - mv _build/docs/reference/gdk/html/ public/gdk/
     - mv _build/docs/reference/gsk/html/ public/gsk/
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
index 47cb9e9daf..50a297bbc6 100755
--- a/.gitlab-ci/test-docker.sh
+++ b/.gitlab-ci/test-docker.sh
@@ -12,6 +12,7 @@ ccache --zero-stats
 ccache --show-stats
 export CCACHE_DISABLE=true
 meson \
+        -Db_coverage=true \
         -Dx11-backend=true \
         -Dwayland-backend=true \
         -Dbroadway-backend=true \
@@ -30,3 +31,5 @@ xvfb-run -a -s "-screen 0 1024x768x24" \
         --suite=gtk+ \
         --no-suite=gtk+:gsk \
         --no-suite=gtk+:a11y
+
+ninja coverage


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