summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Petridis <jordanpetridis@protonmail.com>2018-07-13 19:39:26 +0300
committerMichael Catanzaro <mcatanzaro@igalia.com>2018-07-16 13:19:26 -0500
commit8cceb93659fcff75d8edb79b452ec96e9d4bd5e5 (patch)
tree28dc94b37f17cdb33aae5bd34ffbc8c390e74362
parent364591a15f04f11ecdf481efef369face261e418 (diff)
downloadepiphany-8cceb93659fcff75d8edb79b452ec96e9d4bd5e5.tar.gz
CI: Add flatpak build/test job.
-rw-r--r--.gitlab-ci.yml66
1 files changed, 66 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..80bc15f27
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,66 @@
+stages:
+- test
+- review
+
+variables:
+ # Replace with your preferred file name of the resulting Flatpak bundle
+ BUNDLE: "epiphany-git.flatpak"
+
+flatpak:
+ image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
+ stage: test
+ variables:
+ # Replace with your manifest path
+ MANIFEST_PATH: "org.gnome.Epiphany.yaml"
+ RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
+ # Replace with your application name, as written in the manifest
+ FLATPAK_MODULE: "epiphany"
+ # Make sure to keep this in sync with the Flatpak manifest, all arguments
+ # are passed except the config-args because we build it ourselves
+ MESON_ARGS: "-Dunit_tests=true"
+ DBUS_ID: "org.gnome.Epiphany"
+
+ 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 ${MESON_ARGS} _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} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
+ # Run automatic tests inside the Flatpak env
+ - xvfb-run -a -s "-screen 0 1024x768x24" flatpak build app ninja -C _build test
+ artifacts:
+ paths:
+ - ${BUNDLE}
+ - _build/meson-logs/meson-log.txt
+ - _build/meson-logs/testlog.txt
+ expire_in: 30 days
+ cache:
+ paths:
+ - .flatpak-builder/cache
+
+review:
+ stage: review
+ dependencies:
+ - flatpak
+ script:
+ - echo "Generating flatpak deployment"
+ artifacts:
+ paths:
+ - ${BUNDLE}
+ expire_in: 30 days
+ environment:
+ name: review/$CI_COMMIT_REF_NAME
+ url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
+ on_stop: stop_review
+
+stop_review:
+ stage: review
+ script:
+ - echo "Stopping flatpak deployment"
+ when: manual
+ environment:
+ name: review/$CI_COMMIT_REF_NAME
+ action: stop \ No newline at end of file