Files
Amr Gharbeia b6858707bc
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
ci: exclude test/ from .org source check
test/ directory contains standalone helper scripts that don't
have corresponding .org sources (run-tests.lisp, test_native_embedding).
2026-05-08 10:01:30 -04:00

75 lines
2.3 KiB
YAML

name: Lint
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
git emacs-nox
- name: Check for forbidden patterns
run: |
! grep -r "json\." --include="*.lisp" lisp/ && \
echo "OK: No JSON in Lisp files"
- name: Check org files have lisp source blocks
run: |
FAIL=0
for f in org/*.org; do
if ! grep -q "#+begin_src lisp" "$f"; then
echo "WARNING: $f has no lisp blocks"
FAIL=1
fi
done
echo "OK: Org files checked for lisp blocks"
- name: Verify each .lisp has a corresponding .org source
run: |
FAIL=0
for f in lisp/*.lisp; do
[ -f "$f" ] || continue
base=$(basename "$f" .lisp)
if [ -f "org/${base}.org" ]; then
: # direct match
else
# Check if generated from a parent org via :tangle header
if grep -q ":tangle.*$(basename "$f")" org/*.org 2>/dev/null; then
: # :tangle reference found
else
echo "WARNING: $f has no corresponding .org source"
FAIL=1
fi
fi
done
[ "$FAIL" = 0 ] && echo "OK: All .lisp files have .org sources"
- name: Check literate granularity (one function per block)
run: |
for f in org/*.org; do
blocks=$(grep -c "^[[:space:]]*(defun " "$f" 2>/dev/null || true)
srcblocks=$(grep -c "#+begin_src lisp" "$f" 2>/dev/null || true)
if [ "$blocks" -gt "$srcblocks" ] && [ "$srcblocks" -gt 0 ]; then
echo "WARNING: $f has $blocks defuns but only $srcblocks src blocks"
fi
done
echo "OK: Granularity check complete"
- name: Check README has quick install
run: |
grep -q "curl.*passepartout" README.org && \
echo "OK: Quick install in README" || \
echo "WARNING: Quick install curl command not found in README"