Skip to content

Commit 10d3842

Browse files
authored
Add CI test (#14)
* Add windows bootstrap * Add CI config * Add CI Makefile * Add CI badge * Remove Cask build * Consistent test on all OSs * Use byte-compile on warn * Try el instead * Revert load * Fixed separator * Fix not compiling
1 parent 948c3a3 commit 10d3842

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
- name: Run tests
26+
run: make ci
27+
28+
windows-test:
29+
runs-on: windows-latest
30+
strategy:
31+
matrix:
32+
emacs-version:
33+
- 26.1
34+
- 26.2
35+
- 26.3
36+
- 27.1
37+
- snapshot
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
42+
- uses: jcs090218/setup-emacs-windows@master
43+
with:
44+
version: ${{ matrix.emacs-version }}
45+
46+
- name: Run tests
47+
run: make ci

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.PHONY: all compile clean
2+
3+
EMACS ?= emacs
4+
CASK ?= cask
5+
6+
LSP-SOURCEKIT-GENERAL := lsp-sourcekit.el
7+
8+
all:
9+
$(CASK) build
10+
11+
build:
12+
$(CASK) install
13+
14+
compile:
15+
@echo "Compiling..."
16+
@$(CASK) $(EMACS) -Q --batch \
17+
-l test/windows-bootstrap.el \
18+
-L . \
19+
--eval '(setq byte-compile-error-on-warn t)' \
20+
-f batch-byte-compile *.el
21+
22+
ci: CASK=
23+
ci: clean compile
24+
25+
clean:
26+
rm -rf .cask *.elc

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![Build Status](https://github.com/emacs-lsp/lsp-sourcekit/workflows/CI/badge.svg?branch=master)](https://github.com/emacs-lsp/lsp-sourcekit/actions)
12
[![MELPA](https://melpa.org/packages/lsp-sourcekit-badge.svg)](https://melpa.org/#/lsp-sourcekit)
23

34
# lsp-sourcekit

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 '(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)