From bdac03fe9a8def21ef16bdd7bd0497dab83fbb1f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 4 Feb 2019 11:06:21 +0100 Subject: [PATCH] gitlab-ci: build with clang and do multiple builds in one test-step 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. --- .gitlab-ci.yml | 61 ++++++++++++++---------------------- contrib/scripts/nm-ci-run.sh | 4 +++ 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1933aa49b..b4dffc40b 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 + - /tmp/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 - -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 188d631e5..c3d0cb2e5 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