summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2021-06-19 17:36:41 +0200
committerJens Georg <mail@jensge.org>2021-06-19 18:52:35 +0200
commitb7f0b5e842ace144c2fdf57f275845afa7049645 (patch)
treeee6da3ab8183a4d8dc727cdde85a37854fa62da6
parent232398487187bd67ada18337b0b3eb6e6cfbdd4d (diff)
downloadgupnp-tools-b7f0b5e842ace144c2fdf57f275845afa7049645.tar.gz
ci: Add initial CI setup
-rw-r--r--.gitlab-ci.yml195
1 files changed, 195 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..ed76e71
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,195 @@
+include:
+ - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/ci-fairy.yml"
+ - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/290b79e0e78eab67a83766f4e9691be554fc4afd/templates/fedora.yml'
+
+variables:
+ MESON_TEST_TIMEOUT_MULTIPLIER: 3
+
+stages:
+ - review
+ - prepare
+ - build
+ - test
+ - analysis
+ - website
+
+.check-template: &check
+ extends:
+ - .fdo.ci-fairy
+ artifacts:
+ expire_in: 1 week
+ paths:
+ - check-junit-report.xml
+ reports:
+ junit: check-junit-report.xml
+
+check-commit-log:
+ variables:
+ GIT_DEPTH: "100"
+ stage: review
+ script:
+ - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
+ then
+ ci-fairy check-commits --junit-xml=check-junit-report.xml ;
+ else
+ echo "Not a merge request" ;
+ fi
+ <<: *check
+
+check-merge-request:
+ variables:
+ GIT_STRATEGY: none
+ stage: review
+ script:
+ - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
+ then
+ ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-junit-report.xml ;
+ else
+ echo "Not a merge request" ;
+ fi
+ <<: *check
+
+.build-template: &build
+ stage: build
+ script:
+ - meson . build --prefix=/usr -Db_coverage=true
+ - ninja -C build
+ artifacts:
+ expire_in: 1 day
+ paths:
+ - build
+
+.gupnp_tools.fedora@common:
+ variables:
+ BASE_TAG: '2021-06-19.0'
+ FDO_UPSTREAM_REPO: GNOME/gupnp-tools
+ FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip xmlto gobject-introspection-devel gtk-doc libsoup-devel libuuid-devel libxml2-devel vala ninja-build gtk3-devel gtksourceview4-devel'
+ FDO_DISTRIBUTION_EXEC: |
+ dnf clean all &&
+ pip3 install meson
+
+.gupnp_tools.fedora:34@x86_64:
+ extends: .gupnp_tools.fedora@common
+ variables:
+ FDO_DISTRIBUTION_VERSION: 34
+ FDO_DISTRIBUTION_TAG: "x86_64-${BASE_TAG}"
+
+build-fedora-container@x86_64:
+ extends:
+ - .fdo.container-build@fedora
+ - .gupnp_tools.fedora:34@x86_64
+ stage: prepare
+ variables:
+ GIT_STRATEGY: none
+
+
+build-fedora@x86_64:
+ extends:
+ - .fdo.distribution-image@fedora
+ - .gupnp_tools.fedora:34@x86_64
+ needs:
+ - build-fedora-container@x86_64
+ <<: *build
+
+
+.test-template: &test
+ stage: test
+ variables:
+ G_SLICE: "always-malloc"
+ MALLOC_CHECK_: "3"
+ script:
+ - cd build
+ - |
+ # Remove the many "CI_" variables from the environment. Meson dumps the
+ # whole environment for every failed test, and that gives a whole
+ # screenful of junk each time unless we strip these.
+ unset $(env|grep -o '^CI_[^=]*')
+ env LANG=C.UTF-8 LC_ALL=C.UTF-8 meson test --print-errorlogs ${MESON_TEST_EXTRA_ARGS}
+ after_script:
+ - |
+ echo "Distribution: "
+ echo
+ egrep '^NAME=|^VERSION=' /etc/os-release
+ echo
+ echo "Test suite settings:"
+ echo
+ echo "G_MESSAGES_DEBUG: ${G_MESSAGES_DEBUG}"
+ echo "MESON_TEST_EXTRA_ARGS: ${MESON_TEST_EXTRA_ARGS}"
+ echo
+ echo "These values can be set at https://gitlab.gnome.org/GNOME/gupnp-tools/pipelines/new"
+ artifacts:
+ expire_in: 1 day
+ when: always
+ paths:
+ - build
+ reports:
+ junit: "build/meson-logs/testlog.junit.xml"
+
+test-fedora@x86_64:
+ extends:
+ - .fdo.distribution-image@fedora
+ - .gupnp_tools.fedora:34@x86_64
+ needs:
+ - build-fedora@x86_64
+ <<: *test
+
+ #trigger-rygel:
+ #stage: analysis
+ #needs:
+ # - test-fedora@x86_64
+ #trigger: GNOME/rygel
+ #only:
+ # - master
+
+#coverage-analysis:
+# extends:
+# - .fdo.distribution-image@fedora
+# - .gupnp_tools.fedora:34@x86_64
+# stage: analysis
+# allow_failure: true
+# script:
+# - cd build
+# - mkdir -p coveragereport
+# - gcovr --html-details --print-summary --root=.. --exclude=../build --exclude=../subprojects --exclude=../docs/reference --exclude=../tests --exclude=../tools --exclude=../examples --output coveragereport/index.html
+# coverage: '/^lines: (\d+\.\d+\%)/'
+# artifacts:
+# when: always
+# paths:
+# - build/coveragereport
+# needs:
+# - test-fedora@x86_64
+
+static-scan:
+ extends:
+ - .fdo.distribution-image@fedora
+ - .gupnp_tools.fedora:34@x86_64
+ stage: analysis
+ needs:
+ - build-fedora-container@x86_64
+ script:
+ - meson --buildtype=debug _scan_build
+ - ninja -C _scan_build scan-build
+ artifacts:
+ paths:
+ - _scan_build/meson-logs
+ allow_failure: true
+
+#pages:
+# extends:
+# - .fdo.distribution-image@fedora
+# - .gupnp_tools.fedora:34@x86_64
+# stage: website
+# script:
+# - meson doc-build -Dgtk_doc=true
+# - ninja -C doc-build gupnp-doc
+# - mkdir -p public
+# - mv doc-build/doc/html public/docs
+# artifacts:
+# paths:
+# - public
+# needs:
+# - build-fedora-container@x86_64
+# only:
+# - master
+# - /^wip\/.*\/ci.*$/
+#