Skip to content

Commit 37e28a7

Browse files
authored
Update CI to work with multiple platforms (emacs-lsp#309)
* Add test for Emacs 27.1 * Add macOS to CI test * Use python version 2 * Rename job name to unix-test * Add windows test * Update make command * Update CI test for Windows * Copy bootstrap from lsp-mode * Update dependency list * Update year * Changed show report to open report * Fix CI lint, add commentary
1 parent 33364a2 commit 37e28a7

File tree

5 files changed

+97
-7
lines changed

5 files changed

+97
-7
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@ on:
99
- master
1010

1111
jobs:
12-
build:
13-
runs-on: ubuntu-latest
12+
unix-test:
13+
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16+
os: [ubuntu-latest, macos-latest]
1617
emacs-version:
1718
- 26.1
1819
- 26.2
1920
- 26.3
21+
- 27.1
2022
- snapshot
2123

2224
steps:
2325
- uses: actions/checkout@v1
2426

25-
- uses: actions/setup-python@v1.1.1
27+
- uses: actions/setup-python@v2
2628
with:
2729
python-version: '3.6'
2830
architecture: 'x64'
@@ -36,4 +38,33 @@ jobs:
3638
version: 0.8.4
3739

3840
- name: Run tests
39-
run: 'make test'
41+
run: 'make unix-ci'
42+
43+
windows-test:
44+
runs-on: windows-latest
45+
strategy:
46+
matrix:
47+
emacs-version:
48+
- 26.1
49+
- 26.2
50+
- 26.3
51+
- 27.1
52+
- snapshot
53+
54+
steps:
55+
- uses: actions/checkout@v2
56+
57+
- uses: actions/setup-python@v2
58+
with:
59+
python-version: '3.6'
60+
architecture: 'x64'
61+
62+
- uses: jcs090218/setup-emacs-windows@master
63+
with:
64+
version: ${{ matrix.emacs-version }}
65+
66+
- name: Install depedencies
67+
run: "pip install python-language-server"
68+
69+
- name: Run tests
70+
run: 'make windows-ci'

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,27 @@ LINT="(progn \
1818
build:
1919
cask install
2020

21-
test: build compile checkdoc lint
21+
unix-ci: build unix-compile checkdoc lint
2222

23-
compile:
23+
windows-ci: CASK=
24+
windows-ci: clean windows-compile checkdoc lint
25+
26+
unix-compile:
2427
@echo "Compiling..."
2528
@$(CASK) $(EMACS) -Q --batch \
2629
-L . \
2730
--eval '(setq byte-compile-error-on-warn t)' \
2831
-f batch-byte-compile \
2932
*.el
3033

34+
windows-compile:
35+
@echo "Compiling..."
36+
@$(CASK) $(EMACS) -Q --batch \
37+
-l test/windows-bootstrap.el \
38+
-L . -L clients \
39+
--eval '(setq byte-compile-error-on-warn t)' \
40+
-f batch-byte-compile $(LSP-FILES)
41+
3142
lint:
3243
@echo "package linting..."
3344
@$(CASK) $(EMACS) -Q --batch \

dap-java.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
;;; Commentary:
2727

28+
;; Java specific adapter for DAP mode
29+
2830
;;; Code:
2931

3032
(require 'lsp-java)

lsp-jt.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
:command (lsp-put
246246
(lsp-make-command
247247
:title title
248-
:command #'lsp-jt-show-report)
248+
:command #'lsp-jt-report-open)
249249
:_face face))))
250250
(-map #'lsp-copy lenses)))))
251251
(funcall callback all-lenses lsp--cur-version)))

test/windows-bootstrap.el

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
27+
(setq user-emacs-directory (expand-file-name (make-temp-name ".emacs.d")
28+
"~")
29+
package-user-dir (expand-file-name (make-temp-name "tmp-elpa")
30+
user-emacs-directory))
31+
32+
(let* ((package-archives '(("melpa" . "https://melpa.org/packages/")
33+
("gnu" . "https://elpa.gnu.org/packages/")))
34+
(pkgs '(lsp-mode markdown-mode dash f ht dash-functional request treemacs dap-mode)))
35+
(package-initialize)
36+
(package-refresh-contents)
37+
38+
(mapc (lambda (pkg)
39+
(unless (package-installed-p pkg)
40+
(package-install pkg)))
41+
pkgs)
42+
43+
(add-hook 'kill-emacs-hook
44+
`(lambda () (delete-directory ,user-emacs-directory t))))
45+
46+
;;; windows-bootstrap.el ends here

0 commit comments

Comments
 (0)