From 4954c310bd679720e47a468e96fca69ddb455665 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sun, 10 Sep 2023 13:21:35 +0200 Subject: [PATCH] Fix CONTINUE_ON_ERROR Cannot use ici_timed as this would call ici_exit on failure --- src/build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/build.sh b/src/build.sh index f145f60..bd5bcb7 100644 --- a/src/build.sh +++ b/src/build.sh @@ -63,7 +63,7 @@ function build_pkg { pkg_exists "$pkg_name" && echo "Skipped (already built)" && return - if ! ici_cmd bloom-generate "${BLOOM_GEN_CMD}" --os-name="$DISTRIBUTION" --os-version="$DEB_DISTRO" --ros-distro="$ROS_DISTRO"; then + if ! ici_label bloom-generate "${BLOOM_GEN_CMD}" --os-name="$DISTRIBUTION" --os-version="$DEB_DISTRO" --ros-distro="$ROS_DISTRO"; then gha_error "bloom-generate failed for ${pkg_name}" return 1 fi @@ -82,14 +82,14 @@ function build_pkg { version=$( ( git describe --tag --match "*[0-9]*" 2>/dev/null || echo 0 ) | sed 's@^[^0-9]*@@;s@-g[0-9a-f]*$@@') debchange -v "$version-$(date +%Y%m%d.%H%M)" -p -D "$DEB_DISTRO" -u high -m "Append timestamp when binarydeb was built." - ici_cmd update_repo + ici_label update_repo || return 1 SBUILD_OPTS="--chroot=sbuild --no-clean-source --no-run-lintian --nolog $EXTRA_SBUILD_OPTS" if ! ici_cmd sg sbuild -c "sbuild $SBUILD_OPTS"; then # run with sbuild group permissions gha_error "sbuild failed for ${pkg_name}" return 1 fi - ici_cmd ccache -sv + ici_label ccache -sv || return 1 gha_report_result "LATEST_PACKAGE" "$pkg_name" if [ "$INSTALL_TO_CHROOT" == "true" ]; then @@ -119,9 +119,12 @@ function build_source { total="$(echo "$pkg_paths" | wc -l)" for pkg_path in $pkg_paths; do - if ! ici_timed "Building package $count/$total: $pkg_path" build_pkg "$pkg_path"; then - test "$CONTINUE_ON_ERROR" = false && exit 1 || FAIL_EVENTUALLY=1 + ici_time_start "Building package $count/$total: $pkg_path" + if ! build_pkg "$pkg_path"; then + gha_warning "Failed to build package $pkg_path" + test "$CONTINUE_ON_ERROR" = false && ici_exit 1 || FAIL_EVENTUALLY=1 fi + ici_time_end count=$((count + 1)) done