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 #700

Merged
merged 16 commits into from
Apr 12, 2022
53 changes: 18 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,37 @@ on:
- master

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

steps:
- uses: actions/checkout@v2
- uses: purcell/setup-emacs@master
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
with:
version: ${{ matrix.emacs-version }}

- uses: actions/setup-python@v2
- uses: jcs090218/setup-emacs-windows@master
if: matrix.os == 'windows-latest'
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: conao3/setup-cask@master
- uses: emacs-eask/setup-eask@master
with:
version: 0.8.4
version: '0.4.17'

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -45,37 +50,15 @@ jobs:
components: rust-src

- name: Install Rust Analyzer
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
env:
RUST_ANALYZER_VERSION: 2020-04-20
run: |
mkdir -p $HOME/bin
wget https://github.com/rust-analyzer/rust-analyzer/releases/download/$RUST_ANALYZER_VERSION/rust-analyzer-linux -O $HOME/bin/rust-analyzer
chmod +x $HOME/bin/rust-analyzer

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

windows-test:
runs-on: windows-latest
strategy:
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'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.cask/
.eask/
*.elc
12 changes: 0 additions & 12 deletions Cask

This file was deleted.

22 changes: 22 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(package "lsp-ui"
"8.0.0"
"UI integrations for lsp-mode")

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

(files "*.el" "lsp-ui-doc.html")

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

(depends-on "emacs" "26.3")
(depends-on "dash")
(depends-on "flycheck")
(depends-on "lsp-mode")
(depends-on "markdown-mode")
(depends-on "rustic")

(development
(depends-on "ert-runner"))

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

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

TEST-FILES := test/windows-bootstrap.el test/test-helper.el \
$(shell ls test/lsp-ui-*.el)
LOAD-FILE = -l $(test-file)
LOAD-TEST-FILES := $(foreach test-file, $(TEST-FILES), $(LOAD-FILE))

build:
EMACS=$(EMACS) cask install
EMACS=$(EMACS) cask build
EMACS=$(EMACS) cask clean-elc

# FIXME: Add `unix-test`
unix-ci: build unix-compile clean
# FIXME: add `test`
ci: build compile clean

# FIXME: Add `windows-test`
windows-ci: CASK=
windows-ci: windows-compile clean
build:
$(EASK) package
$(EASK) install
$(EASK) clean-elc

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

windows-compile:
@echo "Compiling..."
@$(CASK) $(EMACS) -Q --batch \
--eval '(setq emacs-lsp-ci t)' \
-l test/windows-bootstrap.el \
-L . \
--eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile \
*.el

unix-test:
EMACS=$(EMACS) cask exec ert-runner

windows-test:
@$(EMACS) -Q --batch \
--eval '(setq emacs-lsp-ci t)' \
-l test/windows-bootstrap.el \
-L . \
$(LOAD-TEST-FILES) \
--eval "(ert-run-tests-batch-and-exit \
'(and (not (tag no-win)) (not (tag org))))"
test:
@echo "Testing..."
$(EASK) install-deps --dev
$(EASK) exec ert-runner -L . $(LOAD-TEST-FILES) -t '!no-win' -t '!org'

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

.PHONY: build ci unix-compile unix-test windows-compile windows-test clean
.PHONY: ci build compile test clean
45 changes: 0 additions & 45 deletions test/windows-bootstrap.el

This file was deleted.