Skip to content

Commit

Permalink
Don't fail on the first error during building. (#5)
Browse files Browse the repository at this point in the history
Instead keep track of which variants failed and report them at the end.
The Action will still fail, but all data that made it is uploaded.
  • Loading branch information
floitsch authored Aug 9, 2023
1 parent 640b3aa commit d7d37de
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,19 @@ jobs:
run: |
ccache -s
for variant in $VARIANTS; do
(cd synthesized/$variant && make)
mkdir -p build/$variant
(cd synthesized/$variant && make) || touch build/$variant/failed
done
ccache -s
- name: Prepare envelopes for upload
run: |
mkdir envelopes
for variant in $VARIANTS; do
if [ -e build/$variant/failed ]; then
echo "Skipping $variant"
continue
fi
cp build/$variant/firmware.envelope envelopes/firmware-$variant.envelope
gzip -9 envelopes/firmware-$variant.envelope
done
Expand All @@ -183,3 +188,17 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.toit-version }}
commit: main

- name: Report failed builds
if: ${{ github.event.inputs.upload-release }}
run: |
build_failed=false
for variant in $VARIANTS; do
if [ -e build/$variant/failed ]; then
echo "Build of $variant failed"
build_failed=true
fi
done
if [ "$build_failed" = true ]; then
exit 1
fi

0 comments on commit d7d37de

Please sign in to comment.