Skip to content

Commit

Permalink
[CI] Update CI to run on Haloween 2024
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pkryger committed Oct 31, 2024
1 parent 4023e91 commit daef68a
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .ci/compilation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions .ci/first-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 14 additions & 5 deletions .ci/unit-test-cl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)))'
11 changes: 10 additions & 1 deletion .ci/unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)))'
23 changes: 14 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,31 @@ 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: 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'

Expand All @@ -51,22 +57,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'
7 changes: 6 additions & 1 deletion modules/init-forge.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ci_tests"))
(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
Expand Down

0 comments on commit daef68a

Please sign in to comment.