From 3207fd2515246d7bfad098f8d17e9a8efc1c4cb9 Mon Sep 17 00:00:00 2001 From: Abdelhak Bougouffa Date: Mon, 30 Oct 2023 20:19:21 +0100 Subject: [PATCH] chore(ci): add a step to test MinEmacs in always demand mode --- .github/workflows/ci-linux.yaml | 25 +++++++++++++++++++++++++ .github/workflows/ci-macos.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/ci-windows.yaml | 6 ++++++ 3 files changed, 57 insertions(+) diff --git a/.github/workflows/ci-linux.yaml b/.github/workflows/ci-linux.yaml index 04be5222..287f0568 100644 --- a/.github/workflows/ci-linux.yaml +++ b/.github/workflows/ci-linux.yaml @@ -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 diff --git a/.github/workflows/ci-macos.yaml b/.github/workflows/ci-macos.yaml index ccedc1e5..33812ea8 100644 --- a/.github/workflows/ci-macos.yaml +++ b/.github/workflows/ci-macos.yaml @@ -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 + diff --git a/.github/workflows/ci-windows.yaml b/.github/workflows/ci-windows.yaml index c14ef03e..42c54169 100644 --- a/.github/workflows/ci-windows.yaml +++ b/.github/workflows/ci-windows.yaml @@ -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