summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2022-10-17 16:22:52 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2022-10-17 17:56:04 +0200
commitbeb5b5a2d55f2ac745c5382b90072ee4a779f1ed (patch)
treecae37752cbaef1186841c91f4d51c6b0397490f3
parentfbd8b4a052005e10e60a4ae4bb79423e01cdcd37 (diff)
downloadlibnice-beb5b5a2d55f2ac745c5382b90072ee4a779f1ed.tar.gz
ci: Use fdo templates
-rw-r--r--.gitlab-ci.yml44
-rw-r--r--tests/docker/centos7-meson/Dockerfile11
-rwxr-xr-xtests/docker/centos7-meson/pip-installs.sh11
3 files changed, 50 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1fdae47..adc4c09 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
stages:
- verify
+ - containers
- build
- test
- deploy
@@ -11,9 +12,6 @@ workflow:
- if: $CI_COMMIT_BRANCH == "latest-release"
- if: $CI_PIPELINE_SOURCE == "web"
-default:
- image: registry.freedesktop.org/libnice/libnice/centos7/meson-build
-
#
# Check "allow-edit" checkbox on merge requests with ci-fairy
#
@@ -21,6 +19,14 @@ default:
include:
- project: 'freedesktop/ci-templates'
file: '/templates/ci-fairy.yml'
+ - project: 'freedesktop/ci-templates'
+ file: '/templates/centos.yml'
+
+.libnice.centos:7:
+ variables:
+ FDO_DISTRIBUTION_VERSION: '7'
+ FDO_DISTRIBUTION_TAG: '2022-10-17'
+ FDO_UPSTREAM_REPO: 'libnice/libnice'
check-allow-collaboration:
extends:
@@ -36,8 +42,20 @@ check-allow-collaboration:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
+build-centos-container:7:
+ extends:
+ - .fdo.container-build@centos # the CI template
+ - .libnice.centos:7 # our template job above
+ stage: containers
+ variables:
+ FDO_DISTRIBUTION_PACKAGES: 'git gtk-doc gnutls-devel gupnp-igd-devel gstreamer1-devel gobject-introspection-devel valgrind net-tools centos-release-scl graphviz'
+ FDO_DISTRIBUTION_EXEC: 'tests/docker/centos7-meson/pip-installs.sh'
+
build:
stage: build
+ extends:
+ - .fdo.distribution-image@centos
+ - .libnice.centos:7
interruptible: true
variables:
PREFIX: "${CI_PROJECT_DIR}/libnice-prefix"
@@ -49,7 +67,7 @@ build:
## && true to make gitlab-ci happy
- source scl_source enable rh-python36 && true
- meson --werror --warnlevel 2 -Dgtk_doc=enabled --prefix=$PREFIX build/
- - ninja-build -C build/
+ - ninja -C build/
artifacts:
paths:
- build/
@@ -202,6 +220,9 @@ build msvc x86 openssl:
test:
stage: test
+ extends:
+ - .fdo.distribution-image@centos
+ - .libnice.centos:7
interruptible: true
needs:
- build
@@ -210,24 +231,28 @@ test:
script:
- ifconfig
- source scl_source enable rh-python36 && true
+ - ninja -C build/
- meson test -C build/ --setup debug
artifacts:
when: on_failure
paths:
- build/meson-logs/
-
test valgrind:
extends: test
script:
- ifconfig
- source scl_source enable rh-python36 && true
- meson configure build -Dgtk_doc=disabled
+ - ninja -C build/
- meson test -C build/ --setup valgrind --print-errorlogs
doc-and-install:
stage: test
+ extends:
+ - .fdo.distribution-image@centos
+ - .libnice.centos:7
interruptible: true
needs:
- build
@@ -237,8 +262,8 @@ doc-and-install:
PREFIX: "${CI_PROJECT_DIR}/libnice-prefix"
script:
- source scl_source enable rh-python36 && true
- - ninja-build -C build/ libnice-doc
- - ninja-build -C build/ install
+ - ninja -C build/ libnice-doc
+ - ninja -C build/ install
- ls -lR ${PREFIX}
artifacts:
paths:
@@ -246,6 +271,9 @@ doc-and-install:
submit-to-coverity:
stage: test
+ extends:
+ - .fdo.distribution-image@centos
+ - .libnice.centos:7
variables:
COVERITY_PROJECT: libnice
PREFIX: "${CI_PROJECT_DIR}/libnice-prefix"
@@ -262,7 +290,7 @@ submit-to-coverity:
- meson --werror --warnlevel 2 -Dgtk_doc=disabled -Dinstrospection=disabled --prefix=$PREFIX cov-build/
- export PATH="$PATH:${CI_PROJECT_DIR}/cov-analysis-linux64/bin"
- echo $PATH
- - cov-build --dir cov-int ninja-build -C cov-build
+ - cov-build --dir cov-int ninja -C cov-build
- tar czvf libnice.tgz cov-int
- curl --form token=$COVERITY_TOKEN --form email=olivier.crete@ocrete.ca --form file=@libnice.tgz --form version="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}" --form description="CI weekly run" https://scan.coverity.com/builds?project=libnice
diff --git a/tests/docker/centos7-meson/Dockerfile b/tests/docker/centos7-meson/Dockerfile
index 694e34e..59a7c63 100644
--- a/tests/docker/centos7-meson/Dockerfile
+++ b/tests/docker/centos7-meson/Dockerfile
@@ -15,13 +15,8 @@
FROM centos:centos7
RUN yum -y update; yum clean all
-RUN yum -y install git gtk-doc gnutls-devel gupnp-igd-devel gstreamer1-devel gobject-introspection-devel valgrind; yum clean all
-RUN yum -y install net-tools; yum clean all
+RUN yum -y install git gtk-doc gnutls-devel gupnp-igd-devel gstreamer1-devel gobject-introspection-devel valgrind net-tools centos-release-scl graphviz
+ADD pip-installs.sh /
+RUN bash -ex /pip-installs.sh && rm /pip-installs.sh
-RUN yum -y install centos-release-scl ; yum clean all
-RUN yum -y install rh-python36; yum clean all
-RUN scl enable rh-python36 "pip3 install meson"
-
-RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; yum clean all
-RUN yum -y install ninja-build; yum clean all
diff --git a/tests/docker/centos7-meson/pip-installs.sh b/tests/docker/centos7-meson/pip-installs.sh
new file mode 100755
index 0000000..b8a4d18
--- /dev/null
+++ b/tests/docker/centos7-meson/pip-installs.sh
@@ -0,0 +1,11 @@
+#/bin/sh
+
+set -ex
+
+yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+yum -y install rh-python36 lcov
+
+scl enable rh-python36 "pip3 install meson==0.60.3"
+scl enable rh-python36 "pip3 install ninja"
+
+yum clean all