merge: branch 'ih/glci-testlog-artifact'

CI: various improvements

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2048
This commit is contained in:
Íñigo Huguet
2024-11-11 15:22:47 +00:00
6 changed files with 60 additions and 34 deletions

View File

@@ -14,7 +14,7 @@
# see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha 98b1218f146a1ec96d65e3ce0041f9a6ec5cb5e6
.templates_sha: &template_sha 593a0a5fe35a523a646a7efae5471c9759b8fba3
@@ -60,11 +60,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-759073a4a7c5'
CENTOS_TAG: 'tag-8e3ebf909439'
DEBIAN_TAG: 'tag-529c288644bc'
FEDORA_TAG: 'tag-8e3ebf909439'
UBUNTU_TAG: 'tag-529c288644bc'
ALPINE_TAG: 'tag-0959c37ef19b'
CENTOS_TAG: 'tag-70ac400f2325'
DEBIAN_TAG: 'tag-c03f6a5793ce'
FEDORA_TAG: 'tag-70ac400f2325'
UBUNTU_TAG: 'tag-c03f6a5793ce'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
@@ -83,6 +83,7 @@ variables:
- NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm
- nm-test.log
- testlog.txt
.nm_artifacts_debug:
artifacts:
@@ -90,6 +91,7 @@ variables:
when: always
paths:
- nm-test.log
- testlog.txt
#################################################################
# #

View File

@@ -16,7 +16,7 @@
# see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha 98b1218f146a1ec96d65e3ce0041f9a6ec5cb5e6
.templates_sha: &template_sha 593a0a5fe35a523a646a7efae5471c9759b8fba3
{# Group distros by their common (name,) tuples.#}
{% set distro_groups = [] %}
@@ -88,6 +88,7 @@ variables:
- NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm
- nm-test.log
- testlog.txt
.nm_artifacts_debug:
artifacts:
@@ -95,6 +96,7 @@ variables:
when: always
paths:
- nm-test.log
- testlog.txt
#################################################################
# #

View File

@@ -72,4 +72,4 @@ distributions:
- '3.20'
- '3.19'
- '3.18'
- '3.17'
- '3.17'

View File

@@ -9,8 +9,9 @@ fedora:
support: yes
nm: main
- version: 41
support: yes
support: 2025-11-19
nm: 1.50
tier1-default: yes
- version: 40
support: 2025-05-13
nm: 1.46

View File

@@ -124,7 +124,20 @@ for distro, versions in distros_info.items():
# Select a Tier1 distro
tier1_distro, tier1_version = "", ""
for fed_ver_info in distros_info["fedora"]:
# We prefer the Fedora version marked as tier1-default
if fed_ver_info.get("tier1-default", False):
for tier in (tier2, tier3):
if fed_ver_info["version"] in tier.get("fedora", []):
tier1_distro = "fedora"
tier1_version = fed_ver_info["version"]
tier["fedora"].remove(fed_ver_info["version"])
for distro in ci_distros:
if tier1_distro:
break
for tier in (tier2, tier3):
if distro in tier:
# Exception: we want to use fedora:latest instead of fedora:rawhide because
@@ -142,8 +155,6 @@ for distro in ci_distros:
if not tier[distro]:
del tier[distro]
break
if tier1_distro:
break
if not tier1_distro or not tier1_version:
print("Warn: no suitable distro for Tier 1 found", file=sys.stderr)

View File

@@ -50,7 +50,7 @@ meson --version
export NMTST_SKIP_CHECK_GITLAB_CI=1
# Assert that "$1" is one of the valid values for NM_TEST_SELECT_RUN. die() otherwise.
check_run_assert() {
is_run_selected_assert() {
{ set +x; } 2>/dev/null
local run="$1"
local a
@@ -83,45 +83,54 @@ check_run_assert() {
}
[ -z "$NM_TEST_SELECT_RUN" ] && NM_TEST_SELECT_RUN=all
check_run_assert "$NM_TEST_SELECT_RUN"
is_run_selected_assert "$NM_TEST_SELECT_RUN"
check_run() {
local test_no="$1"
is_run_selected() {
local run="$1"
check_run_assert "$test_no"
is_run_selected_assert "$run"
# Usually, we run the build several times. However, for testing
# the build script manually, it can be useful to explicitly select
# one step to run. For example, if step 3 is known to fail, you
# can still manually run step A by setting NM_TEST_SELECT_RUN=A.
test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$test_no"
test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$run"
}
check_run_clean() {
if ! check_run "$1" ; then
return 1
fi
die_with_testlog() {
mv ./build/meson-logs/testlog.txt ./testlog.txt
exit 1
}
if is_run_selected meson+gcc+docs+valgrind ; then
do_clean
return 0
}
if check_run_clean meson+gcc+docs+valgrind ; then
CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
fi
check_run_clean meson+clang && 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 is_run_selected meson+clang; then
do_clean
CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r
if is_run_selected rpm+meson; then
do_clean
test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson || die_with_testlog
fi
if is_run_selected tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
do_clean
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r || die_with_testlog
mv ./build/meson-dist/NetworkManager-1*.tar.xz "$ARTIFACT_DIR/"
mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/"
do_clean
fi
check_run_clean tarball+meson && CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
if is_run_selected tarball+meson; then
do_clean
CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
###############################################################################
@@ -148,7 +157,8 @@ test_subtree() {
popd
}
if check_run_clean subtree; then
if is_run_selected subtree; then
do_clean
for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do
for cc in gcc clang; do
test_subtree "$d" "$cc"
@@ -160,10 +170,10 @@ fi
if [ "$NM_BUILD_TARBALL" = 1 ]; then
do_clean
if check_run meson+gcc+docs+valgrind ; then
if is_run_selected meson+gcc+docs+valgrind ; then
mv "$ARTIFACT_DIR/docs-html/" ./
fi
if check_run tarball ; then
if is_run_selected tarball ; then
mv \
"$ARTIFACT_DIR"/NetworkManager-1*.tar.xz \
"$ARTIFACT_DIR"/NetworkManager-1*.src.rpm \