Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions .github/workflows/melpazoid.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# melpazoid <https://github.com/riscy/melpazoid> build checks.

# If your package is on GitHub, enable melpazoid's checks by copying this file
# to .github/workflows/melpazoid.yml and modifying RECIPE and EXIST_OK below.
#
# Disabled by default. Run manually with workflow_dispatch when you want
# MELPA-style packaging and lint feedback.

name: melpazoid
on: [push, pull_request]

on:
workflow_dispatch:

jobs:
build:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install
run: |
python -m pip install --upgrade pip
sudo apt-get install emacs && emacs --version
git clone https://github.com/riscy/melpazoid.git ~/melpazoid
pip install ~/melpazoid
- name: Run
env:
LOCAL_REPO: ${{ github.workspace }}
# RECIPE is your recipe as written for MELPA:
RECIPE: (ai-code :fetcher github :repo "tninja/ai-code-interface.el")
# set this to false (or remove it) if the package isn't on MELPA:
EXIST_OK: false
run: echo $GITHUB_REF && make -C ~/melpazoid
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install
run: |
python -m pip install --upgrade pip
sudo apt-get install emacs && emacs --version
git clone https://github.com/riscy/melpazoid.git ~/melpazoid
pip install ~/melpazoid
- name: Run
env:
LOCAL_REPO: ${{ github.workspace }}
RECIPE: (ai-code :fetcher github :repo "tninja/ai-code-interface.el")
EXIST_OK: false
run: echo $GITHUB_REF && make -C ~/melpazoid
42 changes: 42 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: unit-tests

on:
push:
pull_request:

jobs:
ert:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Emacs
run: |
sudo apt-get update
sudo apt-get install -y emacs
emacs --version

- name: Install Elisp dependencies
run: |
emacs -Q --batch --eval "
(progn
(require 'package)
(setq package-archives
'((\"gnu\" . \"https://elpa.gnu.org/packages/\")
(\"nongnu\" . \"https://elpa.nongnu.org/nongnu/\")
(\"melpa\" . \"https://melpa.org/packages/\")))
(package-initialize)
(package-refresh-contents)
(dolist (pkg '(compat transient magit))
(unless (package-installed-p pkg)
(package-install pkg))))"

- name: Run unit tests
run: |
emacs -Q -batch -L . \
--eval "(progn (require 'package) (package-initialize))" \
-l test/test_00-bootstrap.el \
-l ert \
--eval "(mapc #'load-file (file-expand-wildcards \"test/test_*.el\"))" \
-f ert-run-tests-batch-and-exit
2 changes: 2 additions & 0 deletions HISTORY.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Release history

** Main branch change
- Fix: Add SPDX header and commentary tests for autoloads
- Also added unit-test CI workflow
- Feat: Add more emacs mcps: buffer and project query tools and xref support
- Referencing https://github.com/acmorrow/claude-code-ide-extras, port 4 mcps from there.

Expand Down
6 changes: 4 additions & 2 deletions ai-code-autoloads.el
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
;;; ai-code-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
;;; ai-code-autoloads.el --- Generated autoloads for AI Code -*- lexical-binding: t; -*-
;; SPDX-License-Identifier: Apache-2.0
;; Generated by the `loaddefs-generate' function.

;; This file is part of GNU Emacs.
;;; Commentary:
;; Generated autoload definitions for the AI Code package.

;;; Code:

Expand Down
30 changes: 30 additions & 0 deletions test/test_ai-code-package-hygiene.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
;;; test_ai-code-package-hygiene.el --- Package metadata hygiene tests -*- lexical-binding: t; -*-

;; SPDX-License-Identifier: Apache-2.0

;;; Commentary:
;; Regression tests for package metadata that CI packaging checks rely on.

;;; Code:

(require 'ert)

(defun ai-code-test--file-prefix (path length)
"Return the first LENGTH characters from PATH."
(with-temp-buffer
(insert-file-contents path nil 0 length)
(buffer-string)))

(ert-deftest ai-code-test-autoloads-file-has-spdx-header ()
"Autoloads file should advertise the package license with SPDX."
(let ((header (ai-code-test--file-prefix "ai-code-autoloads.el" 400)))
(should (string-match-p "SPDX-License-Identifier: Apache-2\\.0" header))))

(ert-deftest ai-code-test-autoloads-file-has-commentary-section ()
"Autoloads file should include a Commentary section for package checks."
(let ((header (ai-code-test--file-prefix "ai-code-autoloads.el" 400)))
(should (string-match-p "^;;; Commentary:" header))))

(provide 'test_ai-code-package-hygiene)

;;; test_ai-code-package-hygiene.el ends here
Loading