Skip to content

Commit

Permalink
chore(ci): add a step to test MinEmacs in always demand mode
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 30, 2023
1 parent c64b138 commit 3207fd2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,29 @@ 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 always demand mode
run: |
echo "Loading Emacs with MINEMACS_ALWAYS_DEMAND"
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
MINEMACS_ALWAYS_DEMAND=1
make ci | 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 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
26 changes: 26 additions & 0 deletions .github/workflows/ci-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,29 @@ 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 always demand mode
run: |
echo "Loading Emacs with MINEMACS_ALWAYS_DEMAND"
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
MINEMACS_ALWAYS_DEMAND=1
make ci | 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 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 @@ -24,3 +24,9 @@ jobs:
$env:HOME = "D:\a\minemacs\"
$env:MINEMACSDIR = "D:\a\minemacs\.github\workflows\scripts\minemacs-all.d\"
emacs --no-window-system --batch --script .github\workflows\scripts\ci-init.el
- name: Running MinEmacs in always demand mode
run: |
echo "Loading Emacs with MINEMACS_ALWAYS_DEMAND"
$env:HOME = "D:\a\minemacs\"
$env:MINEMACS_ALWAYS_DEMAND = "1"
emacs --no-window-system --batch --script .github\workflows\scripts\ci-init.el

0 comments on commit 3207fd2

Please sign in to comment.