From add56defe435c50ad0e90527a1f89eee5932f1a6 Mon Sep 17 00:00:00 2001 From: Johnny Mnemonic Date: Fri, 31 Jan 2025 13:11:04 +0100 Subject: [PATCH] Signal build failures to GHA but try to upload any existing build logs --- .github/workflows/make-sandwich.yml | 5 ++--- config/build-order.tpl | 2 +- tools/workflow.bash | 13 ++++++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/make-sandwich.yml b/.github/workflows/make-sandwich.yml index 41aecb6..ae145e2 100644 --- a/.github/workflows/make-sandwich.yml +++ b/.github/workflows/make-sandwich.yml @@ -11,8 +11,6 @@ on: jobs: build_toolchain_parts: runs-on: ubuntu-latest - strategy: - fail-fast: true steps: - uses: actions/checkout@v4 @@ -43,7 +41,8 @@ jobs: # exports ############################################################ echo "BUILD_LOGS=${BUILD_LOGS}" >> $GITHUB_ENV - - uses: actions/upload-artifact@v4 + - if: '!cancelled()' + uses: actions/upload-artifact@v4 with: name: build-logs path: ${{ env.BUILD_LOGS }}/ diff --git a/config/build-order.tpl b/config/build-order.tpl index 4ed96ff..0b06f66 100755 --- a/config/build-order.tpl +++ b/config/build-order.tpl @@ -8,7 +8,7 @@ for _job in @@_BUILD_ORDER_@@; do date - time scripts/Build-Target -cfg @@_TARGET_CONFIG_@@ -job $_job # || exit 1 + time scripts/Build-Target -cfg @@_TARGET_CONFIG_@@ -job $_job || touch /BUILD_FAILED date diff --git a/tools/workflow.bash b/tools/workflow.bash index 9943028..3a77e55 100755 --- a/tools/workflow.bash +++ b/tools/workflow.bash @@ -8,9 +8,9 @@ #CONFIG_DIR="$PWD/toolchain-autobuilds/config" #TOOLS_DIR="$PWD/toolchain-autobuilds/tools" #SNAPSHOTS="$PWD/snapshots" -#PAST_BUILDS="$PWD/past-builds" +#BUILD_LOGS="$PWD/build-logs" # -#export T2_TEMPLATE_BASE_DIR T2_ROOT CONFIG_DIR TOOLS_DIR SNAPSHOTS PAST_BUILDS +#export T2_TEMPLATE_BASE_DIR T2_ROOT CONFIG_DIR TOOLS_DIR SNAPSHOTS PAST_BUILDS BUILD_LOGS # prepare snapshots if any new are available NEW_SNAPSHOTS=0 @@ -77,4 +77,11 @@ for _build in ${_build_order}; do cp ${_target_env_log_dir}/${_build}* ${BUILD_LOGS}/ done -exit +# check for build failure marker +if [[ -e ${T2_ROOT}/BUILD_FAILED ]]; then + + echo "E: Build failed for at least one build job. Please examine." + exit 1 +else + exit 0 +fi