From 320c485f879f6a9bd23897e6090bdb72d94e676c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Kryger?= Date: Wed, 30 Oct 2024 15:42:31 +0000 Subject: [PATCH] [CI] Update CI to run on Haloween 2024 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The maintenance was focused on making it passing. The following things were updated/improved: - Remove Emacs-27: no longer supported by purcell/setup-emacs GitHub action ¯\_(ツ)_/¯. - Install nix sqlite3^dev for emacs-28. The `sqlite3` package is still having issues loading, but suppressing error there when running in CI. - Bump checkout action to v4. - Lengthten printed messages in CI, the more logs the better - Updated build matrix. --- .ci/compilation.sh | 2 ++ .ci/first-start.sh | 2 ++ .ci/unit-test-cl.sh | 19 ++++++++++++++----- .ci/unit-tests.sh | 11 ++++++++++- .github/workflows/tests.yml | 27 ++++++++++++++++++--------- modules/init-forge.el | 7 ++++++- 6 files changed, 52 insertions(+), 16 deletions(-) diff --git a/.ci/compilation.sh b/.ci/compilation.sh index 5621d2d2..8276260f 100755 --- a/.ci/compilation.sh +++ b/.ci/compilation.sh @@ -11,6 +11,8 @@ ${EMACS} -Q --batch \ --eval ' (progn (setq debug-on-error t + eval-expression-print-length 100 + edebug-print-length 500 user-emacs-directory "'"${EMACS_DIR}"'") (load-file "'"${EMACS_DIR}"'/init.el"))' \ -f batch-byte-compile "${EMACS_DIR}"/{modules,extensions}/*.el diff --git a/.ci/first-start.sh b/.ci/first-start.sh index b3d2f3c8..9899e77c 100755 --- a/.ci/first-start.sh +++ b/.ci/first-start.sh @@ -13,6 +13,8 @@ ${EMACS} -Q --batch \ --eval ' (progn (setq debug-on-error t + eval-expression-print-length 100 + edebug-print-length 500 user-emacs-directory "'"${EMACS_DIR}"'") (defun ask-user-about-lock (file opponent) (sleep-for 5) diff --git a/.ci/unit-test-cl.sh b/.ci/unit-test-cl.sh index e1a3136b..b2684584 100755 --- a/.ci/unit-test-cl.sh +++ b/.ci/unit-test-cl.sh @@ -8,8 +8,17 @@ EMACS=${EMACS:=emacs} ${EMACS} -Q --batch \ --eval ' (progn - (setq user-emacs-directory "'"${EMACS_DIR}"'") - (load-file "'"${EMACS_DIR}"'/init.el") - (setq debug-on-error t) - (load-file "'"${EMACS_DIR}"'/modules/init-util-cl.t.el") - (ert-run-tests-batch-and-exit))' + (setq user-emacs-directory "'"${EMACS_DIR}"'") + (load-file "'"${EMACS_DIR}"'/init.el") + (setq debug-on-error t) + (load-file "'"${EMACS_DIR}"'/modules/init-util-cl.t.el") + (let ((print-level 50) + (eval-expression-print-level 50) + (eval-expression-print-length 1000) + (edebug-print-level 50) + (edebug-print-length 1000) + (ert-batch-print-level 50) + (ert-batch-print-length 1000) + (ert-batch-backtrace-line-length 1000) + (ert-batch-backtrace-right-margin 1000)) + (ert-run-tests-batch-and-exit)))' diff --git a/.ci/unit-tests.sh b/.ci/unit-tests.sh index dacd1cc5..e48f1fc4 100755 --- a/.ci/unit-tests.sh +++ b/.ci/unit-tests.sh @@ -16,4 +16,13 @@ ${EMACS} -Q --batch \ (load-file "'"${EMACS_DIR}"'/modules/init-forge.t.el") (load-file "'"${EMACS_DIR}"'/modules/init-util.t.el") (load-file "'"${EMACS_DIR}"'/modules/init-lib.t.el") - (ert-run-tests-batch-and-exit))' + (let ((print-level 50) + (eval-expression-print-level 50) + (eval-expression-print-length 1000) + (edebug-print-level 50) + (edebug-print-length 1000) + (ert-batch-print-level 50) + (ert-batch-print-length 1000) + (ert-batch-backtrace-line-length 1000) + (ert-batch-backtrace-right-margin 1000)) + (ert-run-tests-batch-and-exit)))' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2da100d2..b65a8e4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,25 +22,35 @@ jobs: - ubuntu-latest - macos-latest emacs_version: - - 27.1 - - 27.2 - 28.1 - 28.2 - 29.1 + - 29.2 + - 29.3 + - 29.4 - snapshot steps: - uses: purcell/setup-emacs@master with: version: ${{ matrix.emacs_version }} - - uses: actions/checkout@v3 + + - uses: actions/checkout@v4 with: path: '.emacs.d' + + - name: Install sqlite^dev + if: ${{ matrix.emacs_version != 'snapshot' && matrix.emacs_version < 29 }} + run: nix profile install nixpkgs#sqlite^dev + - name: First start # So most modules are pulled in from melpa and gnu run: '.emacs.d/.ci/first-start.sh .emacs.d' + # - name: Compilation # This pulls extra modules not enabled by default # run: '.emacs.d/.ci/compilation.sh .emacs.d' + - name: Unit tests run: '.emacs.d/.ci/unit-tests.sh .emacs.d' + - name: Verify no obsolete cl- functions run: '.emacs.d/.ci/unit-test-cl.sh .emacs.d' @@ -51,22 +61,21 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - emacs_version: 27.2 - - os: macos-latest - emacs_version: 29.1 - os: macos-latest emacs_version: snapshot steps: - uses: purcell/setup-emacs@master with: version: ${{ matrix.emacs_version }} - - uses: actions/checkout@v3 + + - uses: actions/checkout@v4 with: path: '.emacs.d' - - uses: actions/checkout@v3 + + - uses: actions/checkout@v4 with: repository: 'pkryger/exordium-commontap' path: '.emacs.d/taps/commontap' + - name: First start # So most modules are pulled in from melpa and gnu run: '.emacs.d/.ci/first-start.sh .emacs.d' diff --git a/modules/init-forge.el b/modules/init-forge.el index 1b04f0f3..5862faed 100644 --- a/modules/init-forge.el +++ b/modules/init-forge.el @@ -14,7 +14,12 @@ ;; https://github.com/magit/emacsql/commit/6401226 for more details. (unless (and (fboundp 'sqlite-available-p) (sqlite-available-p)) - (use-package sqlite3)) + (let ((debug-on-error (if (and debug-on-error (getenv "GITHUB_ACTIONS")) + (progn + (message "Temporarily disable `debug-on-error': `sqlite3-api' cannot be loaded when running in CI") + nil) + debug-on-error))) + (use-package sqlite3))) ;;; Magit Forge (use-package forge