about summary refs log tree commit diff
path: root/.gitlab-ci
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci')
-rw-r--r--.gitlab-ci/ci.template73
-rw-r--r--.gitlab-ci/config.yml13
-rwxr-xr-x.gitlab-ci/coverity.sh25
-rw-r--r--.gitlab-ci/distros-info.yml131
-rwxr-xr-x.gitlab-ci/run-test.sh56
5 files changed, 230 insertions, 68 deletions
diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template
index 334b75a9..208c3490 100644
--- a/.gitlab-ci/ci.template
+++ b/.gitlab-ci/ci.template
@@ -43,6 +43,8 @@ include:
     ref: *template_sha
     file: '/templates/{{distro_group.name}}.yml'
 {% endfor %}
+  - project: 'freedesktop/ci-templates'
+    file: '/templates/ci-fairy.yml'
 
 stages:
   - prep
@@ -51,6 +53,7 @@ stages:
   - tier3
   - deploy
   - triage
+  - coverity
 
 variables:
   FDO_UPSTREAM_REPO: NetworkManager/NetworkManager
@@ -113,8 +116,11 @@ tier{{distro.tier}}:{{distro.name}}:{{version}}@prep:
     FDO_DISTRIBUTION_VERSION: '{{version}}'
     FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
     FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC
+  rules:
+    - if: $CI_PIPELINE_SOURCE != 'schedule'
 {% if distro.tier > 1 %}
-  when: manual
+      when: manual
+      allow_failure: true
 {% endif %}
 {% endfor %}
 {% endfor %}
@@ -151,13 +157,9 @@ t_{{distro.name}}:{{version}}:
   parallel:
     matrix:
       - NM_TEST_SELECT_RUN:
-        - autotools+gcc+docs+valgrind
         - meson+gcc+docs+valgrind
-        - autotools+clang
         - meson+clang
-        - rpm+autotools
         - rpm+meson
-        - tarball+autotools
         - tarball+meson
         - tarball
         - subtree
@@ -173,6 +175,8 @@ t_{{distro.name}}:{{version}}:
     {% endif %}
   needs:
     - "tier{{distro.tier}}:{{distro.name}}:{{version}}@prep"
+  rules:
+    - if: $CI_PIPELINE_SOURCE != 'schedule'
 {% endfor %}
 {% endfor %}
 
@@ -190,6 +194,8 @@ check-patch:
     FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
   needs:
     - "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
+  rules:
+    - if: $CI_PIPELINE_SOURCE != 'schedule'
   stage: tier1
   script:
     - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh
@@ -203,6 +209,8 @@ check-tree:
     FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
   needs:
     - "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
+  rules:
+    - if: $CI_PIPELINE_SOURCE != 'schedule'
   stage: tier1
   script:
     - date '+%Y%m%d-%H%M%S'; clang-format --version
@@ -221,25 +229,62 @@ pages:
     expire_in: 20 days
     paths:
       - public
-  only:
-    - main
+  rules:
+    - if: $CI_PIPELINE_SOURCE == 'schedule'
+      when: never
+    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'main'
   dependencies:
-    - "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [autotools+gcc+docs+valgrind]"
+    - "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [meson+gcc+docs+valgrind]"
   needs:
-    - "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [autotools+gcc+docs+valgrind]"
+    - "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [meson+gcc+docs+valgrind]"
 
 triage:issues:
   stage: triage
-  image: ruby:2.7
+  image: ruby:3
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "daily"
+  tags:
+    - placeholder-job  # The job mostly waits on network requests, so use only one CPU: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/1358#note_2457416
   script:
     - gem install gitlab-triage
-    - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
-  only:
-    - schedules
+    - gitlab-triage --debug --token $API_TOKEN --source-id $CI_PROJECT_ID
+
+coverity:
+  extends:
+    - .fdo.distribution-image@fedora
+  variables:
+    FDO_DISTRIBUTION_VERSION: '40'
+    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
+  stage: coverity
+  needs: []
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
+  script:
+    - dnf install -y curl
+    - BUILD_TYPE=meson CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
+    - cd build
+    - ../.gitlab-ci/coverity.sh download
+    - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
+    - ../.gitlab-ci/coverity.sh upload
+
+# Clean the generated images periodically to get updated snapshots of the distribution images.
+# Create an scheduled pipeline to run it, passing an AUTHFILE environment variable of type
+# 'File' with an authentication token with API access level.
+clean-images:
+  extends:
+    - .fdo.ci-fairy
+  stage: prep
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
+  script:
+    - ci-fairy -v --authfile $AUTHFILE delete-image --project NetworkManager/NetworkManager --all
 
 # Have detached MR pipeline (https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html)
 # https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
 workflow:
   rules:
     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_PIPELINE_SOURCE == 'push'
+    - if: $CI_PIPELINE_SOURCE == 'schedule'
+    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
+      when: never
+    - if: $CI_COMMIT_BRANCH
diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml
index 9776b76e..05b19c1c 100644
--- a/.gitlab-ci/config.yml
+++ b/.gitlab-ci/config.yml
@@ -24,14 +24,17 @@ distributions:
     tier: 1
     versions:
       - '40'
-      - rawhide
-  - name: centos
-    tier: 1
-    versions:
-      - 'stream9'
 
   # TIER 2: distribution versions that will or might use the current NM version.
   # Run when doing a release.
+  - name: centos
+    tier: 2
+    versions:
+      - 'stream9'
+  - name: fedora
+    tier: 2
+    versions:
+      - rawhide
   - name: debian
     tier: 2
     versions:
diff --git a/.gitlab-ci/coverity.sh b/.gitlab-ci/coverity.sh
new file mode 100755
index 00000000..8d06c52e
--- /dev/null
+++ b/.gitlab-ci/coverity.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -e
+
+[ "$COVERITY_SCAN_PROJECT_NAME" = "" ] && echo "missing COVERITY_SCAN_PROJECT_NAME" >&2 && exit 1
+[ "$COVERITY_SCAN_TOKEN" = "" ] && echo "missing COVERITY_SCAN_PROJECT_NAME" >&2 && exit 1
+
+if [ "$1" = "download" ]; then
+    curl https://scan.coverity.com/download/linux64 \
+         -o /tmp/cov-analysis-linux64.tar.gz        \
+         --form "project=$COVERITY_SCAN_PROJECT_NAME" \
+         --form "token=$COVERITY_SCAN_TOKEN"
+
+    tar xvzf /tmp/cov-analysis-linux64.tar.gz
+elif [ "$1" = "upload" ]; then
+    tar cvzf cov-int.tar.gz cov-int
+    ls -l cov-int.tar.gz
+    curl "https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME" \
+          --form "token=$COVERITY_SCAN_TOKEN" --form "email=$GITLAB_USER_EMAIL" \
+          --form file=@cov-int.tar.gz --form version="`meson introspect --projectinfo | jq -r .version`" \
+          --form description="ci run: $CI_COMMIT_TITLE / `git rev-parse --short HEAD`"
+    rm -rf cov-int*
+else
+    echo "invalid command: $1" >&2
+    exit 1
+fi
\ No newline at end of file
diff --git a/.gitlab-ci/distros-info.yml b/.gitlab-ci/distros-info.yml
new file mode 100644
index 00000000..53a63e21
--- /dev/null
+++ b/.gitlab-ci/distros-info.yml
@@ -0,0 +1,131 @@
+# Fedora:
+#   cadence: every 6 months
+#   support: 13 months
+# Image aliases: latest, rawhide
+fedora:
+- version: rawhide
+  support: yes
+  nm: main
+- version: 40
+  support: 2025-05-13
+  nm: 1.46
+- version: 39
+  support: 2024-11-12
+  nm: 1.44
+
+# CentOS Stream
+centos:
+- version: stream9
+  support: 2027-05-31
+  nm: main
+- version: stream8
+  support: 2024-05-31  ## EOL
+  nm: 1.40
+
+# RHEL:
+# Even minor versions:
+#   cadence: every year
+#   support: 2 years EUS + 2 years SAP / Enhaced EUS
+# Odd minor versions:
+#   cadence: every year (every other 6 months than even versions)
+#   support: 6 months
+rhel:
+- version: 9.5
+  support: yes
+  nm: main
+- version: 9.4
+  support: 2026-04-30
+  extended-support: 2028-04-30
+  nm: 1.46
+- version: 9.2
+  support: 2025-05-31
+  extended-support: 2027-05-31
+  nm: 1.42
+- version: 8.10  # last RHEL 8 release, maintenaince support only
+  support: 2029-05-31
+  extended-support: no
+  nm: 1.40
+- version: 8.8
+  support: 2025-05-31
+  extended-support: 2027-05-31
+  nm: 1.40
+# SAP / Enhaced EUS only:
+- version: 9.0
+  support: 2024-05-31
+  extended-support: 2026-05-31
+  nm: 1.36
+- version: 8.6
+  support: 2024-05-31
+  extended-support: 2026-05-31
+  nm: 1.36
+
+# Ubuntu:
+# LTS:
+#   cadence: every 2 years
+#   support: 5 years LTS + 5 years extended security
+# non-LTS (rolling):
+#   cadence: every 6 months
+#   support: 9 months
+# Image aliases: latest (LTS), rolling (LTS or non-LTS), devel
+ubuntu:
+- version: devel
+  support: yes
+  nm: main
+- version: 24.04
+  name: focal
+  support: 2029-05-31
+  extended-support: 2034-04-25
+  nm: 1.46
+- version: 22.04
+  name: jammy
+  support: 2027-06-01
+  extended-support: 2032-04-21
+  nm: 1.36
+- version: 20.04
+  name: noble
+  support: 2025-05-29
+  extended-support: 2030-04-23
+  nm: 1.22
+
+# Debian:
+#   cadence: every 2 years
+#   support: 3 years + 2 years LTS
+# Images aliases: stable, oldstable, oldoldstable
+debian:
+- version: devel
+  support: yes
+  nm: main
+- version: sid
+  support: yes
+  nm: main
+- version: 12
+  name: bookworm
+  support: 2026-06-11
+  extended-support: 2028-06-30
+  nm: 1.42
+- version: 11
+  name: bullseye
+  support: 2024-08-15
+  extended-support: 2026-08-31
+  nm: 1.30
+
+# Alpine:
+#   cadence: every 6 months
+#   support: 2 years
+# Image aliases: latest, edge (development)
+alpine:
+- version: edge
+  support: yes
+  nm: main
+- version: 3.20
+  support: 2026-04-01
+  nm: 1.46
+- version: 3.19
+  support: 2025-11-01
+  nm: 1.44
+- version: 3.18
+  support: 2025-05-09
+  nm: 1.42
+- version: 3.17
+  support: 2024-11-22
+  nm: 1.40
diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh
index d97163b6..4091cdd4 100755
--- a/.gitlab-ci/run-test.sh
+++ b/.gitlab-ci/run-test.sh
@@ -57,13 +57,9 @@ check_run_assert() {
 
     # These are the supported $NM_TEST_SELECT_RUN values.
     local _CHECK_RUN_LIST=(
-        autotools+gcc+docs+valgrind
         meson+gcc+docs+valgrind
-        autotools+clang
         meson+clang
-        rpm+autotools
         rpm+meson
-        tarball+autotools
         tarball+meson
         tarball
         subtree
@@ -110,17 +106,13 @@ check_run_clean() {
     return 0
 }
 
-if check_run_clean autotools+gcc+docs+valgrind ; then
-    BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
-    mv build/INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
+if check_run_clean meson+gcc+docs+valgrind ; then
+    BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
+    mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
 fi
 
-check_run_clean meson+gcc+docs+valgrind && BUILD_TYPE=meson     CC=gcc   WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
-check_run_clean autotools+clang         && BUILD_TYPE=autotools CC=clang WITH_DOCS=0                 contrib/scripts/nm-ci-run.sh
-check_run_clean meson+clang             && BUILD_TYPE=meson     CC=clang WITH_DOCS=0                 contrib/scripts/nm-ci-run.sh
-
-check_run_clean rpm+autotools && test $IS_FEDORA = 1 -o $IS_CENTOS = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson
-check_run_clean rpm+meson     && test $IS_FEDORA = 1                   && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
+check_run_clean meson+clang && BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
+check_run_clean rpm+meson && test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
 
 if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
     SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r
@@ -129,41 +121,7 @@ if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
     do_clean
 fi
 
-if check_run_clean tarball+autotools; then
-    BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
-    pushd ./build
-        # dist & build with autotools
-        make distcheck -j$(nproc)
-
-        # build with meson
-        DISTSRC="./distsrc-$RANDOM"
-        mkdir $DISTSRC
-        tar xvf ./NetworkManager-1*.tar.xz -C $DISTSRC --strip-components=1
-        pushd $DISTSRC
-            BUILD_TYPE=meson CC=gcc WITH_DOCS=1 ../../contrib/scripts/nm-ci-run.sh
-        popd
-    popd
-    do_clean
-fi
-
-if check_run_clean tarball+meson; then
-    BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
-    pushd ./build
-        # dist with meson/ninja
-        ninja dist
-
-        # build with autotools
-        DISTSRC="./distsrc-$RANDOM"
-        mkdir $DISTSRC
-        tar xvf ./meson-dist/NetworkManager-1*.tar.xz -C $DISTSRC --strip-components=1
-        pushd $DISTSRC
-            BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 ../../contrib/scripts/nm-ci-run.sh
-        popd
-        rm -rf $DISTSRC
-    popd
-    do_clean
-fi
-
+check_run_clean tarball+meson && BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
 
 ###############################################################################
 
@@ -202,7 +160,7 @@ fi
 
 if [ "$NM_BUILD_TARBALL" = 1 ]; then
     do_clean
-    if check_run autotools+gcc+docs+valgrind ; then
+    if check_run meson+gcc+docs+valgrind ; then
         mv "$ARTIFACT_DIR/docs-html/" ./
     fi
     if check_run tarball ; then