[tracker/wip/carlosg/ci-playground] ci: WIP




commit b60dcc04cec09ef7456aab696a8c31e5d05200e1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat May 15 20:18:07 2021 +0200

    ci: WIP

 .gitlab-ci.yml | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 122 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 05259f6d6..cf2b37cee 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,8 @@
-# The container images used in this pipeline are built from this
-# GitLab project: https://gitlab.gnome.org/GNOME/tracker-oci-images
+include:
+  - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/master/templates/ci-fairy.yml";
+  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/master/templates/alpine.yml'
+  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/master/templates/fedora.yml'
+  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/master/templates/ubuntu.yml'
 
 variables:
   # These can be used to see verbose log output from the functional-tests.
@@ -10,10 +13,127 @@ variables:
   MESON_TEST_EXTRA_ARGS: ""
 
 stages:
+  - prepare
+  - build
   - test
   - analysis
   - website
 
+.tracker.fedora@common:
+  variables:
+    BASE_TAG: '2021-05-15.2'
+    FDO_UPSTREAM_REPO: GNOME/tracker
+    FDO_DISTRIBUTION_EXEC: |
+      dnf install -y 'dnf-command(builddep)' &&
+      dnf builddep -y tracker --setopt=install_weak_deps=False &&
+      dnf install -y clang gcovr git libasan libubsan python3-gobject python3-pip umockdev-devel xmlto &&
+      dnf clean all &&
+      pip3 install beautifulsoup4 mkdocs mkdocs-cinder tap.py meson
+
+.tracker.ubuntu@common:
+  variables:
+    BASE_TAG: '2021-05-15.2'
+    FDO_UPSTREAM_REPO: GNOME/tracker
+    FDO_DISTRIBUTION_EXEC: |
+      export DEBIAN_FRONTEND=noninteractive &&
+      sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list && \
+      apt-get -yq update && apt-get -yq upgrade && \
+      apt-get -yq build-dep tracker tracker-miners && \
+      apt-get -yq install python3-tap umockdev libumockdev-dev upower && \
+      apt-get -yq install --no-install-recommends asciidoc-base && \
+      apt-get -yq install git
+
+.tracker.fedora:34@x86_64:
+  extends: .tracker.fedora@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: 34
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+.tracker.ubuntu:rolling@x86_64:
+  extends: .tracker.ubuntu@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: rolling
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+build-fedora-container@x86_64:
+  extends:
+    - .fdo.container-build@fedora@x86_64
+    - .tracker.fedora:34@x86_64
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
+
+build-ubuntu-container@x86_64:
+  extends:
+    - .fdo.container-build@ubuntu@x86_64
+    - .tracker.ubuntu:rolling@x86_64
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
+
+.build-tracker:
+  stage: build
+  script:
+    - meson . build -Db_lto=true -Db_coverage=true -Dsystemd_user_services=false -Dtests_tap_protocol=true 
--prefix /usr
+    - ninja -C build
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+
+build-fedora-34@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .build-tracker
+    - .tracker.fedora:34@x86_64
+  needs:
+    - build-fedora-container@x86_64
+
+build-ubuntu-rolling@x86_64:
+  extends:
+    - .fdo.distribution-image@ubuntu
+    - .build-tracker
+    - .tracker.ubuntu:rolling@x86_64
+  needs:
+    - build-ubuntu-container@x86_64
+
+.test-tracker:
+  extends:
+    - .fdo.distribution-image@fedora
+  stage: test
+  variables:
+    G_SLICE: "always-malloc"
+    MALLOC_CHECK_: "3"
+  script:
+    - cd build
+    - |
+      # Remove the many "CI_" variables from the environment. Meson dumps the
+      # whole environment for every failed test, and that gives a whole
+      # screenful of junk each time unless we strip these.
+      unset $(env|grep -o '^CI_[^=]*')
+      env LANG=C.UTF-8 LC_ALL=C.UTF-8 dbus-run-session meson test --print-errorlogs ${MESON_TEST_EXTRA_ARGS}
+  artifacts:
+    expire_in: 1 day
+    when: always
+    paths:
+    - build/meson-logs/testlog.txt
+    reports:
+      junit: "build/meson-logs/testlog.junit.xml"
+
+test-fedora@x86_64:
+  extends:
+    - .test-tracker
+    - .tracker.fedora:34@x86_64
+  needs:
+    - build-fedora-34@x86_64
+
+test-ubuntu@x86_64:
+  extends:
+    - .test-tracker
+    - .tracker.ubuntu:rolling@x86_64
+  needs:
+    - build-ubuntu-rolling@x86_64
+
 .test_template: &test
   stage: test
 


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