[gtk/ci-jobs: 1/2] ci: Refactor the CI pipeline



commit 53eb568d584f7695faa355078394754688b37cc2
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Jan 29 10:35:10 2020 +0100

    ci: Refactor the CI pipeline
    
    We should have a single job for building both static and shared
    versions of GTK. On the other hand, having a separate job for the
    release build would be a plus.
    
    Additionally, we shouldn't use an opaque script to build GTK; the only
    step in the process that requires hand-holding is running the tests
    suites under Xvfb, and having the build options visible from the YAML
    file gives us a better idea of what kind of build we're running.

 .gitlab-ci.yml                               | 46 +++++++++++++++++++++++++---
 .gitlab-ci/{Dockerfile => fedora.Dockerfile} |  1 +
 .gitlab-ci/run-tests.sh                      | 11 +++++++
 3 files changed, 53 insertions(+), 5 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2c3b35b62e..7f5ef322da 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,11 +12,38 @@ stages:
     - subprojects/libepoxy/
     - subprojects/pango/
 
-fedora-x86_64: &fedora-x86_64-defaults
+# Common variables
+variables:
+  COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror"
+  MESON_TEST_TIMEOUT_MULTIPLIER: 2
+  G_MESSAGES_DEBUG: all
+
+fedora-x86_64:
   image: registry.gitlab.gnome.org/gnome/gtk/master:v10
   stage: build
+  variables:
+    EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
   script:
-    - bash -x ./.gitlab-ci/test-docker.sh
+    - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS}
+            -Dx11-backend=true
+            -Dwayland-backend=true
+            -Dbroadway-backend=true
+            -Dvulkan=yes
+            -Dprofiler=true
+            _build
+    - ninja -C _build
+    - .gitlab-ci/run-tests.sh _build
+    - .gitlab-ci/meson-junit-report.py
+            --project-name=gtk
+            --job-id="${CI_JOB_NAME}"
+            --output=_build/report.xml
+            _build/meson-logs/testlog.json
+    - .gitlab-ci/meson-html-report.py
+            --project-name=gtk
+            --job-id="${CI_JOB_NAME}"
+            --reftest-output-dir="_build/testsuite/reftests/output"
+            --output=_build/report.html
+            _build/meson-logs/testlog.json
   artifacts:
     when: always
     reports:
@@ -34,10 +61,19 @@ fedora-x86_64: &fedora-x86_64-defaults
     key: "$CI_JOB_NAME"
     <<: *cache-paths
 
-fedora-x86_64-staticlibs:
+fedora-x86_64-release:
+  image: registry.gitlab.gnome.org/gnome/gtk/master:v10
+  stage: build
   variables:
-    EXTRA_MESON_FLAGS: "-Ddefault_library=both"
-  <<: *fedora-x86_64-defaults
+    EXTRA_MESON_FLAGS: "--buildtype=release"
+  script:
+    - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS}
+            -Dx11-backend=true
+            -Dwayland-backend=true
+            -Dbroadway-backend=true
+            -Dvulkan=yes
+            _build
+    - ninja -C _build
 
 .mingw-defaults: &mingw-defaults
   stage: build
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/fedora.Dockerfile
similarity index 99%
rename from .gitlab-ci/Dockerfile
rename to .gitlab-ci/fedora.Dockerfile
index d8cabe1a9d..a9006c01f2 100644
--- a/.gitlab-ci/Dockerfile
+++ b/.gitlab-ci/fedora.Dockerfile
@@ -61,6 +61,7 @@ RUN dnf -y install \
     ninja-build \
     pango-devel \
     pcre-devel \
+    pygments \
     python3 \
     python3-jinja2 \
     python3-pip \
diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh
new file mode 100755
index 0000000000..ad3a4a7491
--- /dev/null
+++ b/.gitlab-ci/run-tests.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+builddir=$1
+
+cd ${builddir}
+xvfb-run -a -s "-screen 0 1024x768x24" \
+        meson test --print-errorlogs \
+                --suite=gtk
+                --no-suite=gtk:a11y


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