[spice-gtk,v1,10/10] gitlab-ci: add stages and manual flatpak generation

Submitted by Victor Toso on Feb. 8, 2019, 6:32 p.m.

Details

Message ID 20190208183252.16154-11-victortoso@redhat.com
State New
Headers show
Series "Flatpak + CI" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso Feb. 8, 2019, 6:32 p.m.
From: Victor Toso <me@victortoso.com>

This should make much easier to test spice-gtk changes, one must have
to activate the flatpak stage manually if seems necessary.

Note that the spicy.flatkpak bundle is around 1.1M

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Patch hide | download patch | download mbox

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 71a0007..9382852 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,7 @@ 
+stages:
+  - builds
+  - tests
+
 image: fedora:latest
 
 variables:
@@ -17,7 +21,33 @@  variables:
               mingw64-gtk3 mingw64-json-glib mingw64-opus
               mingw64-gstreamer1-plugins-base mingw64-gstreamer1-plugins-good
 
+flatpak:
+    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master 
+    stage: tests
+    when: manual
+    variables:
+        APP_ID: "org.spicespace.spicy"
+        BUNDLE: "spicy.flatpak"
+        MANIFEST_PATH: "data/org.spicespace.spicy.json"
+        FLATPAK_MODULE: "spice-gtk"
+
+    script:
+        - flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
+        # Make sure to keep this in sync with the Flatpak manifest, all arguments
+        # are passed except the config-args because we build it ourselves
+        - flatpak build app meson --prefix=/app _build
+        - flatpak build app ninja -C _build install
+        - flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
+        # Generate a Flatpak bundle
+        - flatpak build-bundle repo ${BUNDLE} ${APP_ID}
+    artifacts:
+        paths:
+            - ${BUNDLE}
+            - _build/*.txt
+        expire_in: 2 days
+
 fedora-autotools:
+  stage: builds
   artifacts:
     paths:
       - tests/*.log
@@ -48,6 +78,7 @@  fedora-autotools:
     - make check
 
 fedora-meson:
+  stage: builds
   artifacts:
     paths:
       - _build_*/meson-logs/*.txt
@@ -70,6 +101,7 @@  fedora-meson:
     - ninja -C _build_feat_disabled test
 
 windows-autotools:
+  stage: builds
   before_script:
     - dnf install -y $DEPS_COMMON $DEPS_MINGW
     - git clone ${CI_REPOSITORY_URL/spice-gtk/spice-protocol}
@@ -81,6 +113,7 @@  windows-autotools:
     - make -j4
 
 windows-meson:
+  stage: builds
   artifacts:
     paths:
       - _build_win64/meson-logs/*.txt