Skip to content

A collection of reusable GitHub workflows for Emacs Lisp CI

License

Notifications You must be signed in to change notification settings

emacs-twist/elisp-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Reusable GitHub Workflows for Emacs Lisp Projects

This is a collection of reusable workflows for checking Emacs Lisp packages on GitHub Actions. These workflows assumes your project contains flake.nix for rice.

With these workflows, you can automate the following checks with a very concise code:

  • Run byte-compile with every Emacs version supporting your package.
  • Run melpazoid (which is the official checker on MELPA).

Screenshot

https://raw.githubusercontent.com/emacs-twist/elisp-workflows/assets/screenshot.png

Installation

First follow the instruction in rice-config to add a flake.nix that conforms that the Rice API. Then create a workflow file in .github/workflows directory of same repository.

Usage and example

You can add the following GitHub workflow file to your repository:

name: Check Emacs Lisp

on:
  pull_request:
    paths-ignore:
      - 'README.*'
  push:
    branches:
      - master
    paths-ignore:
      - 'README.*'

  workflow_dispatch:

jobs:
  compile-and-test:
    uses: emacs-twist/elisp-workflows/.github/workflows/compile-and-test.yml@master
    with:
      rice-config: github:your-user/rice-config
      melpa: github:your-user/melpa/branch
      systems: github:nix-systems/x86_64-linux

  melpazoid:
    uses: emacs-twist/elisp-workflows/.github/workflows/melpazoid.yml@master
    with:
      rice-config: github:your-user/rice-config
      melpa: github:your-user/melpa/branch

This workflow runs byte-compile (and optional test) and melpazoid in parallel. Byte-compile is run on every Emacs version supported by your package(s). Melpazoid is run on the latest release version of Emacs.

If you have multiple packages in your repository, the checks are run for each package simultaneously.

Each workflow accepts the following input parameters:

rice-config (optional)
A flake reference URL to rice-config. This is optional, and the original repository will be used in that case, but it is recommended to fork the repository and add flake.lock to prevent from supply-chain attacks.
melpa (optional)
A flake reference URL to melpa. If your package is already on MELPA and no recipe change is involved, you can omit this setting. If your package is not available on MELPA yet, specify a branch that contains a recipe for the package, e.g. github:your-user/melpa/branch. See the documentation of rice-config for details.
registries (optional)
A flake reference URL to registries. If you use a custom registry configuration for your package(s), you will have to set this option as well.
lock-dir (optional)
A relative path from the project root to the lock directory. By default, it is .rice-lock/default. If your package doesn’t have any Emacs Lisp dependency, set the value to '' (an empty string).

The following input parameter is accepted by compile-and-test, but not by melpazoid:

systems (optional)
A flake reference URL to nix-systems. The CI matrix will be generated for these systems. The default value is github:nix-systems/default, which means the checks will be run on both Mac and Linux. If you are not worried about cross-platform compatibility of your package, you can complete the CI earlier by setting this value to github:nix-systems/x86_64-linux, because Nix is generally faster on Linux than on Mac especially on GitHub Actions.

For details, refer to the workflow files:

About

A collection of reusable GitHub workflows for Emacs Lisp CI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published