summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-02-28 16:30:46 +0100
committerCarlos Garnacho <carlosg@gnome.org>2020-02-29 01:12:39 +0100
commitdf6e72b2edbc4d44f9e85d0dbc19743b14a89be1 (patch)
treec982aa9150f24689b5955328af6adccb73133550 /.gitlab-ci.yml
parentd115ca5af7918fa100affc2704db68a6a142e183 (diff)
downloadtracker-df6e72b2edbc4d44f9e85d0dbc19743b14a89be1.tar.gz
ci: Integrate coverity builds
This goes to (atm) its own "analysis" stage, and builds the package with the coverity tool, so the results are uploaded to the coverity site for analysis. This only happens for the master branch as there is a limit on weekly builds, so can't be free for every change. The script relies on the COVERITY_TOKEN envvar being set, which should be done through project settings so it stays private.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml21
1 files changed, 20 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 25f4f0317..43c773bb7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,7 +12,7 @@ variables:
stages:
- test
-
+ - analysis
.test_template: &test
stage: test
@@ -59,3 +59,22 @@ test-fedora-latest:
test-ubuntu-rolling:
image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/ubuntu:rolling
<<: *test
+
+coverity:
+ stage: analysis
+ image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
+ allow_failure: true
+ script:
+ - dnf install -y clang
+ - su tracker -c 'curl https://scan.coverity.com/download/linux64 --data "token=$COVERITY_TOKEN&project=Tracker" --output /tmp/coverity_tool.tgz'
+ - su tracker -c 'tar zxf /tmp/coverity_tool.tgz'
+ - su tracker -c 'mkdir coverity-build'
+ - su tracker -c 'export CC=clang; cd coverity-build; meson ..'
+ - su tracker -c 'cd coverity-build; ../cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja'
+ - su tracker -c 'cd coverity-build; tar czf cov-int.tar.gz cov-int'
+ - su tracker -c 'curl https://scan.coverity.com/builds?project=Tracker
+ --form token=$COVERITY_TOKEN --form email=carlosg@gnome.org
+ --form file=@coverity-build/cov-int.tar.gz --form version="`git describe --tags`"
+ --form description="gitlab CI build"'
+ only:
+ - master