mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-02 02:41:28 +00:00
ci: properly fail if protobuf compilation or diff check fails
This commit is contained in:
parent
6c7e4a520d
commit
6644e149b2
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
PROTOB=common/protob
|
PROTOB=common/protob
|
||||||
@ -71,6 +72,7 @@ do_rebuild() {
|
|||||||
do_check() {
|
do_check() {
|
||||||
# rebuild protobuf in tmpdir and check result against specified directory
|
# rebuild protobuf in tmpdir and check result against specified directory
|
||||||
local TMPDIR=$(mktemp -d proto-check.XXXXXX)
|
local TMPDIR=$(mktemp -d proto-check.XXXXXX)
|
||||||
|
trap "rm -r $TMPDIR" RETURN
|
||||||
|
|
||||||
local FILE_OR_DIR="$1"
|
local FILE_OR_DIR="$1"
|
||||||
shift
|
shift
|
||||||
@ -85,10 +87,7 @@ do_check() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
do_rebuild "$FILE_OR_DIR" "$TMPDEST" "$@"
|
do_rebuild "$FILE_OR_DIR" "$TMPDEST" "$@"
|
||||||
DIFF=$(diff -ur --exclude __pycache__ "$OUTPUT" "$TMPDEST")
|
if ! diff -ur --exclude __pycache__ "$OUTPUT" "$TMPDEST"; then
|
||||||
rm -r "$TMPDIR"
|
|
||||||
if [ -n "$DIFF" ]; then
|
|
||||||
echo "$DIFF"
|
|
||||||
RETURN=1
|
RETURN=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user