Skip to content

ci: Simplify CI using Eask #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 54 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,51 +23,94 @@ on:

jobs:
build:
runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
emacs_version:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
# - 28.2
# - 29.4
- 30.1
- snapshot
experimental: [false]
include:
- os: ubuntu-latest
emacs-version: snapshot
experimental: true
- os: macos-latest
emacs-version: snapshot
experimental: true
- os: windows-latest
emacs-version: snapshot
experimental: true

steps:
- uses: purcell/setup-emacs@master
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}
version: ${{ matrix.emacs-version }}

- name: Pull polymode
uses: actions/checkout@v4
- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'

- name: Pull poly-markdown
uses: actions/checkout@v4
with:
repository: polymode/poly-markdown
path: polyrepos/poly-markdown
path: poly-markdown

- name: Pull poly-org
uses: actions/checkout@v4
with:
repository: polymode/poly-org
path: polyrepos/poly-org
path: poly-org

- name: Pull poly-noweb
uses: actions/checkout@v4
with:
repository: polymode/poly-noweb
path: polyrepos/poly-noweb
path: poly-noweb

- name: Pull polymode
uses: actions/checkout@v4
with:
path: polymode

- name: Check Emacs version
run: emacs --version

- name: ELPA
working-directory: polymode
run: make elpa

- name: Build
working-directory: polymode
run: make build

- name: Test
working-directory: polymode
run: make test-local

# Tests for downstream packages.

- name: Test poly-markdown
working-directory: poly-markdown
run: |
eask link add polymode ../polymode
eask install-deps --dev
eask test ert ./tests/*.el

- name: Test poly-org
working-directory: poly-org
run: |
eask link add polymode ../polymode
eask install-deps --dev
eask test ert ./tests/*.el

- name: Test poly-noweb
working-directory: poly-noweb
run: |
eask link add polymode ../polymode
eask install-deps --dev
eask test ert ./tests/*.el
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ site/

# ELPA-generated files
/polymode-pkg.el

# Packaging
/.eask
/dist

# Tests
/polyrepos
46 changes: 46 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
;; -*- mode: eask; lexical-binding: t -*-

(package "polymode"
"0.2.2"
"Extensible framework for multiple major modes")

(website-url "https://github.com/polymode/polymode")
(keywords "languages" "multi-modes" "processes")

(package-file "polymode.el")
(files "polymode-*.el")

(script "test" "echo \"Error: no test specified\" && exit 1")

(source 'gnu)
(source 'melpa)

(depends-on "emacs" "25")

(development
(depends-on "ess")
(depends-on "markdown-mode")
(depends-on "yaml-mode")
(depends-on "rust-mode")
(depends-on "slim-mode")
(depends-on "elisp-lint")
(depends-on "coffee-mode")
(depends-on "poly-markdown"))

;; For byte-compile

(add-hook 'eask-before-compile-hook
(lambda ()
;; Turn this on for more restriction.
;;(setq byte-compile-error-on-warn t)
))

;; For ERT tests

(load-paths (expand-file-name "tests/"))

(add-hook 'eask-before-test/ert-hook
(lambda ()
(setq ert-batch-backtrace-right-margin 200)
(setq ert-batch-print-level nil)
(setq ert-batch-print-length nil)))
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ELPA_DIR := .ELPA/$(EMACS_VERSION)
EMACSRUN = $(EMACS) -Q -L . -L modes -L tests -L $(ELPA_DIR)
EMACSBATCH = $(EMACSRUN) --batch
EMACSTARGET = $(EMACSBATCH) -l targets/poly-targets.el
EASK ?= eask

ELS = $(wildcard *.el)
LINTELS = $(filter-out polymode-autoloads.el polymode-compat.el polymode-configuration.el, $(ELS))
Expand All @@ -16,22 +17,22 @@ OBJECTS = $(ELS:.el=.elc)

all: build checkdoc test

build: version cleansilent
build: cleansilent
@echo "******************* BUILDING $(MODULE) *************************"
@$(EMACSBATCH) --funcall batch-byte-compile *.el
$(EASK) compile

checkdoc: version
@echo "******************* CHECKDOC $(MODULE) *************************"
@$(EMACSTARGET) -f pm--target-checkdoc $(LINTELS)
$(EASK) lint checkdoc

clean:
rm -f $(OBJECTS) polymode-autoloads.el
$(EASK) clean all

cleanall: cleansilent
rm -rf $(ELPA_DIR)
$(EASK) clean workspace

cleansilent:
@rm -f $(OBJECTS)
$(EASK) clean elc

docs-build:
mkdocs build
Expand All @@ -40,10 +41,11 @@ docs-deploy:
cd ../polymode.github.io/; mkdocs gh-deploy --config-file ../polymode/mkdocs.yml --remote-branch master

lint: version
@$(EMACSTARGET) -f pm--target-melpa-init -f pm--target-lint $(LINTELS)
@$(EASK) lint checkdoc
@$(EASK) lint elisp-lint

melpa: version
@$(EMACSTARGET) -f pm--target-melpa
@$(EASK) install-deps --dev

elpa: melpa

Expand All @@ -64,7 +66,7 @@ test: version clean

test-local: version
@echo "******************* Testing $(MODULE) ***************************"
$(EMACSTARGET) -f pm--target-local-init -f pm--target-test
$(EASK) test ert tests/*.el

test/%:
$(eval PATTERN := $(subst test/, , $@))
Expand Down
27 changes: 0 additions & 27 deletions tests/poly-modes-tests.el

This file was deleted.

2 changes: 1 addition & 1 deletion tests/span-matcher-tests.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;;; poly-modes-tests.el -- Tests for Polymode -*- lexical-binding: t; -*-
;;; span-matcher-tests.el -- Tests for Polymode -*- lexical-binding: t; -*-

;; Copyright (C) 2018-2022 Free Software Foundation, Inc.

Expand Down