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
|
||||
set -e
|
||||
cd $(dirname $0)/..
|
||||
|
||||
PROTOB=common/protob
|
||||
@ -71,6 +72,7 @@ do_rebuild() {
|
||||
do_check() {
|
||||
# rebuild protobuf in tmpdir and check result against specified directory
|
||||
local TMPDIR=$(mktemp -d proto-check.XXXXXX)
|
||||
trap "rm -r $TMPDIR" RETURN
|
||||
|
||||
local FILE_OR_DIR="$1"
|
||||
shift
|
||||
@ -85,10 +87,7 @@ do_check() {
|
||||
fi
|
||||
|
||||
do_rebuild "$FILE_OR_DIR" "$TMPDEST" "$@"
|
||||
DIFF=$(diff -ur --exclude __pycache__ "$OUTPUT" "$TMPDEST")
|
||||
rm -r "$TMPDIR"
|
||||
if [ -n "$DIFF" ]; then
|
||||
echo "$DIFF"
|
||||
if ! diff -ur --exclude __pycache__ "$OUTPUT" "$TMPDEST"; then
|
||||
RETURN=1
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user