Install Eldev in a GitHub Actions workflow. Can be used on Linux, macOS and Windows operating systems — i.e. currently all OSes available on GitHub workflow runners.
Refer to Eldev’s own documentation on how to use the installed tool for continuous integration on GitHub.
This action has two optional inputs:
-
bootstrap
: whether to bootstrap Eldev right away, can betrue
,auto
(the default) orfalse
. Whenauto
, Eldev will be bootstrapped if Emacs is already provided by a previous workflow step (with typical usage this is the same astrue
). Bootstrapping explicitly during installation can help to separate potential problems (e.g. due to network failures) from your real testing code and have them in a predictable place. -
cache
: whether to cache Eldev’s GPAC (global package archive cache) between workflow runs, this is on (true
) by default; this speeds up workflow a bit, especially if your project has multiple dependencies.
There is currently one output:
-
bootstrapped
: whether the installed Eldev was bootstrapped by the action (see corresponding input above). But even if not bootstrapped by the action, Eldev will do it automatically on first invocation anyway.
In addition to Eldev, you will need to make sure Emacs of appropriate
version is available, preferably before invoking this action. I
recommend using Jen-Chieh Shen’s setup-emacs
action, which runs on all operating systems, but any other method you
prefer can be used just as well.
Usage, including Emacs setup:
steps:
...
- name: Set up Emacs
uses: jcs090218/setup-emacs@master
with:
version: ...
- name: Install Eldev
uses: emacs-eldev/setup-eldev@v1
An example workflow that tests on different Emacs versions and different OSes:
name: CI
on:
push:
paths-ignore: ['**.md', '**.adoc']
pull_request:
paths-ignore: ['**.md', '**.adoc']
jobs:
test:
runs-on: ${{matrix.os}}
continue-on-error: ${{matrix.emacs-version == 'snapshot'}}
strategy:
matrix:
os: [ubuntu-latest]
emacs-version: ['27.1', '27.2', '28.1', '28.2', '29.1', 'snapshot']
include:
- os: macos-latest
emacs-version: '29.1'
- os: windows-latest
emacs-version: '29.1'
steps:
- name: Set up Emacs
uses: jcs090218/setup-emacs@master
with:
version: ${{matrix.emacs-version}}
- name: Install Eldev
uses: emacs-eldev/setup-eldev@v1
- name: Check out the source code
uses: actions/checkout@v4
- name: Test the project
run: |
eldev -p -dtT -C test
- name: Ensure there are no byte-compilation warnings
run: |
eldev -dtT -C compile --set all --warnings-as-errors
- name: Lint the project
run: |
eldev -p -dtT -C lint