diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 05:27:12 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 05:27:12 -0500 |
| commit | 69d8b29f839d8fee957e644013000f90c1283be4 (patch) | |
| tree | 1e003871ed3fa3a11e15e3e0b643cbf0f16d7a13 /Makefile | |
| parent | 1487cbc03d1c447e9c4b31bfbe44330df10a6d29 (diff) | |
| download | chime-69d8b29f839d8fee957e644013000f90c1283be4.tar.gz chime-69d8b29f839d8fee957e644013000f90c1283be4.zip | |
ci: add GitHub Actions workflow with test matrix, lint, and coverage
I added `.github/workflows/ci.yml` with three jobs:
1. test — Emacs 27.1 / 28.2 / 29.4 / 30.1, runs `make compile` (strict
warnings) and `make test-all`. fail-fast off so one version's failure
doesn't hide others.
2. lint (advisory) — `eask lint package`, `eask lint checkdoc`, and `make
lint` (elisp-lint). All three are `continue-on-error: true` because there's
an existing MELPA-prep backlog (1 package-lint error in chime-org-contacts.el,
~17 cosmetic checkdoc/package-lint warnings) that's worth surfacing without
blocking CI. Tighten to required once the backlog is cleared.
3. coverage — runs the full suite with undercover and uploads to Coveralls
via the official action. No secret needed because the repo is public —
GITHUB_TOKEN is enough.
Two supporting changes:
- `tests/run-coverage-file.el` now switches between simplecov (local) and
coveralls (CI, detected via the `CI` env var GitHub Actions sets
automatically) report formats. The Coveralls action expects coveralls JSON.
- `Makefile`'s `coverage' target now runs ALL_TESTS with selector `t', not
UNIT_TESTS with `(not (tag :slow))'. Without this the integration tests
contributed nothing to the reported coverage number.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -17,9 +17,11 @@ SOURCE_FILE = chime.el COVERAGE_DIR = .coverage COVERAGE_FILE = $(COVERAGE_DIR)/simplecov.json -# Unit-test files (used by coverage loop, mirroring tests/Makefile) -UNIT_TESTS = $(filter-out $(TEST_DIR)/test-bootstrap.el $(TEST_DIR)/test-integration-%.el, \ - $(wildcard $(TEST_DIR)/test-*.el)) +# Test-file lists used by the coverage loop, mirroring tests/Makefile. +# Coverage runs ALL_TESTS (including :slow integration tests) so the report +# represents the full suite; selector is `t' rather than `(not (tag :slow))'. +ALL_TESTS = $(filter-out $(TEST_DIR)/test-bootstrap.el, \ + $(wildcard $(TEST_DIR)/test-*.el)) # Include local overrides if present (per-machine knobs, not committed) -include makefile-local @@ -110,10 +112,10 @@ compile: coverage: coverage-clean $(COVERAGE_DIR) @echo "[i] Cleaning .elc files so undercover can instrument source..." @find . -name "*.elc" -delete - @echo "[i] Running coverage across $(words $(UNIT_TESTS)) unit-test file(s)..." - @echo " (slower than 'make test-unit' — each file runs in its own Emacs)" + @echo "[i] Running coverage across $(words $(ALL_TESTS)) test file(s)..." + @echo " (slower than 'make test' — each file runs in its own Emacs)" @failed=0; \ - for test in $(UNIT_TESTS); do \ + for test in $(ALL_TESTS); do \ echo " Coverage: $$test..."; \ testfile=$$(basename $$test); \ $(EMACS_BATCH_TESTS) \ @@ -121,14 +123,16 @@ coverage: coverage-clean $(COVERAGE_DIR) -l run-coverage-file.el \ -l ../$(SOURCE_FILE) \ -l $$testfile \ - --eval "(ert-run-tests-batch-and-exit '(not (tag :slow)))" || failed=$$((failed + 1)); \ + --eval "(ert-run-tests-batch-and-exit t)" || failed=$$((failed + 1)); \ done; \ if [ $$failed -gt 0 ]; then \ echo "[!] $$failed test file(s) failed during coverage run"; \ exit 1; \ fi - @if [ -f $(COVERAGE_FILE) ]; then \ - echo "[✓] Coverage report: $(COVERAGE_FILE) ($$(du -h $(COVERAGE_FILE) | cut -f1))"; \ + @coverage_file="$${COVERAGE_FILE_ACTUAL:-$(COVERAGE_FILE)}"; \ + [ -n "$$CI" ] && coverage_file="$(COVERAGE_DIR)/coveralls.json"; \ + if [ -f "$$coverage_file" ]; then \ + echo "[✓] Coverage report: $$coverage_file ($$(du -h $$coverage_file | cut -f1))"; \ else \ echo "[!] No coverage file produced; check that undercover is installed"; \ exit 1; \ |
