From 7af8a5abe95d23f4f1435df0e6f13f3a7cf344f8 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sun, 28 Jan 2024 03:25:15 +0300 Subject: [PATCH] ci: check for lack of byte-compilation warnings As part of that we test with latest released Emacs version rather than snapshot, because we don't want CI to start suddenly failing on unrelated changes because upstream introduced a new warning/check. --- .github/workflows/test.yml | 6 +++++- Makefile | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e911e9a8..0a5a0066 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - 25.3 - 26.3 - 27.1 - - snapshot + - 29.2 steps: - uses: purcell/setup-emacs@master with: @@ -24,6 +24,10 @@ jobs: run: | emacs --version + - name: Test lack of byte-compile warnings + run: | + make compile-check + - name: Run tests run: | make test diff --git a/Makefile b/Makefile index 2144a921..4b58fbbd 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,14 @@ DOC = doc TAG = ELCFILES = $(FILES:.el=.elc) +ELCFILES_CHECK = $(FILES:.el=.elc) -.PHONY: all compile compile-batch docstrings doc clean tests test emacs term terminal profiler indent elpa version +.PHONY: all compile compile-check compile-batch docstrings doc clean tests test emacs term terminal profiler indent elpa version # Byte-compile Evil. all: compile compile: $(ELCFILES) +compile-check: $(ELCFILES_CHECK) .depend: $(FILES) @echo Compute dependencies @@ -28,6 +30,9 @@ compile: $(ELCFILES) $(ELCFILES): %.elc: %.el $(EMACS) --batch -Q -L . -f batch-byte-compile $< +$(ELCFILES_CHECK): %.elc: %.el + $(EMACS) --batch -Q -L . --eval "(setq byte-compile-error-on-warn t)" -f batch-byte-compile $< + # Byte-compile all files in one batch. This is faster than # compiling each file in isolation, but also less stringent. compile-batch: clean @@ -60,7 +65,7 @@ test: --eval "(evil-tests-initialize '(${TAG}) '(${PROFILER}))" # Byte-compile Evil and run all tests. -tests: compile +tests: compile-check $(EMACS) -nw -Q -L . -l evil-tests.el \ --eval "(evil-tests-initialize '(${TAG}) '(${PROFILER}))" rm -f *.elc .depend