Skip to content

Commit 44c0ffc

Browse files
authored
Merge pull request #426 from jcs-PR/ci
Update CI to work with multiple platforms
2 parents 612388d + 4ba3816 commit 44c0ffc

File tree

6 files changed

+112
-14
lines changed

6 files changed

+112
-14
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on: [push, pull_request]
44

55
jobs:
66
unix-test:
7-
runs-on: ubuntu-latest
7+
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10+
os: [ubuntu-latest, macos-latest]
1011
emacs-version:
1112
- 26.1
1213
- 26.2
@@ -26,4 +27,25 @@ jobs:
2627
version: 0.8.4
2728

2829
- name: Run tests
29-
run: make ci
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: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
.PHONY: all build byte-compile clean test
1+
.PHONY: all build unix-compile windows-compile clean unix-test windows-test
22

33
EMACS ?= emacs
44
CASK ?= cask
55

66
DAP-GENERAL := dap-launch.el dap-overlays.el dap-variables.el \
7-
dap-mode.el dapui.el dap-ui.el dap-mouse.el \
7+
dap-mode.el dapui.el dap-ui.el dap-mouse.el \
88
dap-hydra.el dap-utils.el
99

1010
# TODO: make a clients/ directory and update melpa recipe
@@ -13,22 +13,45 @@ DAP-CLIENTS := dap-chrome.el dap-cpptools.el dap-edge.el \
1313
dap-go.el dap-lldb.el dap-netcore.el dap-node.el \
1414
dap-php.el dap-pwsh.el dap-python.el dap-ruby.el
1515

16+
TEST-FILES := test/windows-bootstrap.el $(shell ls test/dap-*.el)
17+
LOAD-FILE = -l $(test-file)
18+
LOAD-TEST-FILES := $(foreach test-file, $(TEST-FILES), $(LOAD-FILE))
19+
1620
all:
1721
$(CASK) build
1822

1923
build:
2024
$(CASK) install
2125

2226
# NOTE: treemacs also sets treemacs-no-load-time-warnings to t in its Makefile, so I guess it's OK?
23-
byte-compile:
24-
@$(CASK) $(EMACS) -Q --batch -L . \
27+
unix-compile:
28+
@$(CASK) $(EMACS) -Q --batch \
29+
-L . \
30+
--eval '(setq treemacs-no-load-time-warnings t)' \
31+
-f batch-byte-compile $(DAP-GENERAL) $(DAP-CLIENTS)
32+
33+
windows-compile:
34+
@$(CASK) $(EMACS) -Q --batch \
35+
-l test/windows-bootstrap.el \
36+
-L . \
2537
--eval '(setq treemacs-no-load-time-warnings t)' \
2638
-f batch-byte-compile $(DAP-GENERAL) $(DAP-CLIENTS)
2739

28-
ci: clean build byte-compile test
40+
unix-ci: clean build unix-compile unix-test
41+
42+
windows-ci: CASK=
43+
windows-ci: clean windows-compile windows-test
2944

3045
clean:
3146
rm -rf .cask *.elc
3247

33-
test:
48+
unix-test:
3449
$(CASK) exec ert-runner -L .
50+
51+
windows-test:
52+
@$(EMACS) -Q --batch \
53+
-l test/windows-bootstrap.el \
54+
-L . \
55+
$(LOAD-TEST-FILES) \
56+
--eval "(ert-run-tests-batch-and-exit \
57+
'(and (not (tag no-win)) (not (tag org))))"

dap-mode.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ also `dap--make-terminal-buffer'."
120120
:type 'list)
121121

122122
(defcustom dap-label-output-buffer-category nil
123-
"If non-nil, content that is printed to the output buffer will be labelled based on DAP protocol category."
123+
"If non-nil, content that is printed to the output buffer will be labelled
124+
based on DAP protocol category."
124125
:group 'dap-mode
125126
:type 'boolean)
126127

@@ -163,7 +164,8 @@ has been terminated."
163164
:group 'dap-mode)
164165

165166
(defcustom dap-loaded-sources-changed-hook nil
166-
"List of functions to be called after loaded sources have changed for the session."
167+
"List of functions to be called after loaded sources have changed for
168+
the session."
167169
:type 'hook
168170
:group 'dap-mode)
169171

@@ -188,7 +190,8 @@ g. after calling `dap-continue')"
188190

189191
(defcustom dap-breakpoints-changed-hook nil
190192
"List of functions that will be called after breakpoints have changed.
191-
The hook will be called with the session file and the new set of breakpoint locations."
193+
The hook will be called with the session file and the new set of breakpoint
194+
locations."
192195
:type 'hook
193196
:group 'dap-mode)
194197

dap-python.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ If the port is taken, DAP will try the next port."
4444

4545
(defcustom dap-python-terminal nil
4646
"The terminal to use when running the debug process.
47-
For example you may set it to `xterm -e' which will pop xterm console when you are debugging."
47+
For example you may set it to `xterm -e' which will pop xterm console when
48+
you are debugging."
4849
:group 'dap-python
4950
:risky t
5051
:type 'string)

dap-ui.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ number - expand N levels."
152152
:group 'dap-ui)
153153

154154
(defcustom dap-ui-default-fetch-count 30
155-
"Default number of variables to load in inspect variables view for array variables."
155+
"Default number of variables to load in inspect variables view for
156+
array variables."
156157
:group 'dap-ui
157158
:type 'number)
158159

@@ -770,7 +771,8 @@ DEBUG-SESSION is the debug session triggering the event."
770771
;; locals
771772

772773
(defcustom dap-ui-variable-length 30
773-
"Default number of variables to load in inspect variables view for array variables."
774+
"Default number of variables to load in inspect variables view for
775+
array variables."
774776
:group 'dap-ui
775777
:type 'number)
776778

test/windows-bootstrap.el

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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" . "http://elpa.gnu.org/packages/")))
34+
(pkgs (append '(dash lsp-mode dash-functional bui f s lsp-treemacs posframe)
35+
'(ecukes espuds undercover ert-runner))))
36+
(package-initialize)
37+
(package-refresh-contents)
38+
39+
(mapc (lambda (pkg)
40+
(unless (package-installed-p pkg)
41+
(package-install pkg)))
42+
pkgs)
43+
44+
(add-hook 'kill-emacs-hook
45+
`(lambda () (delete-directory ,user-emacs-directory t))))
46+
47+
;;; windows-bootstrap.el ends here

0 commit comments

Comments
 (0)