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 6344e96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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
7 changes: 6 additions & 1 deletion 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

0 comments on commit 6344e96

Please sign in to comment.