Skip to content

Commit

Permalink
Fix CONTINUE_ON_ERROR
Browse files Browse the repository at this point in the history
Cannot use ici_timed as this would call ici_exit on failure
  • Loading branch information
rhaschke committed Sep 10, 2023
1 parent b8935bf commit 4954c31
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4954c31

Please sign in to comment.