From a26f00e5ce4577111fafae51f80609c7a05b7555 Mon Sep 17 00:00:00 2001 From: Jake Ireland Date: Mon, 22 Apr 2024 19:39:35 +1200 Subject: [PATCH] Add CI and test Makefile --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ Makefile | 28 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 Makefile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..104378b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: CI + +on: + pull_request: + push: + paths-ignore: + - '**.md' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + emacs_version: + - 27.1 + - 27.2 + - 28.1 + - 28.2 + - snapshot + steps: + - uses: purcell/setup-emacs@master + with: + version: ${{ matrix.emacs_version }} + + - uses: actions/checkout@v2 + - name: Run tests + run: make diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e07407c --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +EMACS ?= emacs + +# A space-separated list of required package names +NEEDED_PACKAGES = package-lint + +INIT_PACKAGES="(progn \ + (require 'package) \ + (push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \ + (package-initialize) \ + (dolist (pkg '(${NEEDED_PACKAGES})) \ + (unless (package-installed-p pkg) \ + (unless (assoc pkg package-archive-contents) \ + (package-refresh-contents)) \ + (package-install pkg))) \ + )" + +all: compile package-lint clean-elc + +package-lint: + ${EMACS} -Q --eval ${INIT_PACKAGES} -batch -f package-lint-batch-and-exit splunk-mode.el + +compile: clean-elc + ${EMACS} -Q --eval ${INIT_PACKAGES} -L . -batch -f batch-byte-compile *.el + +clean-elc: + rm -f f.elc + +.PHONY: all compile clean-elc package-lint