Skip to content

Commit

Permalink
chore(ci): better reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 21, 2023
1 parent 3eec9f1 commit db7606a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,24 @@ jobs:
mkdir ../.minemacs.d/
cp .github/workflows/test-confs/modules-all.el ../.minemacs.d/modules.el
echo "Running Emacs with MinEmacs configuration"
RUN_DATA=$(MINEMACS_VERBOSE=1 MINEMACS_CI=1 HOME=$GITHUB_WORKSPACE/.. emacs -nw --batch --script init.el 2>&1 && "Emacs exited successfully" || echo "Emacs exited with non-zero code $?")
if RUN_DATA=$(MINEMACS_VERBOSE=1 MINEMACS_CI=1 HOME=$GITHUB_WORKSPACE/.. emacs -nw --batch --script init.el 2>&1); then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code $?"
fi
echo "Emacs complete output"
echo "$RUN_DATA"
WARNINGS=$(echo "$RUN_DATA" | grep Warning | sed -E 's/^(.*\.el): Warning/- \*\*\1\*\*/' | sed -E 's/^Warning ([^:]*)/- \*\*\1\*\*/')
LOAD_ERRORS=$(echo "$RUN_DATA" | grep -E "(Cannot load)|(Not found)" | sed 's/^/- /')
ELISP_ERRORS=$(echo "$RUN_DATA" | awk -F': ' '/^Debugger entered--Lisp error: / { print "- **" $1 "**: `" $2 "`"; print "```elisp"; while (getline && match($0, "^[[:space:]]{2}")) print $0; print "```"}' )
echo -e "# MinEmacs report ($EMACS_VERSION)\n## Loading errors\n$LOAD_ERRORS\n## Emacs Lisp errors\n$ELISP_ERRORS\n## Warnings\n$WARNINGS" >> $GITHUB_STEP_SUMMARY
echo -e "# MinEmacs report ($EMACS_VERSION)\n" >> $GITHUB_STEP_SUMMARY
if [[ ! -z "$LOAD_ERRORS" ]]; then
echo -e "## Loading errors\n$LOAD_ERRORS\n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$ELISP_ERRORS" ]]; then
echo -e "## Emacs Lisp errors\n$ELISP_ERRORS\n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$WARNINGS" ]]; then
echo -e "## Warnings\n$WARNINGS" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$LOAD_ERRORS" ]] || [[ ! -z "$ELISP_ERRORS" ]]; then exit 1; fi

0 comments on commit db7606a

Please sign in to comment.