Skip to content

Commit ede8f76

Browse files
committed
Replace manual lint CI with melpazoid
Add melpazoid GitHub Actions workflow for byte-compile, checkdoc, package-lint and license checks. Remove the duplicate manual lint job from ci.yml. Simplify Makefile to delegate linting to melpazoid (auto-cloned to $XDG_CACHE_HOME/melpazoid).
1 parent 835d878 commit ede8f76

3 files changed

Lines changed: 38 additions & 66 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,6 @@ on:
66
pull_request:
77

88
jobs:
9-
lint:
10-
runs-on: ubuntu-latest
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
emacs_version:
15-
- '27.2'
16-
- '29.4'
17-
- 'snapshot'
18-
steps:
19-
- uses: actions/checkout@v4
20-
- uses: purcell/setup-emacs@master
21-
with:
22-
version: ${{ matrix.emacs_version }}
23-
24-
- name: Byte-compile
25-
run: |
26-
emacs --batch -Q -L . \
27-
-f batch-byte-compile \
28-
ghostel.el ghostel-debug.el
29-
30-
- name: Checkdoc
31-
run: |
32-
output=$(emacs --batch -Q -L . \
33-
--eval "(require 'checkdoc)" \
34-
--eval "(checkdoc-file \"ghostel.el\")" 2>&1)
35-
echo "$output"
36-
if echo "$output" | grep -q "Warning"; then
37-
exit 1
38-
fi
39-
40-
- name: Package-lint
41-
run: |
42-
emacs --batch -Q \
43-
--eval "(progn
44-
(require 'package)
45-
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives)
46-
(package-initialize)
47-
(package-refresh-contents)
48-
(package-install 'package-lint))" \
49-
-L . \
50-
-f package-lint-batch-and-exit \
51-
ghostel.el
52-
539
test:
5410
runs-on: ubuntu-latest
5511
strategy:

.github/workflows/melpazoid.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# melpazoid <https://github.com/riscy/melpazoid> build checks.
2+
3+
name: melpazoid
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with: { python-version: '3.10' }
15+
- name: Install
16+
run: |
17+
sudo apt-get install emacs && emacs --version
18+
git clone https://github.com/riscy/melpazoid.git ~/melpazoid
19+
- name: Run
20+
env:
21+
LOCAL_REPO: ${{ github.workspace }}
22+
RECIPE: (ghostel :fetcher github :repo "dakra/ghostel")
23+
EXIST_OK: false
24+
run: make -C ~/melpazoid

Makefile

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
EMACS ?= emacs
22

3-
.PHONY: all build check test lint byte-compile checkdoc package-lint clean
3+
XDG_CACHE_HOME ?= $(HOME)/.cache
4+
MELPAZOID_DIR ?= $(XDG_CACHE_HOME)/melpazoid
45

5-
all: build byte-compile test lint
6+
.PHONY: all build check test lint melpazoid byte-compile clean
7+
8+
all: build test lint
69

710
build:
811
./build.sh
@@ -13,30 +16,19 @@ check:
1316
test:
1417
$(EMACS) --batch -Q -L . -l test/ghostel-test.el -f ghostel-test-run-elisp
1518

16-
lint: byte-compile checkdoc package-lint
19+
lint: melpazoid
20+
21+
melpazoid:
22+
@if [ ! -d "$(MELPAZOID_DIR)" ]; then \
23+
git clone https://github.com/riscy/melpazoid.git "$(MELPAZOID_DIR)"; \
24+
fi
25+
RECIPE='(ghostel :fetcher github :repo "dakra/ghostel")' \
26+
LOCAL_REPO=$(CURDIR) \
27+
make -C "$(MELPAZOID_DIR)"
1728

1829
byte-compile:
1930
$(EMACS) --batch -Q -L . -f batch-byte-compile ghostel.el ghostel-debug.el
2031

21-
checkdoc:
22-
@output=$$($(EMACS) --batch -Q -L . \
23-
--eval "(require 'checkdoc)" \
24-
--eval "(checkdoc-file \"ghostel.el\")" 2>&1); \
25-
echo "$$output"; \
26-
if echo "$$output" | grep -q "Warning"; then exit 1; fi
27-
28-
package-lint:
29-
$(EMACS) --batch -Q \
30-
--eval "(progn \
31-
(require 'package) \
32-
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \
33-
(package-initialize) \
34-
(package-refresh-contents) \
35-
(package-install 'package-lint))" \
36-
-L . \
37-
-f package-lint-batch-and-exit \
38-
ghostel.el
39-
4032
clean:
4133
rm -f ghostel-module.dylib ghostel-module.so
4234
rm -f ghostel.elc ghostel-debug.elc

0 commit comments

Comments
 (0)