summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-04-18 08:46:53 +0200
committerThomas Haller <thaller@redhat.com>2019-04-18 21:51:20 +0200
commit6fe35b270603fd1e55d5b24a472e6cd08e714014 (patch)
treed917fb69a5573fd5006a0c475ae73449819db2f6
parent7d62f81e2ecf66498bb7eafca74eca5f2570728c (diff)
downloadNetworkManager-th/gitlab-ci-build-more.tar.gz
gitlab-ci: build on Ubuntu 16.04, 18.04, Debian stretch (9), testing, sidth/gitlab-ci-build-more
-rw-r--r--.gitlab-ci.yml75
-rwxr-xr-xcontrib/debian/REQUIRED_PACKAGES73
-rwxr-xr-xcontrib/scripts/nm-ci-run.sh32
3 files changed, 152 insertions, 28 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8b96f910db..8a231f9007 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,21 +12,33 @@ stages:
before_script:
- date '+%Y%m%d-%H%M%S'; NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES
- date '+%Y%m%d-%H%M%S'; dnf install -y glibc-langpack-pl ccache clang
- - date '+%Y%m%d-%H%M%S'; locale -a
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-patch-gtkdoc.sh || true
-.fedora_script: &fedora_script
+.debian_install: &debian_install
+ before_script:
+ - date '+%Y%m%d-%H%M%S'; apt-get update
+ - date '+%Y%m%d-%H%M%S'; NM_INSTALL="apt-get -qq install -y" ./contrib/debian/REQUIRED_PACKAGES
+ - date '+%Y%m%d-%H%M%S'; dbus-uuidgen --ensure
+ - date '+%Y%m%d-%H%M%S'; sed -i 's/^# \(pl_PL.UTF-8 .*\)$/\1/p' /etc/locale.gen ; true
+ - date '+%Y%m%d-%H%M%S'; locale-gen pl_PL.UTF-8
+ - date '+%Y%m%d-%H%M%S'; pip3 install meson
+
+.do_build: &do_build
stage: test
script:
- date '+%Y%m%d-%H%M%S'; uname -a
- - date '+%Y%m%d-%H%M%S'; dnf list --installed
- - date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
+ - date '+%Y%m%d-%H%M%S'; locale -a
+ - date '+%Y%m%d-%H%M%S'; env
+ - date '+%Y%m%d-%H%M%S'; meson --version
+ - date '+%Y%m%d-%H%M%S'; which dnf && dnf list --installed
+ - date '+%Y%m%d-%H%M%S'; which dpkg && dpkg -l
+ - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html
- - date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=meson CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
- - date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
- - date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
- - date '+%Y%m%d-%H%M%S'; ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
- - date '+%Y%m%d-%H%M%S'; ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
+ - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
+ - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+ - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+ - date '+%Y%m%d-%H%M%S'; grep -q '^NAME=Fedora' /etc/os-release && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
+ - date '+%Y%m%d-%H%M%S'; grep -q '^NAME=Fedora' /etc/os-release && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
- date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html
checkpatch:
@@ -41,35 +53,62 @@ checkpatch:
paths:
- checkpatch-out.txt
-build_f28:
+t_fedora:28:
<<: *fedora_install
image: fedora:28
- <<: *fedora_script
+ <<: *do_build
artifacts:
expire_in: 1 day
paths:
- docs-html
-build_f29:
+t_fedora:29:
<<: *fedora_install
image: fedora:29
- <<: *fedora_script
+ <<: *do_build
-build_f30:
+t_fedora:30:
<<: *fedora_install
image: fedora:30
- <<: *fedora_script
+ <<: *do_build
-build_frawhide:
+t_fedora:rawhide:
<<: *fedora_install
image: fedora:rawhide
- <<: *fedora_script
+ <<: *do_build
allow_failure: true
+ when: manual
+
+t_ubuntu:16.04:
+ <<: *debian_install
+ image: ubuntu:16.04
+ <<: *do_build
+
+t_ubuntu:18.04:
+ <<: *debian_install
+ image: ubuntu:18.04
+ <<: *do_build
+
+t_debian:9:
+ <<: *debian_install
+ image: debian:stretch
+ <<: *do_build
+
+t_debian:testing:
+ <<: *debian_install
+ image: debian:testing
+ <<: *do_build
+ when: manual
+
+t_debian:sid:
+ <<: *debian_install
+ image: debian:sid
+ <<: *do_build
pages:
stage: deploy
dependencies:
- - build_f28
+ - t_fedora:29
script:
- mv docs-html public
artifacts:
diff --git a/contrib/debian/REQUIRED_PACKAGES b/contrib/debian/REQUIRED_PACKAGES
new file mode 100755
index 0000000000..a56c55d024
--- /dev/null
+++ b/contrib/debian/REQUIRED_PACKAGES
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# A list of packages useful/needed to build and develop
+# NetworkManager on Debian and Ubuntu.
+#
+# Not all of these packages are available, depending
+# on your distribution/release. But the script will happily
+# skip them.
+#
+# Not all of these packages are strictly speaking necessary.
+# This is a generous list of related packages.
+
+install() {
+ for p in "$@"; do
+ if [ "$NM_INSTALL" != "" ]; then
+ $NM_INSTALL "$p" || :
+ else
+ sudo apt-get install -y "$p" || :
+ fi
+ done
+}
+
+install \
+ \
+ autoconf \
+ automake \
+ autopoint \
+ clang \
+ dbus \
+ dbus-x11 \
+ dnsmasq \
+ git \
+ gobject-introspection \
+ gtk-doc-tools \
+ intltool \
+ iproute2 \
+ iptables \
+ libcurl4-gnutls-dev \
+ libdbus-1-dev \
+ libgcrypt11-dev \
+ libgirepository1.0-dev \
+ libglib2.0-dev \
+ libglib2.0-doc \
+ libgnutls-dev \
+ libgnutls28-dev \
+ libiw-dev \
+ libjansson-dev \
+ libjansson4 \
+ libmm-glib-dev \
+ libndp-dev \
+ libnewt-dev \
+ libnss3-dev \
+ libpolkit-gobject-1-dev \
+ libreadline-dev \
+ libsystemd-dev \
+ libteam-dev \
+ libtool \
+ libudev-dev \
+ locales \
+ make \
+ meson \
+ pkg-config \
+ ppp \
+ ppp-dev \
+ python-dbus \
+ python-gi \
+ python-software-properties \
+ python3-dbus \
+ python3-gi \
+ python3-pip \
+ uuid-dev \
+ \
+ #end
diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh
index 1e947080dc..fca58ca61f 100755
--- a/contrib/scripts/nm-ci-run.sh
+++ b/contrib/scripts/nm-ci-run.sh
@@ -28,7 +28,9 @@ _is_true() {
esac
}
+USE_CCACHE=0
if which ccache &>/dev/null; then
+ USE_CCACHE=1
export PATH="/usr/lib64/ccache:/usr/lib/ccache${PATH:+:${PATH}}"
fi
@@ -50,16 +52,21 @@ _WITH_LIBTEAM="$_TRUE"
_WITH_DOCS="$_TRUE"
_WITH_SYSTEMD_LOGIND="$_TRUE"
-if [ "$CI" == travis ]; then
- _WITH_WERROR=0
- _WITH_LIBTEAM="$_FALSE"
- _WITH_DOCS="$_FALSE"
- _WITH_SYSTEMD_LOGIND="$_FALSE"
-elif [ "$CI" == gitlab ]; then
- :
-else
- die "invalid \$CI \"$CI\""
-fi
+case "$CI" in
+ ""|"true"|"default"|"gitlab")
+ CI=default
+ ;;
+ "travis")
+ _WITH_WERROR=0
+ _WITH_LIBTEAM="$_FALSE"
+ _WITH_DOCS="$_FALSE"
+ _WITH_SYSTEMD_LOGIND="$_FALSE"
+ ;;
+ *)
+ die "invalid \$CI \"$CI\""
+ ;;
+esac
+
if [ "$CC" != gcc ]; then
_WITH_CRYPTO=nss
fi
@@ -198,3 +205,8 @@ if [ "$BUILD_TYPE" == autotools ]; then
elif [ "$BUILD_TYPE" == meson ]; then
run_meson
fi
+
+if [ "$USE_CCACHE" = 1 ]; then
+ echo "ccache statistics:"
+ ccache -s
+fi