Skip to content

Commit

Permalink
[fu] compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Nov 12, 2024
1 parent ed1919d commit bbcfe76
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
19 changes: 11 additions & 8 deletions .ci/compilation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,52 @@
set -x
set -e

EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)/"
EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)"
EMACS=${EMACS:=emacs}

exit_code=0

cleanup () {
exit_code=$?
ls -hlrt "${EMACS_DIR}"{init.elc,{modules,themes}/*.elc}
rm -vf "${EMACS_DIR}"{init.elc,{modules,themes}/*.elc}
ls -hlrt "${EMACS_DIR}"/{init.elc,{modules,themes}/*.elc}
rm -vf "${EMACS_DIR}"/{init.elc,{modules,themes}/*.elc}
exit $exit_code
}

trap cleanup ERR INT TERM

# Byte compile all `.el` files in modules, themes, and extensions
# Byte compile all `.el` files in modules and themes.
# extensions are skipped because this is not Exordium code.
# themes are compiled separately because CI core dumps when compiled together with modules

${EMACS} -Q --batch \
--eval '
(progn
(setq debug-on-error t
eval-expression-print-length 100
edebug-print-length 500
user-emacs-directory "'"${EMACS_DIR}"'"
user-emacs-directory "'"${EMACS_DIR}"'/"
exordium-spell-check nil
tree-sitter-langs--testing t) ; tree-sitter-langs is for pre Emacs-29
(load-file "'"${EMACS_DIR}"'/init.el")
(setq exordium--require-package-archives package-archives)
(message "===Byte compilation start===")
(batch-byte-compile))' \
"${EMACS_DIR}"{init.el,modules/*.el}
"${EMACS_DIR}"/{init.el,modules/*.el}

${EMACS} -Q --batch \
--eval '
(progn
(setq debug-on-error t
eval-expression-print-length 100
edebug-print-length 500
user-emacs-directory "'"${EMACS_DIR}"'"
user-emacs-directory "'"${EMACS_DIR}"'/"
exordium-spell-check nil
tree-sitter-langs--testing t) ; tree-sitter-langs is for pre Emacs-29
(load-file "'"${EMACS_DIR}"'/init.el")
(setq exordium--require-package-archives package-archives)
(message "===Byte compilation start===")
(batch-byte-compile))' \
"${EMACS_DIR}"themes/*.el
"${EMACS_DIR}"/themes/*.el

cleanup
4 changes: 2 additions & 2 deletions .ci/first-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -x
set -e

EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)/"
EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)"
EMACS=${EMACS:=emacs}

# Redefine ask-user-about-lock as the melpa seems to stumble on it
Expand All @@ -15,7 +15,7 @@ ${EMACS} -Q --batch \
(setq debug-on-error t
eval-expression-print-length 100
edebug-print-length 500
user-emacs-directory "'"${EMACS_DIR}"'"
user-emacs-directory "'"${EMACS_DIR}"'/"
exordium-spell-check nil)
(defun ask-user-about-lock (file opponent)
(sleep-for 5)
Expand Down
4 changes: 2 additions & 2 deletions .ci/unit-test-cl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -x
set -e
EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)/"
EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)"
EMACS=${EMACS:=emacs}

${EMACS} -Q --batch \
--eval '
(progn
(setq user-emacs-directory "'"${EMACS_DIR}"'"
(setq user-emacs-directory "'"${EMACS_DIR}"'/"
exordium-spell-check nil)
(load-file "'"${EMACS_DIR}"'/init.el")
(setq debug-on-error t)
Expand Down
4 changes: 2 additions & 2 deletions .ci/unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
set -x
set -e

EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)/"
EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)"
EMACS=${EMACS:=emacs}

# Run all tests form *.t.el
${EMACS} -Q --batch \
--eval '
(progn
(setq user-emacs-directory "'"${EMACS_DIR}"'"
(setq user-emacs-directory "'"${EMACS_DIR}"'/"
exordium-spell-check nil)
(load-file "'"${EMACS_DIR}"'/init.el")
(load-file "'"${EMACS_DIR}"'/modules/init-bde-style.t.el")
Expand Down

0 comments on commit bbcfe76

Please sign in to comment.