NetworkManager/.gitlab-ci.yml
2025-01-02 09:38:28 +01:00

397 lines
11 KiB
YAML

# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
########################################
# #
# THIS FILE IS GENERATED, DO NOT EDIT #
# Edit .gitlab-ci/ci.template instead #
# #
# Regenerate with:
# TEMPLATE_SHA="$(sed -n 's/^.templates_sha: *\&template_sha *\([0-9a-f]\+\)$/\1/p' ./.gitlab-ci/ci.template)"
# pip3 install "git+http://gitlab.freedesktop.org/freedesktop/ci-templates@$TEMPLATE_SHA"
# ci-fairy generate-template
#
########################################
# see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha 593a0a5fe35a523a646a7efae5471c9759b8fba3
include:
# Alpine container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/alpine.yml'
# Centos container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/centos.yml'
# Debian container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/debian.yml'
# Fedora container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/fedora.yml'
# Ubuntu container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/ubuntu.yml'
stages:
- prep
- test
- deploy
- triage
- container_clean
variables:
FDO_UPSTREAM_REPO: NetworkManager/NetworkManager
GIT_DEPTH: 1
# These tags should be updated each time the list of packages is updated
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular NM version
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
CENTOS_TAG: '2025-01-02.0-92bfbb89e265'
FEDORA_TAG: '2025-01-02.0-92bfbb89e265'
UBUNTU_TAG: '2025-01-02.0-4c4fe6ec7dc3'
DEBIAN_TAG: '2025-01-02.0-4c4fe6ec7dc3'
ALPINE_TAG: '2025-01-02.0-a618ee9cdabb'
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'
UBUNTU_EXEC: 'bash .gitlab-ci/debian-install.sh'
DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
.nm_artifacts:
variables:
NM_BUILD_TARBALL: 1
artifacts:
expire_in: 5 days
when: always
paths:
- docs-html
- NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm
- nm-test.log
.nm_artifacts_debug:
artifacts:
expire_in: 5 days
when: always
paths:
- nm-test.log
#################################################################
# #
# containers stage #
# #
#################################################################
# Build a container for each distribution + version. The ci-templates
# will re-use the containers if the tag doesn't change.
centos:stream9@container-prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
fedora:38@container-prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '38'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
ubuntu:20.04@container-prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
ubuntu:22.04@container-prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
debian:12@container-prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
alpine:3.18@container-prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.18'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
#################################################################
# #
# container clean stage #
# run during the clean stage #
# #
#################################################################
#
# This stage will look for the container images we currently have in
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
#
# This job only runs for a scheduled pipeline.
#
# Go to your Profile, Settings, Access Tokens
# Create a personal token with 'api' scope, copy the value.
# Go to CI/CD, Schedules, schedule a monthly job.
# Define a variable of type File named AUTHFILE. Content is that token
# value.
.container-clean:
stage: container_clean
image: golang:alpine
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy -v --authfile $AUTHFILE delete-image
--repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
--exclude-tag $FDO_DISTRIBUTION_TAG
dependencies: []
allow_failure: true
only:
- schedules
centos:stream9@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
fedora:38@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '38'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
ubuntu:20.04@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
ubuntu:22.04@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
debian:12@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
alpine:3.18@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/alpine/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '3.18'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
#################################################################
# #
# build stage #
# #
#################################################################
.build@template:
stage: test
script:
- env
- r=0
- .gitlab-ci/run-test.sh 2>&1 | tee /tmp/nm-test.log || r=$?
- mv /tmp/nm-test.log .
- exit $r
dependencies: []
#################################################################
# #
# test stage #
# #
#################################################################
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "centos:stream9@container-prep"
t_fedora:38:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts_debug
variables:
FDO_DISTRIBUTION_VERSION: '38'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "fedora:38@container-prep"
when: manual
t_ubuntu:20.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
variables:
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "ubuntu:20.04@container-prep"
when: manual
t_ubuntu:22.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
variables:
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "ubuntu:22.04@container-prep"
when: manual
t_debian:12:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
variables:
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "debian:12@container-prep"
when: manual
t_alpine:3.18:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
variables:
FDO_DISTRIBUTION_VERSION: '3.18'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "alpine:3.18@container-prep"
when: manual
#################################################################
# #
# specific jobs #
# #
#################################################################
check-patch:
extends:
- .fdo.distribution-image@centos
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "centos:stream9@container-prep"
stage: test
script:
- date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh
allow_failure: true
check-tree:
extends:
- .fdo.distribution-image@centos
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "centos:stream9@container-prep"
stage: test
script:
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-python-black-format.sh --check
- date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
- date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
pages:
stage: deploy
script:
- mv docs-html public
artifacts:
expire_in: 20 days
paths:
- public
only:
- main
dependencies:
- t_centos:stream9
needs:
- t_centos:stream9
triage:issues:
stage: triage
image: ruby:2.7
script:
- gem install gitlab-triage
- gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
only:
- schedules