summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-02-04 11:06:21 +0100
committerThomas Haller <thaller@redhat.com>2019-02-06 13:37:16 +0100
commit343d0c2e6525710c7e161d0bd83c4ea428f2612e (patch)
tree932a1084aed70c8f0f04afab9569ed81156f6866
parent50d74d83fa1c22d759bc89e42dba90dface014a1 (diff)
downloadNetworkManager-th/gitlab-ci-clang.tar.gz
gitlab-ci: build with clang and do multiple builds in one test-stepth/gitlab-ci-clang
Also, let one docker image do multiple builds. We fetch a fedora docker image, and then install 250 MB of packages. That alone takes a lot of time and resources. Instead of running a large number of docker images that only do one build, let one image do several builds. Also, install ccache. Hopefully this way we can benefit from building the same sources multiple times. Also note that building docs does not work currently with clang, due to g-ir-scanner. See commit 05568860cce5332977d92b85f7c25b8ed646cd58.
-rw-r--r--.gitlab-ci.yml61
-rwxr-xr-xcontrib/scripts/nm-ci-run.sh4
2 files changed, 28 insertions, 37 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1933aa49bf..b4dffc40b5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,10 +11,25 @@ stages:
.fedora_install: &fedora_install
before_script:
- NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES
- - dnf install -y glibc-langpack-pl
+ - dnf install -y glibc-langpack-pl ccache clang
- locale -a
- contrib/scripts/nm-ci-patch-gtkdoc.sh || true
+.fedora_script: &fedora_script
+ stage: test
+ script:
+ - CI=gitlab BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
+ - mv build/INST/share/gtk-doc/html /tmp/docs-html
+ - git clean -fdx
+ - CI=gitlab BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+ - git clean -fdx
+ - CI=gitlab BUILD_TYPE=meson CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
+ - git clean -fdx
+ - CI=gitlab BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+ - git clean -fdx
+ - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
+ - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
+
checkpatch:
image: fedora:28
stage: test
@@ -27,58 +42,30 @@ checkpatch:
paths:
- checkpatch-out.txt
-f28_build_autotools:
+f28_build:
<<: *fedora_install
image: fedora:28
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=autotools contrib/scripts/nm-ci-run.sh
- - mv build/INST/share/gtk-doc/html docs-html
+ <<: *fedora_script
artifacts:
expire_in: 1 day
paths:
- - docs-html
-
-f28_build_meson:
- <<: *fedora_install
- image: fedora:28
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=meson contrib/scripts/nm-ci-run.sh
-
-f28_rpm_autotools_dbg:
- <<: *fedora_install
- image: fedora:28
- stage: test
- script:
- - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
+ - /tmp/docs-html
-f28_rpm_meson_dbg:
- <<: *fedora_install
- image: fedora:28
- stage: test
- script:
- - ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w meson -w test
-
-f_latest_build_autotools:
+f_latest_build:
<<: *fedora_install
image: fedora:latest
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=autotools contrib/scripts/nm-ci-run.sh
+ <<: *fedora_script
-f_rawhide_build_autotools:
+f_rawhide_build:
<<: *fedora_install
image: fedora:rawhide
- stage: test
- script:
- - CI=gitlab BUILD_TYPE=autotools contrib/scripts/nm-ci-run.sh
+ <<: *fedora_script
allow_failure: true
pages:
stage: deploy
dependencies:
- - f28_build_autotools
+ - f28_build
script:
- mv docs-html public
artifacts:
diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh
index 188d631e55..c3d0cb2e54 100755
--- a/contrib/scripts/nm-ci-run.sh
+++ b/contrib/scripts/nm-ci-run.sh
@@ -28,6 +28,10 @@ _is_true() {
esac
}
+if which ccache &>/dev/null; then
+ export PATH="/usr/lib64/ccache:/usr/lib/ccache${PATH:+:${PATH}}"
+fi
+
###############################################################################
if [ "$BUILD_TYPE" == meson ]; then