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




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

    ci: WIP

 .gitlab-ci.yml | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 174 insertions(+), 24 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 05259f6d6..6640c4539 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,25 +13,157 @@ variables:
   MESON_TEST_EXTRA_ARGS: ""
 
 stages:
+  - prepare
+  - build
   - test
   - analysis
   - website
 
-.test_template: &test
-  stage: test
+.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.alpine@common:
+  variables:
+    BASE_TAG: '2021-05-15.4'
+    FDO_UPSTREAM_REPO: GNOME/tracker
+    FDO_DISTRIBUTION_EXEC: |
+      echo 'https://alpine.global.ssl.fastly.net/alpine/edge/community/' >> /etc/apk/repositories &&
+      apk add -U alpine-sdk asciidoc bash-completion dbus dbus-dev git glib-dev gobject-introspection-dev \
+               gtk-doc icu-dev json-glib-dev libsoup-dev libxml2-dev meson \
+               py3-gobject3 py3-setuptools py3-tappy sqlite-dev vala
+
+.tracker.fedora:34@x86_64:
+  extends: .tracker.fedora@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: 34
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+.tracker.fedora:rawhide@x86_64:
+  extends: .tracker.fedora@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: rawhide
+    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}"
+
+.tracker.alpine:edge@x86_64:
+  extends: .tracker.alpine@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: edge
+    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-fedora-rawhide-container@x86_64:
+  extends:
+    - .fdo.container-build@fedora@x86_64
+    - .tracker.fedora:rawhide@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-alpine-container@x86_64:
+  extends:
+    - .fdo.container-build@alpine@x86_64
+    - .tracker.alpine:edge@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-fedora-rawhide@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .build-tracker
+    - .tracker.fedora:rawhide@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
+
+build-alpine-edge@x86_64:
+  extends:
+    - .fdo.distribution-image@alpine
+    - .build-tracker
+    - .tracker.alpine:edge@x86_64
+  needs:
+    - build-alpine-container@x86_64
+
+.test-tracker:
+  stage: test
+  variables:
+    G_SLICE: "always-malloc"
+    MALLOC_CHECK_: "3"
   script:
-    - mkdir build
     - cd build
-    - meson .. -Db_lto=true -Db_coverage=true -Dsystemd_user_services=false -Dtests_tap_protocol=true
-    - ninja
     - |
       # 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 eatmydata meson test --print-errorlogs 
${MESON_TEST_EXTRA_ARGS}
-
+      env LANG=C.UTF-8 LC_ALL=C.UTF-8 dbus-run-session meson test --print-errorlogs ${MESON_TEST_EXTRA_ARGS}
   after_script:
     - |
       echo "Distribution: "
@@ -42,30 +177,45 @@ stages:
       echo "MESON_TEST_EXTRA_ARGS: ${MESON_TEST_EXTRA_ARGS}"
       echo
       echo "These values can be set at https://gitlab.gnome.org/GNOME/tracker/pipelines/new";
-
   artifacts:
+    expire_in: 1 day
     when: always
     paths:
-    - build/meson-logs/testlog.txt
+    - build
     reports:
       junit: "build/meson-logs/testlog.junit.xml"
 
+test-fedora@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .test-tracker
+    - .tracker.fedora:34@x86_64
+  needs:
+    - build-fedora-34@x86_64
 
-test-alpine-edge:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/alpine:edge
-  <<: *test
-
-test-fedora-latest:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
-  <<: *test
+test-fedora-rawhide@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .test-tracker
+    - .tracker.fedora:rawhide@x86_64
+  needs:
+    - build-fedora-rawhide@x86_64
 
-test-ubuntu-rolling:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/ubuntu:rolling
-  <<: *test
+test-ubuntu@x86_64:
+  extends:
+    - .fdo.distribution-image@ubuntu
+    - .test-tracker
+    - .tracker.ubuntu:rolling@x86_64
+  needs:
+    - build-ubuntu-rolling@x86_64
 
-test-fedora-rawhide:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:rawhide
-  <<: *test
+test-alpine@x86_64:
+  extends:
+    - .fdo.distribution-image@alpine
+    - .test-tracker
+    - .tracker.alpine:edge@x86_64
+  needs:
+    - build-alpine-edge@x86_64
 
 coverage-analysis:
   stage: analysis


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