From bf7247549440200ccf70cf4404545d7dcf4e7488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Mon, 7 Oct 2024 08:45:43 +0200 Subject: [PATCH] CI: add testlog.txt as build artifacts That way we will be able to check the logs in the case of failure. (cherry picked from commit 0d4c8a235a16f113c0b91712f79e1295cbb9bcbe) (cherry picked from commit b6e2533f82e00b3b663de831119eb244a4937c22) (cherry picked from commit fc238062bd85f4f44e54391fa792e586ef1a060a) (cherry picked from commit e8532d4a41eb9a56faf85dea76088dcba18ff02e) --- .gitlab-ci.yml | 12 +++++++----- .gitlab-ci/ci.template | 2 ++ .gitlab-ci/run-test.sh | 36 ++++++++++++++++++++++++++++-------- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43dab1521e..18229b89eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,11 +57,11 @@ variables: # # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". - ALPINE_TAG: 'tag-d53edbf2ebdd' - CENTOS_TAG: 'tag-c374af7add25' - DEBIAN_TAG: 'tag-0e28ea47158f' - FEDORA_TAG: 'tag-c374af7add25' - UBUNTU_TAG: 'tag-0e28ea47158f' + ALPINE_TAG: 'tag-a53799f015bb' + CENTOS_TAG: 'tag-0711a92b9f36' + DEBIAN_TAG: 'tag-0f5f286d0007' + FEDORA_TAG: 'tag-0711a92b9f36' + UBUNTU_TAG: 'tag-0f5f286d0007' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh' @@ -80,6 +80,7 @@ variables: - NetworkManager-1*.tar.xz - NetworkManager-1*.src.rpm - nm-test.log + - testlog.txt .nm_artifacts_debug: artifacts: @@ -87,6 +88,7 @@ variables: when: always paths: - nm-test.log + - testlog.txt ################################################################# # # diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 437133f34f..53cbd2762b 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -85,6 +85,7 @@ variables: - NetworkManager-1*.tar.xz - NetworkManager-1*.src.rpm - nm-test.log + - testlog.txt .nm_artifacts_debug: artifacts: @@ -92,6 +93,7 @@ variables: when: always paths: - nm-test.log + - testlog.txt ################################################################# # # diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh index 50d0903619..a1d2e505df 100755 --- a/.gitlab-ci/run-test.sh +++ b/.gitlab-ci/run-test.sh @@ -109,22 +109,42 @@ check_run_clean() { return 0 } +die_with_testlog() { + mv ./build/meson-logs/testlog.txt ./testlog.txt + exit 1 +} + 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 + BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh || die_with_testlog mv build/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 +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 || die_with_testlog +fi -check_run_clean autotools+gcc+docs+el7+py2 && test $IS_CENTOS_7 = 1 && PYTHON=python2 BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh +if check_run_clean autotools+clang; then + BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog +fi -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 +if check_run_clean meson+clang; then + BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog +fi + +if check_run_clean rpm+autotools; then + if test $IS_FEDORA = 1 -o $IS_CENTOS = 1; then + ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson || die_with_testlog + fi +fi + +if check_run_clean rpm+meson; then + if test $IS_FEDORA = 1; then + ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson || die_with_testlog + fi +fi if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then - SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r + SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r || die_with_testlog mv ./NetworkManager-1*.tar.xz "$ARTIFACT_DIR/" mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/" do_clean