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 0d4c8a235a)
(cherry picked from commit b6e2533f82)
This commit is contained in:
Íñigo Huguet 2024-10-07 08:45:43 +02:00
parent 5db6475087
commit fc238062bd
3 changed files with 42 additions and 16 deletions

View file

@ -57,11 +57,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-d8c61f882b9d'
CENTOS_TAG: 'tag-8044890d9044'
DEBIAN_TAG: 'tag-538b968b666b'
FEDORA_TAG: 'tag-8044890d9044'
UBUNTU_TAG: 'tag-538b968b666b'
ALPINE_TAG: 'tag-a4614e7b0985'
CENTOS_TAG: 'tag-04df72fa6a45'
DEBIAN_TAG: 'tag-7bf37da7bcaf'
FEDORA_TAG: 'tag-04df72fa6a45'
UBUNTU_TAG: 'tag-7bf37da7bcaf'
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
#################################################################
# #

View file

@ -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
#################################################################
# #

View file

@ -110,27 +110,49 @@ 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 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 autotools+clang; then
BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
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 ./build/meson-dist/NetworkManager-1*.tar.xz "$ARTIFACT_DIR/"
mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/"
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
BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
pushd ./build
# dist & build with autotools
make distcheck -j$(nproc)
@ -140,14 +162,14 @@ if check_run_clean tarball+autotools; then
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
BUILD_TYPE=meson CC=gcc WITH_DOCS=1 ../../contrib/scripts/nm-ci-run.sh || die_with_testlog
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
BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
pushd ./build
# dist with meson/ninja
ninja dist
@ -157,7 +179,7 @@ if check_run_clean tarball+meson; then
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
BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 ../../contrib/scripts/nm-ci-run.sh || die_with_testlog
popd
rm -rf $DISTSRC
popd