chore: switch to Eask for package testing
continuous-integration/drone/push Build is passing Details

This commit removes some files that are no longer needed for testing
the package, such as the files in the ./test directory which are
already covered by Eask itself.

BREAKING CHANGE: test files no longer exists
This commit is contained in:
Lucien Cartier-Tilet 2023-05-14 13:02:10 +02:00
parent 86f211ba50
commit d851c7de92
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
11 changed files with 190 additions and 86 deletions

View File

@ -1,11 +0,0 @@
image: alpine/edge
packages:
- emacs
- make
sources:
- https://git.sr.ht/~abrahms/ox-gemini
tasks:
- build: |
cd ox-gemini
make update
make compile

75
.drone.yml Normal file
View File

@ -0,0 +1,75 @@
---
kind: pipeline
type: docker
name: emacs 26
steps:
- name: tests
image: silex/emacs:26-alpine
commands:
- apk add npm make
- npm install -g @emacs-eask/cli
- make clean
- make package
- make install
- make compile
- make checkdoc
- make lint
- make clean
---
kind: pipeline
type: docker
name: emacs 27
steps:
- name: tests
image: silex/emacs:27-alpine
commands:
- apk add npm make
- npm install -g @emacs-eask/cli
- make clean
- make package
- make install
- make compile
- make checkdoc
- make lint
- make clean
---
kind: pipeline
type: docker
name: emacs 28
steps:
- name: tests
image: silex/emacs:28-alpine
commands:
- apk add npm make
- npm install -g @emacs-eask/cli
- make clean
- make package
- make install
- make compile
- make checkdoc
- make lint
- make clean
---
kind: pipeline
type: docker
name: emacs master
steps:
- name: tests
image: silex/emacs:master-alpine
commands:
- apk add npm make
- npm install -g @emacs-eask/cli
- make clean
- make package
- make install
- make compile
- make checkdoc
- make lint
- make clean

17
.gitignore vendored
View File

@ -1,2 +1,17 @@
# ignore these directories
/.git
/recipes
# ignore log files
/.log
# ignore generated files
*.elc
.elpa/
# eask packages
.eask/
dist/
# packaging
*-autoloads.el
*-pkg.el

14
Eask Normal file
View File

@ -0,0 +1,14 @@
(package "ox-gemini"
"0.2.0"
"Output gemini formatted documents from org-mode")
(website-url "https://labs.phundrak.com/phundrak/ox-gemini")
(keywords "lisp" "org-mode")
(package-file "ox-gemini.el")
(script "test" "echo \"Error: no test specified\" && exit 1")
(source "gnu")
(depends-on "emacs" "26.1")

View File

@ -1,16 +1,64 @@
EMACS = emacs
EMACS ?= emacs
EASK ?= eask
compile: clean lint
${EMACS} --version
${EMACS} -batch -l test/elpa.el -l test/compile.el
.PHONY: clean package install compile test checkdoc lint
clean:
rm -f *.elc
# (Option 1): Basic for beginner, only tests for package's installation
ci: clean package install compile
# (Option 2): Advanced for a high-quality package
#ci: clean package install compile checkdoc lint test
# Build an package artefact, default to `dist` folder
#
# This is used to test if your package can be built correctly before the
# package installation.
package:
@echo "Packaging..."
$(EASK) package
# Install package
#
# If your package is a single file package, you generally wouldn't need to
install:
@echo "Installing..."
$(EASK) install
# Byte-compile package
#
# Compile all your package .el files to .elc
compile:
@echo "Compiling..."
$(EASK) compile
# Run regression tests
#
# The default test is `ert`; but Eask also support other regression test!
# See https://emacs-eask.github.io/Getting-Started/Commands-and-options/#-linter
test:
@echo "Testing..."
$(EASK) install-deps --dev
$(EASK) test ert ./test/*.el
# Run checkdoc
#
# See https://www.emacswiki.org/emacs/CheckDoc
checkdoc:
@echo "Checking documentation..."
$(EASK) lint checkdoc --strict
# Lint package metadata
#
# See https://github.com/purcell/package-lint
lint:
${EMACS} --batch -l test/lint.el
@echo "Linting..."
$(EASK) lint package
update:
${EMACS} -batch -l test/make-update.el
.PHONY: update compile test clean
# Clean up
#
# This will clean all the entire workspace including the following folders
# and files
#
# - .eask folder (sandbox)
# - all .elc files
clean:
$(EASK) clean all

View File

@ -16,5 +16,8 @@ gemini links as described in commit [[https://labs.phundrak.com/phundrak/ox-gemi
TODOs formerly in =ox-gemini.el= have also been moved to issues.
** Eask
This project is managed with [[https://github.com/emacs-eask/cli][Eask]].
* License
This software is licensed under GPLv3.

View File

@ -1,12 +1,27 @@
;;; ox-gemini.el --- Output gemini formatted documents from org-mode -*- lexical-binding: t; -*-
;; Author: Justin Abrahms <justin@abrah.ms>
;; URL: https://git.sr.ht/~abrahms/ox-gemini
;; Keywords: lisp gemini
;; Version: 0
;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com>
;; URL: https://labs.phundrak.com/phundrak/ox-gemini
;; Version: 0.2.0
;; Keywords: lisp org-mode
;; Package-Requires: ((emacs "26.1"))
;; SPDX-License-Identifier: GPL-3.0-or-later
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
@ -103,10 +118,11 @@ INFO is a plist."
(concat (file-name-sans-extension (org-element-property :path link)) ".gmi")
raw-path))
(desc (org-element-contents link))
(anchor (string-replace "\n" " "
(org-export-data
(or desc (org-element-property :raw-link link))
info))))
(anchor (replace-regexp-in-string (regexp-quote "\n")
" "
(org-export-data
(or desc (org-element-property :raw-link link))
info))))
(format "=> %s %s\n" (url-encode-url path) anchor)))
links "")
(when (car links)

View File

@ -1,8 +0,0 @@
;; bail out on compilation warnings and errors
(setq byte-compile-error-on-warn t)
(setq byte-compile--use-old-handlers nil)
;; compile *.el files
(dolist (file (file-expand-wildcards "*.el"))
(unless (byte-compile-file file)
(kill-emacs 1)))

View File

@ -1,4 +0,0 @@
(setq package-user-dir
(expand-file-name (format ".elpa/%s/elpa" emacs-version)))
(package-initialize)
(add-to-list 'load-path default-directory)

View File

@ -1,16 +0,0 @@
(message "Emacs version: %s" emacs-version)
(dolist (file (file-expand-wildcards "*.el"))
(let ((checkdoc-diagnostic-buffer "*warn*")
;; bail out on checkdoc warnings
(checkdoc-create-error-function (lambda (text start end &optional unfixable)
(message "%s:%s %s"
file
(line-number-at-pos start)
text)
(kill-emacs 1))))
(with-current-buffer (find-file-noselect file)
;; Eval the buffer first because otherwise checkdoc isn't smart
;; enough to recognize that some symbols are defined.
(eval-buffer)
(checkdoc-current-buffer t))))

View File

@ -1,28 +0,0 @@
;; list of the all the dependencies, including the dev dependencies
(defvar dev-packages '(evil evil-test-helpers))
;; initialize package.el
(setq package-user-dir
(expand-file-name (format ".elpa/%s/elpa" emacs-version)))
(message "installing in %s ...\n" package-user-dir)
(package-initialize)
(setq package-archives
'(("melpa" . "http://melpa.org/packages/")
("gnu" . "http://elpa.gnu.org/packages/")))
(package-refresh-contents)
;; install dependencies
(dolist (package dev-packages)
(unless (package-installed-p package)
(ignore-errors
(package-install package))))
;; upgrade dependencies
(save-window-excursion
(package-list-packages t)
(condition-case nil
(progn
(package-menu-mark-upgrades)
(package-menu-execute t))
(error
(message "All packages up to date"))))