-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3553 from mtzguido/github_errs
Errors: Introducing '--message_format github', for github actions
- Loading branch information
Showing
5 changed files
with
84 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "usage: $0 <actual_output> <expected_output>" >&2 | ||
exit 1 | ||
fi | ||
|
||
ACTUAL="$1" | ||
EXPECTED="$2" | ||
|
||
DIFF="diff -u --strip-trailing-cr" | ||
|
||
if $DIFF "$ACTUAL" "$EXPECTED" ; then | ||
# OK | ||
exit 0 | ||
else | ||
# We're gonna fail. If we're running in CI, emit a Github | ||
# error message. | ||
if [ -v GITHUB_ENV ]; then | ||
DIFFTEXT=$($DIFF "$ACTUAL" "$EXPECTED" | sed 's/$/%0A/' | tr -d '\n') | ||
ACTUAL=$(realpath "$ACTUAL") | ||
ACTUAL="${ACTUAL#$FSTAR_ROOT}" | ||
EXPECTED=$(realpath "$EXPECTED") | ||
EXPECTED="${EXPECTED#$FSTAR_ROOT}" | ||
echo "::error::Diff failed for files $ACTUAL and $EXPECTED:%0A%0A$DIFFTEXT" | ||
else | ||
echo "error: Diff failed for files $ACTUAL and $EXPECTED" >&2 | ||
fi | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters