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

[Xen-devel] [PATCH v3 7/8] ci: use GitLab CI to build



Added a GitLab CI config which has a lot more flexibility to allow us to
test a lot more distro configurations than Travis can and even build
test on FreeBSD. This includes a modified copy of scripts/travis-build
that is expected to diverge future over time as we build more than what
Travis is currently building.

Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
---
change since v2:
- use templated build jobs to reduce copy and paste
- added custom build script instead of using the travis one
  so that we can build more components
--
 .gitlab-ci.yml           | 154 ++++++++++++++++++++++++++++++++++++++++-
 automation/scripts/build |  31 ++++++++-
 2 files changed, 185 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100755 automation/scripts/build

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..682e48e
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,154 @@
+stages:
+  - build
+
+.build-tmpl: &build
+  stage: build
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
+  script:
+    - ./automation/scripts/build 2>&1 | tee build.log
+  artifacts:
+    paths:
+      - xen/.config
+      - '*.log'
+    when: always
+
+.gcc-tmpl:
+  variabes: &gcc
+    CC: gcc
+    CXX: g++
+
+.clang-tmpl:
+  variables: &clang
+    CC: clang
+    CXX: clang++
+    clang: y
+
+centos-7-2-gcc:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: centos:7.2
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+centos-7-2-gcc-debug:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: centos:7.2
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+debian-jessie-clang:
+  <<: *build
+  variables:
+    <<: *clang
+    CONTAINER: debian:jessie
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+debian-jessie-clang-debug:
+  <<: *build
+  variables:
+    <<: *clang
+    CONTAINER: debian:jessie
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+debian-jessie-gcc:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: debian:jessie
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+debian-jessie-gcc-debug:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: debian:jessie
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+debian-stretch-clang:
+  <<: *build
+  variables:
+    <<: *clang
+    CONTAINER: debian:stretch
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+debian-stretch-clang-debug:
+  <<: *build
+  variables:
+    <<: *clang
+    CONTAINER: debian:stretch
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+debian-stretch-gcc:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: debian:stretch
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+debian-stretch-gcc-debug:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: debian:stretch
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+# Ubuntu Trusty's Clang is 3.4 while Xen requires 3.5
+
+ubuntu-trusty-gcc:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: ubuntu:trusty
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+ubuntu-trusty-gcc-debug:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: ubuntu:trusty
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+ubuntu-xenial-clang:
+  <<: *build
+  variables:
+    <<: *clang
+    CONTAINER: ubuntu:xenial
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+ubuntu-xenial-clang-debug:
+  <<: *build
+  variables:
+    <<: *clang
+    CONTAINER: ubuntu:xenial
+    debug: y
+    XEN_TARGET_ARCH: x86_64
+
+ubuntu-xenial-gcc:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: ubuntu:xenial
+    debug: n
+    XEN_TARGET_ARCH: x86_64
+
+ubuntu-xenial-gcc-debug:
+  <<: *build
+  variables:
+    <<: *gcc
+    CONTAINER: ubuntu:xenial
+    debug: y
+    XEN_TARGET_ARCH: x86_64
diff --git a/automation/scripts/build b/automation/scripts/build
new file mode 100755
index 0000000..b90fc43
--- /dev/null
+++ b/automation/scripts/build
@@ -0,0 +1,31 @@
+#!/bin/bash -ex
+
+$CC --version
+
+# random config or default config
+if [[ "${RANDCONFIG}" == "y" ]]; then
+    make -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+else
+    make -C xen defconfig
+fi
+
+# build up our configure options
+cfgargs=()
+cfgargs+=("--disable-stubdom") # more work needed into building this
+cfgargs+=("--disable-rombios")
+cfgargs+=("--enable-docs")
+
+# SeaBIOS cannot be built with clang
+if [[ "${CC}" == "clang" ]]; then
+    cfgargs+=("--with-system-seabios=/usr/share/seabios/bios.bin")
+fi
+
+if [[ "${XEN_TARGET_ARCH}" == "x86_64" ]]; then
+    cfgargs+=("--enable-tools")
+else
+    cfgargs+=("--disable-tools") # we don't have the cross depends installed
+fi
+
+./configure "${cfgargs[@]}"
+
+make dist
-- 
git-series 0.9.1

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.