From d80038c04db513a4332a27147c993f825bedfb2e Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 8 Apr 2024 17:10:48 -0700 Subject: [PATCH] ci: Use Eask to test macos and windows --- .github/workflows/build.yaml | 31 +++++++++++++++------ .gitignore | 2 ++ Eask | 40 +++++++++++++++++++++++++++ Makefile | 53 +++++++++--------------------------- evil-collection.el | 3 +- 5 files changed, 79 insertions(+), 50 deletions(-) create mode 100644 Eask diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ebf802e..204a90a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,34 +7,47 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check: - 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: - 26.3 - 27.2 - 28.2 - - 29.2 - - snapshot + - 29.3 + experimental: [false] + include: + - os: ubuntu-latest + emacs-version: snapshot + experimental: true + - os: macos-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 }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Print emacs version run: | emacs --version - - uses: cask/setup-cask@master + - uses: emacs-eask/setup-eask@master with: version: snapshot - - run: cask install + - run: make install - run: make compile diff --git a/.gitignore b/.gitignore index d88ecb9..5824339 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /.cask +/.eask +/dist *.elc diff --git a/Eask b/Eask new file mode 100644 index 0000000..2f760f9 --- /dev/null +++ b/Eask @@ -0,0 +1,40 @@ +(package "evil-collection" + "0.0.2" + "A set of keybindings for Evil mode") + +(website-url "https://github.com/emacs-evil/evil-collection") +(keywords "evil" "tools") + +(package-file "evil-collection.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source 'gnu) +(source 'melpa) + +(depends-on "emacs" "26.3") +(depends-on "evil") +(depends-on "annalist") + +(development + (depends-on "f") + (depends-on "ert-runner") + (depends-on "package-lint") + (depends-on "magit")) + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 + +(add-hook 'eask-before-compile-hook + (lambda (&rest _) + (setq evil-want-integration nil) + (setq evil-want-keybinding nil) + (setq byte-compile-docstring-max-column 200) + (setq byte-compile-error-on-warn t))) + +(add-hook 'eask-before-lint/package-hook + (lambda (&rest _) + (advice-add 'package-lint--check-eval-after-load :around 'ignore) + (advice-add 'package-lint--check-version-regexp-list :around 'ignore) + (advice-add 'package-lint--check-symbol-separators :around 'ignore) + (advice-add 'package-lint--check-defs-prefix :around 'ignore) + (advice-add 'package-lint--check-provide-form :around 'ignore))) diff --git a/Makefile b/Makefile index 6ac84e2..3d2536e 100755 --- a/Makefile +++ b/Makefile @@ -1,50 +1,23 @@ -EMACS ?= emacs -CASK ?= cask - -LOADPATH = -L . -TESTPATH = -L ./test - -ELPA_DIR = \ - .cask/$(shell $(EMACS) -Q --batch --eval '(princ emacs-version)')/elpa +EASK ?= eask compile: - $(CASK) exec $(EMACS) -Q -batch \ - -L . \ - --eval "(setq evil-want-integration nil)" \ - --eval "(setq evil-want-keybinding nil)" \ - --eval "(setq byte-compile-docstring-max-column 200)" \ - --eval "(setq byte-compile-error-on-warn t)" \ - -f batch-byte-compile *.el modes/*/*.el + $(EASK) compile + +install: + $(EASK) install-deps --dev + $(EASK) package + $(EASK) install lint: - $(CASK) exec $(EMACS) -Q -batch \ - --eval "(require 'package)" \ - --eval "(push '(\"melpa\" . \"http://melpa.org/packages/\") package-archives)" \ - --eval "(package-initialize)" \ - --eval "(package-refresh-contents)" \ - -l package-lint.el \ - --eval "(advice-add 'package-lint--check-eval-after-load :around 'ignore)" \ - --eval "(advice-add 'package-lint--check-version-regexp-list :around 'ignore)" \ - --eval "(advice-add 'package-lint--check-symbol-separators :around 'ignore)" \ - --eval "(advice-add 'package-lint--check-defs-prefix :around 'ignore)" \ - --eval "(advice-add 'package-lint--check-provide-form :around 'ignore)" \ - -f package-lint-batch-and-exit *.el modes/*/*.el + $(EASK) lint package -test: elpa - $(CASK) exec $(EMACS) -Q -batch $(LOADPATH) $(TESTPATH) \ --l evil-collection-test.el -l evil-collection-magit-tests.el -f ert-run-tests-batch-and-exit +test: install + $(EASK) test ert ./test/evil-collection-test.el -magit-test: elpa - $(CASK) exec $(EMACS) -Q -batch $(LOADPATH) $(TESTPATH) \ --l evil-collection-magit-tests.el -f ert-run-tests-batch-and-exit +magit-test: install + $(EASK) test ert ./test/evil-collection-magit-tests.el -elpa: $(ELPA_DIR) -$(ELPA_DIR): Cask - $(CASK) install - mkdir -p $(ELPA_DIR) - touch $@ - -.PHONY: compile lint test elpa +.PHONY: compile lint test # Local Variables: # tab-width: 8 diff --git a/evil-collection.el b/evil-collection.el index aca0bb9..35658f4 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -684,7 +684,8 @@ NAME specifies the name of the entry added to HOOK. If APPEND is non-nil, the entry is appended to the hook. If LOCAL is non-nil, the buffer-local value of HOOK is modified. -This is a backport of `evil-delay' without the deprecation notice to deal with CI until migration can be done. +This is a backport of `evil-delay' without the deprecation notice to deal with +CI until migration can be done. Ref: https://github.com/emacs-evil/evil-collection/issues/750" (eval `(evil-with-delay ,condition (,hook ,append ,local ,name) ,form) t))