[gnome-shell/wip/fmuellner/more-ci: 3/5] ci: Add build stage



commit 56b3c85096dc7863208c469d5318affc3ae468d0
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Feb 12 17:53:42 2019 +0100

    ci: Add build stage
    
    So far we are only performing a basic syntax check on javascript
    sources; it's time to test the C code as well. As mutter is tightly
    coupled, we bite the bullet and build it as well, either using a
    matching branch (if it exists), or current master.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/408

 .gitlab-ci.yml        | 22 ++++++++++++++++++++++
 .gitlab-ci/Dockerfile | 21 +++++++++++++++++++++
 2 files changed, 43 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 595f9b5a0..3ea49f633 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
 stages:
  - source_check
+ - build
 
 variables:
     JS_LOG: "js-report.txt"
@@ -19,3 +20,24 @@ js_check:
         paths:
             - ${JS_LOG}
         when: on_failure
+
+build:
+    image: registry.gitlab.gnome.org/gnome/gnome-shell/master:v1
+    stage: build
+    before_script:
+        # check out mutter ...
+        - git clone https://gitlab.gnome.org/GNOME/mutter.git
+        - cd mutter
+        # ... either at the branch matching the MR, or master ...
+        - MUTTER_BRANCH=origin/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master}
+        - MUTTER_BRANCH=$(git branch -r -l $MUTTER_BRANCH)
+        - git checkout ${MUTTER_BRANCH:-origin/master}
+        # ... and build it
+        - meson . build --prefix=/usr -Dtests=false
+        - ninja -C build
+        - ninja -C build install
+        - cd ..
+    script:
+        - meson . build -Dbuiltype=debugoptimized
+        - ninja -C build
+        - ninja -C build install
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
new file mode 100644
index 000000000..3dbbc451b
--- /dev/null
+++ b/.gitlab-ci/Dockerfile
@@ -0,0 +1,21 @@
+FROM registry.fedoraproject.org/fedora:latest
+
+RUN dnf -y update && dnf -y upgrade && \
+    dnf install -y 'dnf-command(builddep)' redhat-rpm-config && \
+    dnf builddep -y mutter gnome-shell && \
+
+    # Mutter deps
+    dnf install -y gnome-settings-daemon-devel && \
+
+    # Needed for tests
+    dnf install -y findutils '*/xvfb-run' gdm && \
+
+    # Needed for building mutter
+    git clone https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git && \
+    cd gsettings-desktop-schemas && \
+    meson --prefix=/usr build && \
+    ninja -C build install && \
+    cd .. && \
+
+    dnf clean all && \
+    rm -rf /var/cache/dnf


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