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

Use Eask for CI #158

Merged
merged 5 commits into from
Apr 25, 2022
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
49 changes: 12 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,37 @@ on:
- master

jobs:
unix-test:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- 26.3
- 27.1
- 27.2
- 28.1
- snapshot

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
- uses: jcs090218/setup-emacs@master
with:
python-version: '3.6'
architecture: 'x64'
version: ${{ matrix.emacs-version }}

- uses: purcell/setup-emacs@master
- uses: actions/setup-node@v2
with:
version: ${{ matrix.emacs-version }}
node-version: '14'

- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'

- name: Set workaround env var
run: |
echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV

- uses: conao3/setup-cask@master
with:
version: 0.8.4

- name: Run tests
run: 'make unix-ci'

windows-test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
emacs-version:
- 26.3
- 27.1
- 27.2
- snapshot
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: 'x64'

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

- name: Run tests
run: 'make windows-ci'
run: 'make ci'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.cask
.eask
/dist
*.elc
tmp/
flycheck*
12 changes: 0 additions & 12 deletions Cask

This file was deleted.

26 changes: 26 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(package "lsp-dart"
"1.21.0"
"Dart support lsp-mode")

(package-file "lsp-dart.el")

(files "*.el")

(source "gnu")
(source "melpa")

(depends-on "emacs" "26.3")
(depends-on "lsp-treemacs")
(depends-on "lsp-mode")
(depends-on "dap-mode")
(depends-on "f")
(depends-on "dash")
(depends-on "dart-mode")

(development
(depends-on "el-mock")
(depends-on "ert-runner")
(depends-on "undercover")
(depends-on "spinner"))

(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432
66 changes: 12 additions & 54 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL=/usr/bin/env bash

EMACS ?= emacs
CASK ?= cask
EASK ?= eask

WINDOWS-INSTALL=-l test/windows-bootstrap.el

Expand All @@ -23,71 +23,29 @@ ARCHIVES-INIT="(progn \
(setq package-archives '((\"melpa\" . \"https://melpa.org/packages/\") \
(\"gnu\" . \"http://elpa.gnu.org/packages/\"))))"

# NOTE: Bad request occurs during Cask installation on macOS in Emacs
# version 26.x. By setting variable `package-archives` manually resolved
# this issue.
build:
@$(CASK) $(EMACS) -Q --batch \
--eval $(ARCHIVES-INIT)
cask install
$(EASK) package
$(EASK) install


unix-ci: WINDOWS-INSTALL=
unix-ci: clean build compile checkdoc lint unix-test

windows-ci: CASK=
windows-ci: clean compile checkdoc lint windows-test
ci: clean build compile checkdoc lint test

compile:
@echo "Compiling..."
@$(CASK) $(EMACS) -Q --batch \
$(WINDOWS-INSTALL) \
-L . \
--eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile \
*.el
$(EASK) compile

checkdoc:
$(eval LOG := $(shell mktemp -d)/checklog.log)
@touch $(LOG)

@echo "checking doc..."

@for f in *.el ; do \
$(CASK) $(EMACS) -Q --batch \
-L . \
--eval "(checkdoc-file \"$$f\")" \
*.el 2>&1 | tee -a $(LOG); \
done

@if [ -s $(LOG) ]; then \
echo ''; \
exit 1; \
else \
echo 'checkdoc ok!'; \
fi
$(EASK) checkdoc

lint:
@echo "package linting..."
@$(CASK) $(EMACS) -Q --batch \
-L . \
--eval $(INIT) \
--eval $(LINT) \
*.el

unix-test:
@$(CASK) exec ert-runner
$(EASK) lint

windows-test:
@$(EMACS) -Q --batch \
$(WINDOWS-INSTALL) \
-L . \
$(LOAD-TEST-FILES) \
--eval "(ert-run-tests-batch-and-exit \
'(and (not (tag no-win)) (not (tag org))))"
test:
$(EASK) install-deps --dev
$(EASK) ert ./test/*.el

clean:
rm -rf .cask *.elc
$(EASK) clean-all

tag:
$(eval TAG := $(filter-out $@,$(MAKECMDGOALS)))
Expand All @@ -103,4 +61,4 @@ tag:
%:
@:

.PHONY : ci compile checkdoc lint unix-test windows-test clean tag
.PHONY : ci compile checkdoc lint test clean tag
4 changes: 2 additions & 2 deletions lsp-dart-test-support.el
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ NOTIFICATION is the event notification.")
"Spawn COMMAND with ARGS on a separated buffer."
(lsp-dart-test--clean-process-buffer)
(let ((process-buffer (get-buffer-create lsp-dart-test--process-buffer-name))
(project-root (lsp-dart-get-project-root)))
(project-rt (lsp-dart-get-project-root)))
(with-current-buffer process-buffer
(setq-local default-directory (or project-root default-directory))
(setq-local default-directory (or project-rt default-directory))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have temporary rename the variable to project-rt, or else the package-lint will give me the following error:

184:9: error: You should depend on (emacs "28.1") if you need ‘project-root’.

(unless (derived-mode-p 'lsp-dart-test-process-mode)
(lsp-dart-test-process-mode))
(apply #'make-comint-in-buffer lsp-dart-test--process-buffer-name process-buffer command nil args))))
Expand Down
46 changes: 0 additions & 46 deletions test/windows-bootstrap.el

This file was deleted.