Skip to content

Commit

Permalink
ci: check for lack of byte-compilation warnings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Hi-Angel committed Jan 28, 2024
1 parent 3366a6e commit 7af8a5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- 25.3
- 26.3
- 27.1
- snapshot
- 29.2
steps:
- uses: purcell/setup-emacs@master
with:
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7af8a5a

Please sign in to comment.