Skip to content

Commit 40d26c1

Browse files
authored
CI Implementation (#97)
* Add CI badge * Add CI config * Add CI command makefile * Copy windows-bootstrap from lsp-mode * Change dep for windows-bootstrap * Rename to treemacs specific files * Rename to treemacs specific files * Use byte-compile on warn * Attempt to fix CI * Revert free variables issue * Fixed byte compile warnings
1 parent 9e8b148 commit 40d26c1

File tree

5 files changed

+132
-1
lines changed

5 files changed

+132
-1
lines changed

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
unix-test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, macos-latest]
11+
emacs-version:
12+
- 26.1
13+
- 26.2
14+
- 26.3
15+
- 27.1
16+
- snapshot
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: purcell/setup-emacs@master
22+
with:
23+
version: ${{ matrix.emacs-version }}
24+
25+
- uses: conao3/setup-cask@master
26+
with:
27+
version: 0.8.4
28+
29+
- name: Run tests
30+
run: make unix-ci
31+
32+
windows-test:
33+
runs-on: windows-latest
34+
strategy:
35+
matrix:
36+
emacs-version:
37+
- 26.1
38+
- 26.2
39+
- 26.3
40+
- 27.1
41+
- snapshot
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
46+
- uses: jcs090218/setup-emacs-windows@master
47+
with:
48+
version: ${{ matrix.emacs-version }}
49+
50+
- name: Run tests
51+
run: make windows-ci

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.PHONY: all build unix-compile windows-compile clean
2+
3+
EMACS ?= emacs
4+
CASK ?= cask
5+
6+
LSP-TREEMACS-GENERAL := lsp-treemacs.el lsp-treemacs-themes.el
7+
8+
all:
9+
$(CASK) build
10+
11+
build:
12+
$(CASK) install
13+
14+
# NOTE: treemacs also sets treemacs-no-load-time-warnings to t in its Makefile, so I guess it's OK?
15+
unix-compile:
16+
@$(CASK) $(EMACS) -Q --batch \
17+
-L . \
18+
--eval '(setq byte-compile-error-on-warn t)' \
19+
-f batch-byte-compile $(LSP-TREEMACS-GENERAL)
20+
21+
windows-compile:
22+
@$(CASK) $(EMACS) -Q --batch \
23+
-l test/windows-bootstrap.el \
24+
-L . \
25+
--eval '(setq byte-compile-error-on-warn t)' \
26+
-f batch-byte-compile $(LSP-TREEMACS-GENERAL)
27+
28+
unix-ci: clean build unix-compile
29+
30+
windows-ci: CASK=
31+
windows-ci: clean windows-compile
32+
33+
clean:
34+
rm -rf .cask *.elc

README.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[https://github.com/emacs-lsp/dap-mode/actions][file:https://github.com/emacs-lsp/lsp-treemacs/workflows/CI/badge.svg]]
12
[[https://melpa.org/#/lsp-treemacs][file:https://melpa.org/packages/lsp-treemacs-badge.svg]]
23
[[https://stable.melpa.org/#/lsp-treemacs][file:https://stable.melpa.org/packages/lsp-treemacs-badge.svg]]
34

lsp-treemacs.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ With a prefix argument, select the new window expand the tree of implementations
988988
callback
989989
(seq-map
990990
(-lambda (node)
991-
(-let* (((child-item &as &CallHierarchyItem :kind :uri :selection-range (&Range :start))
991+
(-let* (((child-item &as &CallHierarchyItem :_name :kind :_detail? :_uri :selection-range (&Range :_start))
992992
(if outgoing
993993
(lsp:call-hierarchy-outgoing-call-to node)
994994
(lsp:call-hierarchy-incoming-call-from node)))

test/windows-bootstrap.el

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
;;; windows-bootstrap.el --- Windows test bootstrap -*- lexical-binding: t; -*-
2+
;;
3+
;; Copyright (C) 2020-2021 emacs-lsp maintainers
4+
;;
5+
;; This program is free software; you can redistribute it and/or modify
6+
;; it under the terms of the GNU General Public License as published by
7+
;; the Free Software Foundation, either version 3 of the License, or
8+
;; (at your option) any later version.
9+
10+
;; This program is distributed in the hope that it will be useful,
11+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
;; GNU General Public License for more details.
14+
15+
;; You should have received a copy of the GNU General Public License
16+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
;;
18+
;;; Commentary:
19+
;;
20+
;; Windows test bootstrap
21+
;;
22+
;;; Code:
23+
24+
(require 'package)
25+
26+
(setq user-emacs-directory (expand-file-name (make-temp-name ".emacs.d")
27+
"~")
28+
package-user-dir (expand-file-name (make-temp-name "tmp-elpa")
29+
user-emacs-directory))
30+
31+
(let* ((package-archives '(("melpa" . "https://melpa.org/packages/")
32+
("gnu" . "http://elpa.gnu.org/packages/")))
33+
(pkgs '(dash dash-functional f ht treemacs lsp-mode)))
34+
(package-initialize)
35+
(package-refresh-contents)
36+
37+
(mapc (lambda (pkg)
38+
(unless (package-installed-p pkg)
39+
(package-install pkg)))
40+
pkgs)
41+
42+
(add-hook 'kill-emacs-hook
43+
`(lambda () (delete-directory ,user-emacs-directory t))))
44+
45+
;;; windows-bootstrap.el ends here

0 commit comments

Comments
 (0)