[mutter/gbsneto/better-ci] ci: Build GNOME Shell at the test stage
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/better-ci] ci: Build GNOME Shell at the test stage
- Date: Mon, 22 Apr 2019 17:59:34 +0000 (UTC)
commit 2835a90592e2a021fcdc9a10f5c3f504ef2cb68a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Apr 22 14:54:11 2019 -0300
ci: Build GNOME Shell at the test stage
Hopefully this will allow us prevent merging branches
that accidentally break GNOME Shell.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/548
.gitlab-ci.yml | 12 ++++++++++++
.gitlab-ci/checkout-gnome-shell.sh | 31 +++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 09b0052c5..a381b4001 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -42,3 +42,15 @@ test-mutter:
only:
- merge_requests
- /^.*$/
+
+can-build-gnome-shell:
+ stage: test
+ dependencies:
+ - build-mutter
+ script:
+ - .gitlab-ci/checkout-gnome-shell.sh
+ - meson gnome-shell gnome-shell/_build --prefix=/usr
+ - ninja -C gnome-shell/_build install
+ only:
+ - merge_requests
+ - /^.*$/
diff --git a/.gitlab-ci/checkout-gnome-shell.sh b/.gitlab-ci/checkout-gnome-shell.sh
new file mode 100644
index 000000000..0149560d5
--- /dev/null
+++ b/.gitlab-ci/checkout-gnome-shell.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/bash
+
+mutter_branch=$(git describe --contains --all HEAD)
+gnome_shell_target=
+
+git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
+
+if [ $? -ne 0 ]; then
+ echo Checkout failed
+ exit 1
+fi
+
+cd gnome-shell
+
+if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
+ merge_request_remote=${CI_MERGE_REQUEST_SOURCE_PROJECT_URL//mutter/gnome-shell}
+ merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
+
+ echo Looking for $merge_request_branch on remote ...
+ if git fetch $merge_request_remote $merge_request_branch >/dev/null 2>&1; then
+ gnome_shell_target=FETCH_HEAD
+ fi
+fi
+
+if [ -z "$gnome_shell_target" ]; then
+ gnome_shell_target=$(git branch -r -l $mutter_branch)
+ gnome_shell_target=${gnome_shell_target:-origin/master}
+ echo Using $gnome_shell_target instead
+fi
+
+git checkout $gnome_shell_target
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]