summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2018-06-17 18:22:07 +0200
committerSam Thursfield <sam@afuera.me.uk>2018-07-11 15:57:01 +0200
commitafdfd31a7f55bbe49bca9dfa5ba87957758c8331 (patch)
tree1e51c54a8f6950f3152fdece11c8f90ffd3096b6 /.gitlab-ci.yml
parentee07c990a6c3835ee90a7b5c5c1c630a8b228e4c (diff)
downloadtracker-afdfd31a7f55bbe49bca9dfa5ba87957758c8331.tar.gz
Enable GitLab CI
This tests that Tracker can be built from source using Autotools and Meson, and that all of the unit tests run successfully. There are various improvements that could be made: * Pre-create a Docker image with the build dependencies installed, so that we don't wait for `dnf` on every build. * Fix the functional tests and enable them for every build. * Fix the unit tests to not depend on Tracker being installed in the host * Remove the Autotools build system altogether and use Meson for everything \o/
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml77
1 files changed, 77 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..91aa40c3e
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,77 @@
+stages:
+ - test
+
+# Note that using Fedora 28 triggered some weird compiler bug for me:
+#
+# GISCAN Tracker_C-2.0.gir
+# annobin: Tracker_2.0.c: Error: plugin built for compiler version (8.0.1) but run with compiler version (8.1.1)
+# cc1: error: fail to initialize plugin /usr/lib/gcc/x86_64-redhat-linux/8/plugin/annobin.so
+# Traceback (most recent call last):
+# File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 127, in _compile
+# extra_postargs)
+# File "/usr/lib64/python3.6/distutils/ccompiler.py", line 909, in spawn
+# spawn(cmd, dry_run=self.dry_run)
+# File "/usr/lib64/python3.6/distutils/spawn.py", line 36, in spawn
+# _spawn_posix(cmd, search_path, dry_run=dry_run)
+# File "/usr/lib64/python3.6/distutils/spawn.py", line 159, in _spawn_posix
+# % (cmd, exit_status))
+# distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
+#
+test-autotools-fedora27:
+ stage: test
+ image: fedora:27
+
+ before_script:
+ # This takes a long time, we could prebuild a Docker image that already
+ # contains this stuff instead, and use that.
+ - dnf install -y 'dnf-command(builddep)' dbus-devel dbus-x11 libseccomp-devel make redhat-rpm-config
+ - dnf builddep -y tracker
+
+ # This shouldn't be needed, but currently is.
+ #
+ # Some of the tests depend on the GSettings schemas being installed.
+ #
+ # Some of the tests also seem to interact with the session-wide Tracker
+ # instance!
+ - dnf install -y tracker
+
+ # tests/libtracker-common/tracker-file-utils-test will fail if run as root,
+ # as it makes assertions about a path being unwritable. Better to test as a
+ # normal user in any case.
+ - useradd -Um tracker
+ - chown -R tracker:tracker .
+
+ script:
+ - su tracker -c './autogen.sh --disable-functional-tests --prefix=/usr'
+ - su tracker -c 'make -j'
+ - LANG=en_US.UTF8 su tracker -c 'dbus-launch make check'
+
+test-meson-fedora27:
+ stage: test
+ image: fedora:27
+
+ before_script:
+ # This takes a long time, we could prebuild a Docker image that already
+ # contains this stuff instead, and use that.
+ - dnf install -y 'dnf-command(builddep)' dbus-devel dbus-x11 libseccomp-devel meson redhat-rpm-config
+ - dnf builddep -y tracker
+
+ # This shouldn't be needed, but currently is.
+ #
+ # Some of the tests depend on the GSettings schemas being installed.
+ #
+ # Some of the tests also seem to interact with the session-wide Tracker
+ # instance!
+ - dnf install -y tracker
+
+ # tests/libtracker-common/tracker-file-utils-test will fail if run as root,
+ # as it makes assertions about a path being unwritable. Better to test as a
+ # normal user in any case.
+ - useradd -Um tracker
+ - chown -R tracker:tracker .
+
+ script:
+ - su tracker -c 'mkdir build'
+ - su tracker -c 'cd build; meson .. -Dfunctional_tests=false'
+ - su tracker -c 'cd build; ninja'
+ - su tracker -c 'cd build; LANG=en_US.UTF8 dbus-launch meson test --print-errorlogs'