[at-spi2-core: 2/7] First cut at building with Freedesktop CI templates - images for openSUSE and Fedora




commit b37e9004a6a4a4f1d6ac8fbca2fd704d4b5a1f82
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Mar 18 14:01:38 2022 -0600

    First cut at building with Freedesktop CI templates - images for openSUSE and Fedora
    
    The Fedora build does not run the tests yet.  Preferably I'd like it
    to use systemd socket activation for dbus-broker, but this is proving tricky.
    
    The Fedora build has the meson flags from the Fedora specfile for
    at-spi2-core, but builds without dbus-daemon with the intention of
    really testing dbus-broker eventually.

 .gitlab-ci.yml          | 71 +++++++++++++++++++++++++++++++++++--------------
 ci/container_builds.yml | 53 ++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 20 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a3e4543b..cd9e8013 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,11 +6,13 @@
 #
 # Introduction to Gitlab CI: https://docs.gitlab.com/ee/ci/quick_start/index.html
 
-variables:
-  OPENSUSE_TUMBLEWEED_IMAGE: "registry.gitlab.gnome.org/gnome/at-spi2-core/opensuse:latest"
+# Include the parameters we need from Freedesktop CI Templates
+include:
+  - local: 'ci/container_builds.yml'
 
 # Stages in the CI pipeline in which jobs will be run
 stages:
+  - container-build
 #  - style-check
   - build
   - analysis
@@ -18,9 +20,6 @@ stages:
   - deploy
 
 # Base definition for jobs.
-#
-# We have the package dependencies to install on top of a stock opensuse/tumbleweed image,
-# and the rules for when to run each job (on merge requests and on personal branches).
 .only-default:
   only:
     - merge_requests
@@ -41,13 +40,19 @@ stages:
 #     - sh -x ./ci/run-style-check.sh
 
 
-# Template for the default build recipe.
+# Default build recipe.
 #
 # Depends on these variables:
 # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
-.build-default:
-  image: $OPENSUSE_TUMBLEWEED_IMAGE
-  extends: .only-default
+opensuse-x86_64:
+  stage: build
+  extends:
+    - '.only-default'
+    - '.container.opensuse@x86_64'
+    - '.fdo.distribution-image@opensuse'
+  needs: ['opensuse-container@x86_64']
+  variables:
+    MESON_EXTRA_FLAGS: "--buildtype=debug" # -Dwerror=true
   script:
     - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
     - meson compile -C _build
@@ -64,6 +69,28 @@ stages:
       - "${CI_PROJECT_DIR}/_build/meson-logs"
       - "${CI_PROJECT_DIR}/_build/atspi/Atspi-2.0.gir"
 
+fedora-x86_64:
+  stage: build
+  extends:
+    - '.only-default'
+    - '.container.fedora@x86_64'
+    - '.fdo.distribution-image@fedora'
+  needs: ['fedora-container@x86_64']
+  variables:
+    MESON_EXTRA_FLAGS: "--buildtype=debug -Ddefault_bus=dbus-broker 
-Ddbus_broker=/usr/bin/dbus-broker-launch" # -Dwerror=true
+  script:
+    - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
+    - meson compile -C _build
+    - meson install -C _build
+  artifacts:
+    reports:
+      junit: "_build/meson-logs/testlog.junit.xml"
+    when: always
+    name: "at-spi2-core-${CI_COMMIT_REF_NAME}"
+    paths:
+      - "${CI_PROJECT_DIR}/_build/meson-logs"
+      - "${CI_PROJECT_DIR}/_build/atspi/Atspi-2.0.gir"
+
 # Inherit to build the API reference via gi-docgen
 # @PROJECT_DEPS: the dependencies of the project (on Fedora)
 # @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
@@ -94,20 +121,17 @@ stages:
 # Build and run the test suite.
 #
 # Look at .build-default for where the artifacts are stored (build/test logs, built binaries).
-opensuse-x86_64:
-  extends: .build-default
-  stage: build
-  needs: []
-  variables:
-    MESON_EXTRA_FLAGS: "--buildtype=debug" # -Dwerror=true
 
 # Run static analysis on the code.
 #
 # The logs are part of the compilation stderr.
 static-scan:
-  image: $OPENSUSE_TUMBLEWEED_IMAGE
   stage: analysis
-  needs: []
+  extends:
+    - '.only-default'
+    - '.container.opensuse@x86_64'
+    - '.fdo.distribution-image@opensuse'
+  needs: ['opensuse-container@x86_64']
   variables:
     MESON_EXTRA_FLAGS: "--buildtype=debug -Dintrospection=no -Ddocs=false"
   script:
@@ -121,9 +145,12 @@ static-scan:
 
 # Build and run with address sanitizer (asan).
 asan-build:
-  image: $OPENSUSE_TUMBLEWEED_IMAGE
   stage: analysis
-  needs: []
+  extends:
+    - '.only-default'
+    - '.container.opensuse@x86_64'
+    - '.fdo.distribution-image@opensuse'
+  needs: ['opensuse-container@x86_64']
   variables:
     MESON_EXTRA_FLAGS: "--buildtype=debug -Db_sanitize=address -Db_lundef=false -Dintrospection=no 
-Ddocs=false"
   script:
@@ -142,9 +169,13 @@ asan-build:
 #
 # See the _coverage/ artifact for the HTML report.
 coverage:
-  image: $OPENSUSE_TUMBLEWEED_IMAGE
   stage: analysis
   needs: []
+  extends:
+    - '.only-default'
+    - '.container.opensuse@x86_64'
+    - '.fdo.distribution-image@opensuse'
+  needs: ['opensuse-container@x86_64']
   variables:
     MESON_EXTRA_FLAGS: "--buildtype=debug -Ddocs=false -Dintrospection=no"
     CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
diff --git a/ci/container_builds.yml b/ci/container_builds.yml
new file mode 100644
index 00000000..f3120f35
--- /dev/null
+++ b/ci/container_builds.yml
@@ -0,0 +1,53 @@
+# This file defines the container images that at-spi2-core uses for its CI.
+#
+# Container images are built using the Freedesktop CI Templates infrastructure:
+# https://gitlab.freedesktop.org/freedesktop/ci-templates/
+
+# The SHAs here correspond to commits in the freedesktop/ci-templates repository.
+# It doesn't change often, but you can update to newer SHAs if there are important
+# changes there.
+include:
+  - remote: 
"https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/3e66ea37e5672bb8f48e3056ba92915b5fc5b888/templates/opensuse.yml";
+  - remote: 
"https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/3e66ea37e5672bb8f48e3056ba92915b5fc5b888/templates/fedora.yml";
+
+variables:
+  # When branching change the suffix to avoid conflicts with images
+  # from the main branch
+  BASE_TAG: "2022-04-11.0-master"
+
+.container.opensuse@x86_64:
+  stage: "container-build"
+  variables:
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+    FDO_DISTRIBUTION_VERSION: "tumbleweed"
+    FDO_UPSTREAM_REPO: "gnome/at-spi2-core"
+    FDO_DISTRIBUTION_PACKAGES: >-
+      clang clang-tools findutils gcc dbus-1 dbus-1-devel gettext git
+      glib2-devel gobject-introspection-devel
+      gsettings-desktop-schemas itstool libasan6 libxml2-devel
+      libxkbcommon-devel libXi-devel libXtst-devel lcov meson ninja
+      python38 python38-gobject
+
+opensuse-container@x86_64:
+  extends:
+    - .fdo.container-build@opensuse@x86_64
+    - .container.opensuse@x86_64
+  stage: "container-build"
+
+.container.fedora@x86_64:
+  stage: "container-build"
+  variables:
+    FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+    FDO_DISTRIBUTION_VERSION: "35"
+    FDO_UPSTREAM_REPO: "gnome/at-spi2-core"
+    FDO_DISTRIBUTION_PACKAGES: >-
+      clang clang-tools-extra findutils gcc dbus-daemon dbus-devel dbus-tools systemd-devel
+      gettext git glib2-devel gobject-introspection-devel
+      gsettings-desktop-schemas itstool libasan libxml2-devel
+      libxkbcommon-devel libXi-devel libXtst-devel lcov meson procps python38
+
+fedora-container@x86_64:
+  extends:
+    - .fdo.container-build@fedora
+    - .container.fedora@x86_64
+  stage: "container-build"


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