Skip to content

Commit

Permalink
chore(ci): test MinEmacs in daemon mode
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 10, 2023
1 parent 890f6bb commit 4efaf20
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,27 @@ jobs:
echo -e "## Warnings\n$WARNINGS" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$LOAD_ERRORS" ]] || [[ ! -z "$ELISP_ERRORS" ]] || [[ "$EMACS_EXIT_CODE" != 0 ]]; then exit 1; fi
- name: Running MinEmacs in daemon mode
run: |
echo "Loading Emacs in daemon mode"
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
make ci-daemon | tee /tmp/minemacs-output
EMACS_EXIT_CODE=$?
if [[ "$EMACS_EXIT_CODE" == 0 ]]; then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code ${EMACS_EXIT_CODE}"
fi
WARNINGS=$(cat /tmp/minemacs-output | grep Warning | sed -E 's/^(.*\.el): Warning/- \*\*\1\*\*/' | sed -E 's/^Warning ([^:]*)/- \*\*\1\*\*/')
LOAD_ERRORS=$(cat /tmp/minemacs-output | grep -E "(Cannot (open )?load)|(Not found)" | sed 's/^/- /')
ELISP_ERRORS=$(cat /tmp/minemacs-output | awk -F': ' '/^Debugger entered--Lisp error: / { print "- **" $1 "**: `" $2 "`"; print "```elisp"; while (getline && match($0, "^[[:space:]]{2}")) print $0; print "```"}' )
echo -e "# MinEmacs - always demand mode 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
25 changes: 24 additions & 1 deletion .github/workflows/ci-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,27 @@ jobs:
echo -e "## Warnings\n$WARNINGS" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$LOAD_ERRORS" ]] || [[ ! -z "$ELISP_ERRORS" ]] || [[ "$EMACS_EXIT_CODE" != 0 ]]; then exit 1; fi
- name: Running MinEmacs in daemon mode
run: |
echo "Loading Emacs in daemon mode"
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
make ci-daemon | tee /tmp/minemacs-output
EMACS_EXIT_CODE=$?
if [[ "$EMACS_EXIT_CODE" == 0 ]]; then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code ${EMACS_EXIT_CODE}"
fi
WARNINGS=$(cat /tmp/minemacs-output | grep Warning | sed -E 's/^(.*\.el): Warning/- \*\*\1\*\*/' | sed -E 's/^Warning ([^:]*)/- \*\*\1\*\*/')
LOAD_ERRORS=$(cat /tmp/minemacs-output | grep -E "(Cannot (open )?load)|(Not found)" | sed 's/^/- /')
ELISP_ERRORS=$(cat /tmp/minemacs-output | awk -F': ' '/^Debugger entered--Lisp error: / { print "- **" $1 "**: `" $2 "`"; print "```elisp"; while (getline && match($0, "^[[:space:]]{2}")) print $0; print "```"}' )
echo -e "# MinEmacs - always demand mode 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
6 changes: 6 additions & 0 deletions .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
$env:HOME = "D:\a\minemacs\"
$env:MINEMACS_ALWAYS_DEMAND = "1"
emacs --no-window-system --batch --script .github\workflows\scripts\ci-init.el
- name: Running MinEmacs in daemon mode
run: |
echo "Loading Emacs in daemon mode"
$env:MINEMACSDIR = "D:\a\minemacs\.github\workflows\scripts\minemacs-all.d\"
emacs --daemon --script .github\workflows\scripts\ci-init.el
echo "Finished"
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ cloc:

ci:
HOME=$(PWD)/.. $(EMACS) -nw --batch --script .github/workflows/scripts/ci-init.el 2>&1

ci-daemon:
HOME=$(PWD)/.. $(EMACS) --daemon --script .github/workflows/scripts/ci-init.el 2>&1

0 comments on commit 4efaf20

Please sign in to comment.