Skip to content

Commit

Permalink
ci-wrapper: grep for errors at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Dec 11, 2023
1 parent 19e3e29 commit eac0b75
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dev/ci/ci-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,21 @@ export TIMED=1
bash "${DIR}/${CI_SCRIPT}" 2>&1 | tee "$CI_NAME.log"
code=$?
echo 'Aggregating timing log...'
echo
python ./tools/make-one-time-file.py --real "$CI_NAME.log"
if true || ! [ $code = 0 ]; then
echo
echo "Error list (may be incomplete):"

# -P: perl-like
# -z: multiline using \0 chars (which is why we have to tr to cleanup the output)
# -o: print only matched (otherwise it prints the whole file due to -z)
# Pattern:
# - File ".*
# - maybe some lines starting with a number and a line containing only spaces and ^ (ocaml errors)
# - the error line (common between ocaml and coq)
# we only get the first line of the error message (too hard to figure out where it ends)
# || true: if the error isn't matched by this pattern, we still want to use the error code from the build
grep -Pzo 'File ".*\n([0-9].*\n)*([ ^]*\n)?Error.*\n' "$CI_NAME.log" | tr -d '\0' || true
fi
exit $code

0 comments on commit eac0b75

Please sign in to comment.