diff --git a/.ci/compilation.sh b/.ci/compilation.sh index 295108bc..1ae616a6 100755 --- a/.ci/compilation.sh +++ b/.ci/compilation.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -x set -e -EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)" +EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-${HOME}}/${1:-.emacs.d}" && pwd -P)" EMACS=${EMACS:=emacs} exit_code=0 @@ -16,42 +16,20 @@ cleanup () { trap cleanup ERR INT TERM -# 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 +# Byte compile init.el and all *.el files in modules and themes directories. +# Directory extensions is skipped because this is not Exordium code. Split +# them into smaller chunks, because Emacs on GitHub worker tends to core dump +# when there's too much to compile in one go. +for pattern in "init.el" "modules/*.el" ; do + echo "===Byte compiling ${pattern}===" -${EMACS} -Q --batch \ - --eval ' -(progn - (setq debug-on-error t - eval-expression-print-length 100 - edebug-print-length 500 - 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 - -${EMACS} -Q --batch \ - --eval ' -(progn - (setq debug-on-error t - eval-expression-print-length 100 - edebug-print-length 500 - 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}"/modules/*.el + # Use find to find file names such that globs are expanded while prevent + # splitting paths on spaces + mapfile -t files <<< \ + "$(find "${EMACS_DIR}" -path "${EMACS_DIR}/${pattern}")" -${EMACS} -Q --batch \ - --eval ' + ${EMACS} -Q --batch \ + --eval ' (progn (setq debug-on-error t eval-expression-print-length 100 @@ -63,6 +41,7 @@ ${EMACS} -Q --batch \ (setq exordium--require-package-archives package-archives) (message "===Byte compilation start===") (batch-byte-compile))' \ - "${EMACS_DIR}"/themes/*.el + "${files[@]}" +done cleanup diff --git a/.ci/first-start.sh b/.ci/first-start.sh index 7555c446..e8214073 100755 --- a/.ci/first-start.sh +++ b/.ci/first-start.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -x set -e -EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)" +EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-${HOME}}/${1:-.emacs.d}" && pwd -P)" EMACS=${EMACS:=emacs} # Redefine ask-user-about-lock as the melpa seems to stumble on it diff --git a/.ci/unit-test-cl.sh b/.ci/unit-test-cl.sh index 910e14f8..e3cfb5ed 100755 --- a/.ci/unit-test-cl.sh +++ b/.ci/unit-test-cl.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash set -x set -e -EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)" +EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-${HOME}}/${1:-.emacs.d}" && pwd -P)" EMACS=${EMACS:=emacs} ${EMACS} -Q --batch \ diff --git a/.ci/unit-tests.sh b/.ci/unit-tests.sh index 1215402e..6c81fc57 100755 --- a/.ci/unit-tests.sh +++ b/.ci/unit-tests.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -x set -e -EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-~}"/"${1:-.emacs.d}"; pwd -P)" +EMACS_DIR="$(cd "${GITHUB_WORKSPACE:-${HOME}}/${1:-.emacs.d}" && pwd -P)" EMACS=${EMACS:=emacs} # Run all tests form *.t.el