Skip to content

Commit

Permalink
workflow: Fix build failure reported as success
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Iwanicki <[email protected]>
  • Loading branch information
m-iwanicki committed Nov 22, 2024
1 parent 379f816 commit 2e57a81
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
build:
runs-on:
labels: dts-builder
env:
FAILED_ATTEMPTS: 0
steps:
- name: Checkout meta-dts repo
uses: actions/checkout@v4
Expand All @@ -31,17 +33,15 @@ jobs:
break
else
echo "Build command failed on attempt $attempt"
echo "FAILED_ATTEMPTS=$attempt" >> $GITHUB_ENV
if [ $attempt -lt 5 ]; then
sleep 5
else
exit 1
fi
fi
done
continue-on-error: true
- name: Report build command
if: always()
run: |
if [ ${{ steps.build_image.outcome }} == 'failure' ]; then
echo "All build attempts failed."
exit 1
else
echo "At least one build attempt succeeded."
fi
echo "$FAILED_ATTEMPTS build attempts failed"
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
cacheless: false
deploy-images:
name: Deploy DTS artifacts on boot.dasharo.com and GitHub Release
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
needs: build
runs-on:
labels: dts-builder
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
cacheless: false
deploy-images:
name: Deploy DTS artifacts on boot.dasharo.com
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
needs: build
runs-on:
labels: dts-builder
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
cacheless: true
deploy-cache:
name: Deploy cache on cache.dasharo.com
if: always()
needs: build
runs-on:
labels: dts-builder
Expand Down

0 comments on commit 2e57a81

Please sign in to comment.