[tracker-miners/wip/carlosg/ci-updates: 1/3] ci: Update to using ci-fairy for building images




commit 0d0270c35a851da5f2e5802fc8d94aba8fc55910
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Aug 4 15:26:15 2021 +0200

    ci: Update to using ci-fairy for building images
    
    And test alpine/fedora/ubuntu like in the Tracker repo.

 .gitlab-ci.yml | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 179 insertions(+), 12 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1710944e4..03a8f0b03 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,10 @@
-# 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/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/ci-fairy.yml";
+  - remote: 
'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/fedora.yml'
+  - remote: 
'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/ubuntu.yml'
 
 variables:
+  MESON_TEST_TIMEOUT_MULTIPLIER: 3
   # These can be used to see verbose log output from the functional-tests.
   # See HACKING.md for more information.
   G_MESSAGES_DEBUG: ""
@@ -13,12 +16,103 @@ variables:
   TRACKER_TESTS_AWAIT_TIMEOUT: 60
 
 stages:
+  - prepare
+  - build
   - test
   - analysis
 
-.test_template: &test
-  stage: test
+.tracker-miners.fedora@common:
+  variables:
+    BASE_TAG: '2021-08-04.0'
+    FDO_UPSTREAM_REPO: GNOME/tracker
+    FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip 
umockdev-devel xmlto uncrustify patch diffutils'
+    FDO_DISTRIBUTION_EXEC: |
+      dnf install -y 'dnf-command(builddep)' &&
+      dnf builddep -y tracker tracker-miners --setopt=install_weak_deps=False &&
+      dnf clean all &&
+      pip3 install beautifulsoup4 mkdocs mkdocs-cinder tap.py meson &&
+      curl --get 'https://www.flamingspork.com/projects/libeatmydata/libeatmydata-105.tar.gz' --output 
libeatmydata-105.tar.gz &&
+      tar -x -f ./libeatmydata-105.tar.gz &&
+      cd libeatmydata-105 &&
+      ./configure --prefix=/usr &&
+      make install &&
+      sed -e '/dpkg-architecture/ d' -i /usr/bin/eatmydata &&
+      sed -e 's@shlib="/usr/lib/$DEB_BUILD_MULTIARCH/eatmydata.sh@shlib="/usr/libexec/eatmydata.sh@' -i 
/usr/bin/eatmydata &&
+      cd .. &&
+      rm ./libeatmydata-105.tar.gz &&
+      rm -Rf ./libeatmydata-105
+
+.tracker-miners.ubuntu@common:
+  variables:
+    BASE_TAG: '2021-08-04.0'
+    FDO_UPSTREAM_REPO: GNOME/tracker
+    FDO_DISTRIBUTION_PACKAGES: 'python3-tap umockdev libumockdev-dev upower asciidoc-base git libgrss-dev 
eatmydata'
+    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
+
+.tracker-miners.fedora:34@x86_64:
+  extends: .tracker-miners.fedora@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: 34
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+.tracker-miners.fedora:rawhide@x86_64:
+  extends: .tracker-miners.fedora@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: rawhide
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+.tracker-miners.fedora:34@aarch64:
+  extends: .tracker-miners.fedora@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: 34
+    FDO_DISTRIBUTION_TAG: "aarch64-${BASE_TAG}"
+  tags:
+    - aarch64
+
+.tracker-miners.ubuntu:rolling@x86_64:
+  extends: .tracker-miners.ubuntu@common
+  variables:
+    FDO_DISTRIBUTION_VERSION: rolling
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+build-fedora-container@x86_64:
+  extends:
+    - .fdo.container-build@fedora
+    - .tracker-miners.fedora:34@x86_64
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
 
+build-fedora-rawhide-container@x86_64:
+  extends:
+    - .fdo.container-build@fedora
+    - .tracker-miners.fedora:rawhide@x86_64
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
+
+build-fedora-container@aarch64:
+  extends:
+    - .fdo.container-build@fedora
+    - .tracker-miners.fedora:34@aarch64
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
+
+build-ubuntu-container@x86_64:
+  extends:
+    - .fdo.container-build@ubuntu
+    - .tracker-miners.ubuntu:rolling@x86_64
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
+
+.build-template: &build
+  stage: build
   script:
     # We can build and test tracker-miners against tracker just by building
     # tracker as a submodule.
@@ -28,6 +122,51 @@ stages:
     - cd build
     - meson .. --prefix=/usr -Dtracker_core=subproject -Db_lto=true -Db_coverage=true 
-Dtests_tap_protocol=true
     - ninja
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+
+build-fedora@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:34@x86_64
+  needs:
+    - build-fedora-container@x86_64
+  <<: *build
+
+build-fedora-rawhide@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:rawhide@x86_64
+  needs:
+    - build-fedora-rawhide-container@x86_64
+  <<: *build
+
+build-fedora@aarch64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:34@aarch64
+  needs:
+    - build-fedora-container@aarch64
+  allow_failure: true
+  <<: *build
+
+build-ubuntu-rolling@x86_64:
+  extends:
+    - .fdo.distribution-image@ubuntu
+    - .tracker-miners.ubuntu:rolling@x86_64
+  needs:
+    - build-ubuntu-container@x86_64
+  <<: *build
+
+.test_template: &test
+  stage: test
+
+  script:
+    - .gitlab-ci/checkout-tracker.sh
+    - cd build
+    - ninja
     - |
       # Remove the many "CI_" variables from the environment. Meson dumps the
       # whole environment for every failed test, and that gives a whole
@@ -51,27 +190,51 @@ stages:
       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/*.txt
     reports:
       junit: "build/meson-logs/testlog.junit.xml"
 
-test-fedora-latest:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
+test-fedora@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:34@x86_64
+  needs:
+    - build-fedora@x86_64
   <<: *test
 
-test-fedora-rawhide:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:rawhide
+test-fedora-rawhide@x86_64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:rawhide@x86_64
+  needs:
+    - build-fedora-rawhide@x86_64
+  <<: *test
+
+test-fedora@aarch64:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:34@aarch64
+  needs:
+    - build-fedora@aarch64
+  allow_failure: true
   <<: *test
 
-test-ubuntu-rolling:
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/ubuntu:rolling
+test-ubuntu@x86_64:
+  extends:
+    - .fdo.distribution-image@ubuntu
+    - .tracker-miners.ubuntu:rolling@x86_64
+  needs:
+    - build-ubuntu-rolling@x86_64
   <<: *test
 
 coverage-analysis:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:rawhide@x86_64
   stage: analysis
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
   allow_failure: true
   script:
     - .gitlab-ci/checkout-tracker.sh
@@ -86,10 +249,14 @@ coverage-analysis:
     when: always
     paths:
     - coverage-build/coveragereport
+  needs:
+    - test-fedora@x86_64
 
 coverity:
+  extends:
+    - .fdo.distribution-image@fedora
+    - .tracker-miners.fedora:rawhide@x86_64
   stage: analysis
-  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
   allow_failure: true
   script:
     # Build tracker, we must go out the subproject route as we don't want


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