Skip to content
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

Modernize build #549

Merged
merged 1 commit into from
Sep 15, 2023
Merged
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
140 changes: 106 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,120 @@
version: 2.1

# Default actions to perform on each Emacs version
default: &default-steps
environment:
TERM: xterm
steps:
- checkout
- run: apt-get update && apt-get install make
- run: cask upgrade-cask || true
- run: make elpa
- run: emacs --version
- run: cask --version
- run: make test
# Make sure to run test-checks before test-bytecomp, as test-bytecomp autogenerates
# files which won't pass test-checks.
# disabled - see https://github.com/clojure-emacs/clj-refactor.el/issues/491
#- run: make test-checks
#- run: make test-bytecomp
orbs:
win: circleci/windows@2.2.0

# Enumerated list of Emacs versions
jobs:
commands:
setup:
steps:
- checkout
- run:
name: Install Eldev
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh
- run:
name: Install unzip
command: apt-get update && apt-get install unzip

setup-macos:
steps:
- checkout
- run:
name: Install Emacs latest
command: |
brew install homebrew/cask/emacs
- run:
name: Install Eldev
command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh

setup-windows:
steps:
- checkout
- run:
name: Install Eldev
command: |
# Remove expired DST Root CA X3 certificate. Workaround
# for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038
# bug on Emacs 27.2.
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item
(iwr https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev.ps1).Content | powershell -command -
test:
steps:
- run:
name: Run regression tests
command: eldev -dtT -p test
lint:
steps:
- run:
name: Run regression tests
command: eldev -dtT compile

test-emacs-26:
jobs:
test-ubuntu-emacs-26:
docker:
- image: silex/emacs:26-ci-cask
- image: silex/emacs:26-ci
entrypoint: bash
<<: *default-steps

test-emacs-27:
steps:
- setup
- test
- lint
test-ubuntu-emacs-27:
docker:
- image: silex/emacs:27-ci-cask
- image: silex/emacs:27-ci
entrypoint: bash
<<: *default-steps

test-emacs-master:
steps:
- setup
- test
- lint
test-ubuntu-emacs-28:
docker:
- image: silex/emacs:28-ci
entrypoint: bash
steps:
- setup
- test
- lint
test-ubuntu-emacs-29:
docker:
- image: silex/emacs:29-ci
entrypoint: bash
steps:
- setup
- test
- lint
test-ubuntu-emacs-master:
docker:
- image: silex/emacs:master-ci-cask
- image: silex/emacs:master-ci
entrypoint: bash
<<: *default-steps
steps:
- setup
- test
- lint
test-macos-emacs-latest:
macos:
xcode: "14.0.0"
steps:
- setup-macos
- test
- lint
test-windows-emacs-latest:
executor: win/default
steps:
- run:
name: Install Emacs latest
command: |
choco install emacs
- setup-windows
- test
- lint

workflows:
version: 2
version: 2.1
ci-test-matrix:
jobs:
- test-emacs-26
- test-emacs-27
- test-emacs-master
- test-ubuntu-emacs-26
- test-ubuntu-emacs-27
- test-ubuntu-emacs-28
- test-ubuntu-emacs-29
- test-ubuntu-emacs-master
- test-windows-emacs-latest
- test-macos-emacs-latest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ elpa
tmp
.ecukes-failing-scenarios
clj-refactor.elc
/.eldev
/clj-refactor-autoloads.el
9 changes: 0 additions & 9 deletions Cask

This file was deleted.

20 changes: 20 additions & 0 deletions Eldev
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-

(eldev-require-version "0.6")

(eldev-use-package-archive 'gnu)
;; For compatibility; e.g. with MELPA Stable one test fails.
(eldev-use-package-archive 'melpa-unstable)

(eldev-use-plugin 'autoloads)

;; (eldev-add-extra-dependencies 'test 'a)

;; CIDER cannot be compiled otherwise.
(setf eldev-build-load-before-byte-compiling t)

(setf eldev-lint-default '(elisp))
(with-eval-after-load 'elisp-lint
;; We will byte-compile with Eldev.
(setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile")
enable-local-variables :safe))
54 changes: 15 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,23 @@
CASK = cask
export EMACS ?= emacs
EMACSFLAGS =
.PHONY: clean compile lint test
.DEFAULT_GOAL := all

PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory)

SRCS = $(wildcard *.el)
OBJS = $(SRCS:.el=.elc)

.PHONY: compile unit-tests integration-tests test clean elpa

all: compile

elpa-$(EMACS):
$(CASK) install
$(CASK) update
touch $@

elpa: elpa-$(EMACS)

elpaclean:
rm -f elpa*
rm -rf .cask # Clean packages installed for development

compile: elpa
$(CASK) build
# Something like this can be handy if you need Eldev to run on an Emacs other than your default one:
# export ELDEV_EMACS="$HOME/emacs28/Emacs.app/Contents/MacOS/Emacs"

clean:
rm -f $(OBJS)

integration-tests: $(PKGDIR)
$(CASK) exec ecukes --no-win
echo

unit-tests:
$(CASK) exec buttercup -L .
# You can find a generic `eldev` installation script in https://github.com/emacs-eldev/eldev/blob/master/webinstall/eldev
# (Don't use the one defined for CircleCI in your local machine)

test: unit-tests integration-tests
lint: clean
eldev lint

test-checks:
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \
-l test/test-checks.el ./
# Checks for byte-compilation warnings.
compile: clean
eldev -dtT compile --warnings-as-errors

test-bytecomp: $(SRCS:.el=.elc-test)
test: clean
eldev -dtT -p test

%.elc-test: %.el elpa
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \
-l test/clojure-mode-bytecomp-warnings.el $
all: lint compile test
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,10 @@ You'll find the repo at:

https://github.com/clojure-emacs/clj-refactor.el

To fetch the test dependencies, install
[cask](https://github.com/cask/cask) if you haven't already,
then:

$ cd /path/to/clj-refactor
$ cask

Run the tests with:

$ make test


Before submitting a patch, or a pull request, make sure all tests are
passing and that your patch is in line with the [contribution
guidelines](.github/CONTRIBUTING.md).
Expand All @@ -160,12 +152,6 @@ Thanks to [everyone](https://github.com/clojure-emacs/clj-refactor.el/graphs/con
Due to clj-refactor's kinship with CIDER, you can get help for it
in most CIDER-related support channels.

### Discord

CIDER has its own Discord chat server, created by CIDER's
author Bozhidar. You can join the Discord server
[here](https://discord.com/invite/nFPpynQPME).

### Slack

CIDER has an official [Clojurians Slack](https://clojurians.slack.com/) - `#cider`. The channel is very active and is a great way to
Expand Down
Loading